Conditional Statements
Now that Godzilla doesn’t need to read a scroll to reach his destination, he encounters another problem. If his path isn’t straight and is full of twists and turns, can he still use the repeating command? Since repeating commands always repeat a similar action, this seems impossible for him. He wants to look around at each step he takes, and if:
- The path is to the left, turn left.
- The path is to the right, turn right.
- The path is straight, do nothing.
What do you think Godzilla, besides knowing how to use loops, should also know in order to decide who should do what and get home?
Exactly. Conditional statements can help us decide the right path to take at any point in the journey.
Conditional statements are like movement commands that can be used anywhere in the algorithm. Then, the robot might use both conditional statements and iterative statements. Conditional statements can assist us in determining the right decision and finding the path at any point in the journey.

