Basic instructions

In each programming language there are a fixed number of basic instructions you may use to write a program. You're only allowed to use these instructions directly when writing a program (script). For our robot the following basic instructions exist:

Move


forward(n)
Move n steps forward

backward(n)
Move n steps backward

left()
Turn left over 90 degrees

right()
Turn right over 90 degrees


Paint


paintWhite()
Put the brush with white paint to the ground.

paintBlack()
Put the brush with black paint to the ground.

stopPainting()
Stop painting, hide the brush.

Grab


pickUp()
Get the beacon in front of the robot

putDown()
Put a beacon in front of the robot

eatUp()
Pick up and destroy the beacon in front.

See

Left
Front
Right
leftIsObstacle()
frontIsObstacle()
rightIsObstacle()
leftIsClear()
frontIsClear()
rightIsClear()
leftIsBeacon()
frontIsBeacon()
rightIsBeacon()
leftIsWhite()
frontIsWhite()
rightIsWhite()
leftIsBlack()
frontIsBlack()
rightIsBlack()

Flip Coin

flipCoin()
Flip a coin to make a random choice. flipCoin() will either be true or false with a chance of 50% - 50%.



Views
2 Total Views
2 Members Views
0 Public Views
Share on Social Networks
Share Link
Share by mail

Please login to share this webpage by email.