From 1080dc5e004336a206a6ebd4fae63e8b22e160d2 Mon Sep 17 00:00:00 2001 From: PeganovAnton Date: Tue, 3 Sep 2019 19:20:58 +0300 Subject: [PATCH] Fix testing bug If the rightmost painted cell has to be on the border of the robot pitch the cell is not painted and task testing system reports an error wrongly. --- pyrob/tasks/task_7_5.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrob/tasks/task_7_5.py b/pyrob/tasks/task_7_5.py index 40c307a..6272978 100755 --- a/pyrob/tasks/task_7_5.py +++ b/pyrob/tasks/task_7_5.py @@ -18,12 +18,14 @@ def load_level(self, n): d = 0 _d = 0 - while not rob.wall_is_on_the_right(): + while True: if _d == 0: pos = rob.get_pos() rob.set_cell_type(pos[0], pos[1], rob.CELL_TO_BE_FILLED) d += 1 _d = d + if rob.wall_is_on_the_right(): + break rob.move_right() _d -= 1