class ur_Robot { void move(); // robot moves forward one block void turnOff(); // robot turns itself off void turnLeft(); // robot pivots in place 90 degrees void pickBeeper(); // robot picks up beep and puts it into a bag void putBeeper(); // robot takes beeper out of bag and places on corner }
class Robot: ur_Robot { Boolean frontIsClear(); Boolean nextToABeeper(); Boolean nextToARobot(); Boolean facingNorth(); Boolean facingSouth(); Boolean facingEast(); Boolean facingWest(); Boolean anyBeepersInBeeperBag(); }
if ( <test> ) { <instruction> <instruction> ... <instruction> }
if ( <test> ) { <instruction> <instruction> ... <instruction> } else { <instruction> <instruction> ... <instruction> }
while ( <test> ) { <instruction> <instruction> ... <instruction> }
loop ( <positiveNumber> ) { <instruction> <instruction> ... <instruction> }
task { <robotInitialization> ... <robotInitialization> <instruction> <instruction> ... <instruction> }
ur_Robot <name>(<street>,<avenue>,<direction>,<numBeepers>); Robot <name>(<street>,<avenue>,<direction>,<numBeepers>);
class <new-class-name>: <old-class-name> { <list-of-instructions> } <definition-of-new-instructions>