Esempio n. 1
0
 def test_initial_values(self):
     self.assertEqual(recursive_thue_morse(0), 0)
     self.assertEqual(recursive_thue_morse(1), 1)
     self.assertEqual(recursive_thue_morse(2), 1)
     self.assertEqual(recursive_thue_morse(3), 0)
     self.assertEqual(recursive_thue_morse(4), 1)
Esempio n. 2
0
 def test_sequence(self):
     expected = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0]
     for i, e in enumerate(expected):
         self.assertEqual(recursive_thue_morse(i), e)
Esempio n. 3
0
 def test_sequence(self):
     expected = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0]
     for i, e in enumerate(expected):
         self.assertEqual(recursive_thue_morse(i), e)
Esempio n. 4
0
 def test_initial_values(self):
     self.assertEqual(recursive_thue_morse(0), 0)
     self.assertEqual(recursive_thue_morse(1), 1)
     self.assertEqual(recursive_thue_morse(2), 1)
     self.assertEqual(recursive_thue_morse(3), 0)
     self.assertEqual(recursive_thue_morse(4), 1)