def test_cycle_length_1 (self) :
     n = 1
     i = 1
     j = 10
     cache = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     v = cycle_length(n, i, j, cache)
     expected_cache = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     self.assert_(v == 1)
     self.assert_(cache == expected_cache)
 def test_cycle_length_3 (self) :
     n = 5
     i = 1
     j = 10
     cache = [1, 2, 0, 3, 6, 0, 0, 4, 0, 0]
     v = cycle_length(n, i, j, cache)
     expected_cache = [1, 2, 0, 3, 6, 0, 0, 4, 0, 0]
     self.assert_(v == 6)
     self.assert_(cache == expected_cache)
	def test_cycle_length_2 (self) :
		v = cycle_length(2)
		self.assert_(v == 2)
 def test_cycle_length_5(self):
     c = cycle_length(1)
     self.assertEqual(c, 1)
Ejemplo n.º 5
0
 def test_cycle_3 (self) :
     v = cycle_length(256)
     self.assertEqual(v, 9)
	def test_cycle_length_3 (self):
		l = cycle_length(5)
		self.assert_(l == 6)
 def test_cycle_1 (self) :
     a = 1
     b = cycle_length(a)
     self.assert_(b == 1)
 def test_cycle_length_7(self):
     c = cycle_length(5)
     self.assertEqual(c, 6)
Ejemplo n.º 9
0
 def test_cycle_length_6(self):
   v = cycle_length(837799)
   self.assertEqual(v, 525)
 def test_cycle_length_1(self):
     l0 = cycle_length(0)
     self.assert_(l0 == 0)
 def test_cycle_length_100(self) :
     v = cycle_length(100)
     self.assert_(v == 26)   
Ejemplo n.º 12
0
 def test_cycle_length_3 (self) :
     result = cycle_length(26623)
     self.assert_(result == 308)
Ejemplo n.º 13
0
 def test_cycle_length_4 (self) :
     result = cycle_length(35655)
     self.assert_(result == 324)
Ejemplo n.º 14
0
 def test_cycle_length_2 (self) :
     result = cycle_length(17647)
     self.assert_(result == 279)
Ejemplo n.º 15
0
 def test_cycle_length_1 (self) :
     result = cycle_length(6171)
     self.assert_(result == 262)
 def test_cycle_length_8(self):
     c = cycle_length(9)
     self.assertEqual(c, 20)
	def test_cycle_length_4 (self) :
		v = cycle_length(10)
		self.assert_(v == 7)
Ejemplo n.º 18
0
 def test_cycle_length_2(self):
   v = cycle_length(9)
   self.assertEqual(v, 20)
 def test_cycle_length_2(self):
     l = cycle_length(-1)
     self.assert_(l == 0)
 def test_cycle_length_6(self):
     c = cycle_length(3)
     self.assertEqual(c, 8)
Ejemplo n.º 21
0
 def test_cycle_length_3(self):
     v = cycle_length(3)
     self.assertEqual(v, 8)
 def test_cycle_length_3(self):
     l = cycle_length(5)
     self.assert_(l == 6)
Ejemplo n.º 23
0
 def test_cycle_length_4(self):
   v = cycle_length(100000)
   self.assertEqual(v, 129)
Ejemplo n.º 24
0
	def test_cycle_length_1(self):
		self.assertEqual(cycle_length(1),1)
	def test_cycle_length_1 (self):
		l0 = cycle_length(0)
		self.assert_(l0 == 0)
Ejemplo n.º 26
0
	def test_cycle_length_2(self):
		self.assertEqual(cycle_length(5),6)
Ejemplo n.º 27
0
 def test_cycle_length_3 (self) :
     self.assertEqual(cycle_length(5), 6)
Ejemplo n.º 28
0
	def test_cycle_length_3(self):
		self.assertEqual(cycle_length(10),7)
 def test_cycle_3 (self) :
     a = 10
     b = cycle_length(a)
     self.assert_(b == 7)
Ejemplo n.º 30
0
 def test_cycle_length1(self):
     i = 1
     cl = cycle_length(i)
     self.assertEqual(cl, 1)
Ejemplo n.º 31
0
 def test_cycle_2 (self) :
     v = cycle_length(2)
     self.assertEqual(v, 2)
Ejemplo n.º 32
0
 def test_cycle_length2(self):
     i = 10
     cl = cycle_length(i)
     self.assertEqual(cl, 7)
Ejemplo n.º 33
0
 def test_cycle_4 (self) :
     v = cycle_length(524288)
     self.assertEqual(v, 20)
Ejemplo n.º 34
0
 def test_cycle_length3(self):
     i = 5
     cl = cycle_length(i)
     self.assertEqual(cl, 6)
	def test_cycle_length_3 (self) :
		v = cycle_length(5)
		self.assert_(v == 6)
Ejemplo n.º 36
0
 def test_cycle_length4(self):
     i = 3
     cl = cycle_length(i)
     self.assertEqual(cl, 8)
 def test_cycle_1(self):
     a = 1
     b = cycle_length(a)
     self.assert_(b == 1)
 def test_cycle_2(self):
     a = 5
     b = cycle_length(a)
     self.assert_(b == 6)
 def test_cycle_length_1(self) :
     v = cycle_length(1)
     self.assert_(v == 1)   
 def test_cycle_3(self):
     a = 10
     b = cycle_length(a)
     self.assert_(b == 7)
 def test_cycle_length_1mil(self) :
     v = cycle_length(1000000)
     self.assert_(v == 153)
 def test_cycle_4(self):
     a = 2
     b = cycle_length(a)
     self.assert_(b == 2)
Ejemplo n.º 43
0
 def test_cycle_length_1(self):
   v = cycle_length(1)
   self.assertEqual(v, 1)
Ejemplo n.º 44
0
 def test_cycle_length_3(self):
     v = cycle_length(444)
     self.assertEqual(v, 72)
Ejemplo n.º 45
0
 def test_cycle_length_3(self):
   v = cycle_length(500)
   self.assertEqual(v, 111)
Ejemplo n.º 46
0
 def test_eval_9(self):
     v = collatz_eval(111111, 111111)
     w = cycle_length(111111)
     self.assertEqual(v, w)
Ejemplo n.º 47
0
 def test_cycle_length_5(self):
   v = cycle_length(500000)
   self.assertEqual(v, 152)
Ejemplo n.º 48
0
 def test_cycle_length_1(self):
     v = cycle_length(10)
     self.assertEqual(v, 7)
Ejemplo n.º 49
0
 def test_cycle_length_7(self):
   v = cycle_length(999999)
   self.assertEqual(v, 259)
Ejemplo n.º 50
0
 def test_cycle_length_2(self):
     v = cycle_length(1)
     self.assertEqual(v, 1)
	def test_cycle_length_2 (self):
		l = cycle_length(-1)
		self.assert_(l == 0)
Ejemplo n.º 52
0
 def test_cycle_length_3(self):
     v = cycle_length(500000)
     self.assertEqual(v, 152)
Ejemplo n.º 53
0
 def test_cycle_length_2 (self) :
     self.assertEqual(cycle_length(1), 1)
Ejemplo n.º 54
0
 def test_cycle_length_4(self):
     v = cycle_length(999999)
     self.assertEqual(v, 259)
Ejemplo n.º 55
0
 def test_cycle_length_4 (self) :
     self.assertEqual(cycle_length(10), 7)
Ejemplo n.º 56
0
 def test_cycle_length_5(self):
     v = cycle_length(1000000)
     self.assertEqual(v, 153)
 def test_cycle_2 (self) :
     a = 5
     b = cycle_length(a)
     self.assert_(b == 6)
 def test_cycle_3(self):
     i=22
     l=cycle_length(22)
     self.assert_(l==15)
 def test_cycle_4 (self) :
     a = 2
     b = cycle_length(a)
     self.assert_(b == 2)
 def test_cycle_length_4(self):
     c = cycle_length(14)
     self.assertEqual(c, 18)