Lesson 5: Disk Maze Challenge
In this Disk Maze Challenge, the VR Robot will navigate the Disk Maze Playground from start to finish using the Front Eye Sensor. The VR Robot also must drive back to the starting position and begin the Disk Maze again, in order to solve the Disk Maze Challenge forever!
Learning Outcome
- Apply commands from the Drivetrain, Sensor, and Control categories to be able to solve the Disk Maze Challenge.
Putting It All Together
The if statement is found in the Control category. If the condition of the if statement reports True, then the VR Robot will perform a set of behaviors contained within the if statement. The behaviors inside of an if statement will be skipped if the condition of the if statement reports False.
To repeat the behaviors forever, the if statements must be contained within an infinite while loop.
If statements are used inside of infinite while loops in order for each condition of the if statement to be checked repeatedly. During the flow of the project, if the condition of the if statement is True, the commands inside of the if statement are executed. If the condition of the if statement is False, the commands inside of the if statement are skipped, and the flow of the project will continue to the next command.
Using if statements inside of infinite while loops allows a VR Robot to respond accordingly to its environment, such as stopping or turning when a VR Robot detects an object of a certain color.
Select the Next button to continue with the rest of this Lesson.