A 'variable' is like a labeled box where you store data (like numbers or text). A 'loop' is a way to tell the computer to repeat an action multiple times without writing the same code over and over.
Creating a variable (e.g., let score = 0;).
Updating the variable (e.g., score = score + 10;).
Running a block of code multiple times (e.g., for loop).
Change the number of steps and watch the robot execute the loop!
let steps = 3;
for (let i = 0; i < steps; i++) {
robot.moveForward();
}
Test your logic!