9
9
9vlad2021-07-17 15:07:40
Preparation of terms of reference
9vlad, 2021-07-17 15:07:40

The task is not solved, the completion is regular. Why is the problem not solved?

I solve practical problems for beginners - https://mipt-cs.github.io/python3-2017-2018/labs/l... . In my solution to problem No. 14, the Robot paints over all the required fields and stops at the black dot - in the final. But the Robot turns gray and becomes in "State No. 2: the task is not solved, the completion is normal." I don't understand what I did wrong. According to the condition, if the turquoise fields are painted over, and the Robot stops at the finish line, the task must be declared solved.

Decision
#!/usr/bin/python3

from pyrob.api import *

@task
def task_8_11():
def ab():
a = wall_is_above()
if a == 0:
move_up()
fill_cell()
move_down()
else:
fill_cell()
def be():
b = wall_is_beneath()
if b == 0:
move_down()
fill_cell()
move_up()

for i in range(100):
ab()
be()
r = wall_is_on_the_right()
if r == 0:
move_right()
else:
break
if __name__ == '__main__':
run_tasks()

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question