Robot Algorithm
Available Commands:
• moveForward() - Move one cell forward
• turnLeft() - Turn 90° left
• turnRight() - Turn 90° right
• canMoveForward() - Check if path ahead is clear
• isAtGoal() - Check if reached the goal
while (!isAtGoal()) { if (canMoveForward()) { moveForward(); } else { turnRight(); } }
Run Algorithm
Reset
Status:
Ready
Write your algorithm and click Run!