Before we add any code, we will need to make two new variables, specifically, two new boolean variables.
A boolean variable is a special type of variable that can only have a value of true or false.
To make a boolean variable go to the variables section and click on “Make a Boolean”. Name one variable “allDone” and the other “Wall”.
Once these boolean variables have been made, go ahead and add the code as shown. Our first bit of code is to set up our robot’s speed values, feel free to set these to different numbers.
Then we set both our boolean variables to false. The “allDone” boolean will be set to true when we complete the maze, the “Wall” boolean will be set to true when the robot detects a robot in front of it.
Last but not least, we end with a comment to mark the start of our algorithm.