DEV Community 👩‍💻👨‍💻

John Mark Rafanan
John Mark Rafanan

Posted on

Day 06 of 100 Days of Code Python Bootcamp by Dr. Angela

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()

Enter fullscreen mode Exit fullscreen mode

Output:

Day 06 Output

Maze Puzzle:

Top comments (0)

Have you saved a post on DEV?

Head to your Reading List to read and manage the posts you've saved.