Code Editor
// Console output appears here
Ready — press Run to start x: 280   y: 280   heading: 0°
Sensors
Distance (front)
Distance (left)
Distance (right)
Line (left)
Line (centre)
Line (right)
Colour
Maps
Robot API
robot.moveForward(px)
Move forward by px pixels
robot.moveBackward(px)
Move backward by px pixels
robot.turnLeft(deg)
Rotate left by degrees
robot.turnRight(deg)
Rotate right by degrees
robot.getDistance(dir?)
Returns px to nearest wall. dir: "front" | "left" | "right"
robot.getLine(pos?)
Returns true if line sensor detects dark. pos: "left" | "centre" | "right"
robot.getColour()
Returns colour name under robot
robot.setSpeed(n)
Set speed 1–10 (default 5)
log(message)
Print to the console below