Пример #1
0
def tests_simple():
    r = read_data("world1.txt")
    c = World(r[1])
    w = r[2]
    rc = r[3]
    rb = robot(int(rc[0][1]), int(rc[0][2]))
    print(rb.current_position())
    for i in range(len(r[2])):
        c.setWalls(int(w[i][1]), int(w[i][2]))

    print(c.map)
    print()
    rb.move_robot(4, 1, c.map, r[1])
    print(rb.current_position())
    rb.move_robot(9, 1, c.map, r[1])
    print(rb.current_position())
    rb.move_robot(7, 0, c.map, r[1])
    if (rb.goal_reached(7, 0)):
        print("goal reached")
Пример #2
0
 def test_say_2_when_2(self):
     self.assertEqual(robot(2), '2')
Пример #3
0
 def test_say_1_when_1(self):
     self.assertEqual(robot(1), '1')
Пример #4
0
 def test_say_fizzbuzz_when_15(self):
     self.assertEqual(robot(15), 'fizzbuzz')
Пример #5
0
 def test_say_14_when_14(self):
     self.assertEqual(robot(14), '14')
Пример #6
0
 def test_say_13_when_13(self):
     self.assertEqual(robot(13), '13')
Пример #7
0
 def test_say_fizz_when_12(self):
     self.assertEqual(robot(12), 'fizz')
Пример #8
0
 def test_say_buzz_when_10(self):
     self.assertEqual(robot(10), 'buzz')
Пример #9
0
 def test_say_fizz_when_9(self):
     self.assertEqual(robot(9), 'fizz')
Пример #10
0
 def test_say_8_when_8(self):
     self.assertEqual(robot(8), '8')
Пример #11
0
 def test_say_7_when_7(self):
     self.assertEqual(robot(7), '7')
Пример #12
0
 def test_say_buzz_when_5(self):
     self.assertEqual(robot(5), 'buzz')
Пример #13
0
 def test_say_4_when_4(self):
     self.assertEqual(robot(4), '4')