Day 06 - Code Blocks, Indentations and Functions
For this day, I solved a maze puzzle on Reeborg's World and learned about functions, indentations and code blocks. I also learned about different functions to solve different problem sets.
The goal is to move the robot at the destination/goal.
Code:
def turn_right():
turn_left()
turn_left()
turn_left()
while front_is_clear():
move()
turn_left()
while not at_goal():
if right_is_clear():
turn_right()
move()
elif front_is_clear():
move()
else:
turn_left()
Output:
Top comments (0)