Robotics

Loops Save Typing

Writing robot.moveForward() ten times in a row works, but a for loop does the exact same thing in three lines: for (let i = 0; i < 10; i++) { robot.moveForward(); } runs the code inside the braces 10 times in a row.

Your turn

Open the Robotics Lab and fix the loop in "Loops Save Typing" so it actually reaches the goal.

Open Robotics Lab
Ask JARVIS for a hint