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

junohegel

John Mark Rafanan

Posted on August 3, 2022

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:

💖 💪 🙅 🚩
junohegel
John Mark Rafanan

Posted on August 3, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related