예제 #1
0
	def test_1(self):
		initial_state_tape = [1, 4, 3, 2]
		end_state_tape = [1, 2, 3, 4]

		initial_state_tape_from_function = find_initial_state_of_tape(end_state_tape)
		
		self.assertEqual(initial_state_tape, initial_state_tape_from_function)
예제 #2
0
 def istate(self):
     if self.app.pargs.list is not None and len(
             self.app.pargs.list) / 4 >= 1 and len(
                 self.app.pargs.list) % 4 == 0:
         inital_tape = lib.find_initial_state_of_tape(self.app.pargs.list)
         data = {'inital_tape': inital_tape}
         self.app.render(data, 'istate.jinja2')
예제 #3
0
	def test_3(self):
		initial_state_tape = [0, 0, 0, 0]
		end_state_tape = [0, 0, 0, 0]

		initial_state_tape_from_function = find_initial_state_of_tape(end_state_tape)
		
		self.assertEqual(initial_state_tape, initial_state_tape_from_function)