Пример #1
0
 def test_increment(self):
     tape = [0]
     interpret("+", tape)
     self.assertEqual(tape, [1])
Пример #2
0
 def test_pointer(self):
     tape = [1, 2]
     interpret(">-<+", tape)
     self.assertEqual(tape, [2, 1])
Пример #3
0
 def test_jumps(self):
     tape = [0, 0]
     interpret("+++[>+<-]", tape)
     self.assertEqual(tape, [0, 3])
Пример #4
0
 def test_decrement(self):
     tape = [1]
     interpret("-", tape)
     self.assertEqual(tape, [0])
Пример #5
0
 def test_increment(self):
     tape = [0]
     interpret("+", tape)
     self.assertEqual(tape, [1])
Пример #6
0
 def test_jumps(self):
     tape = [0, 0]
     interpret("+++[>+<-]", tape)
     self.assertEqual(tape, [0, 3])
Пример #7
0
 def test_pointer(self):
     tape = [1, 2]
     interpret(">-<+", tape)
     self.assertEqual(tape, [2, 1])
Пример #8
0
 def test_decrement(self):
     tape = [1]
     interpret("-", tape)
     self.assertEqual(tape, [0])