Utopian Architect

Function

The function execute is the main function of your robot. You have to keep in mind that you're not really programming the robot but giving him a list of instruction to follow. Your code is executed instantly but the robot remember your order.

move(dir)
move the bot one case in the specified direction. dir can be "left", "right", "up" or "down" (case sensitive).
drop(material)
drop a block of the specified material below the robot. The block will then fall. material can be any block type below
console.log(message)
Display the message in the console
wait()
Make the robot wait for the time of one action
left()
alias of move("left")
right()
alias of move("right")
up()
alias of move("up")
down()
alias of move("down")

Robot

The robot know many thing about himself. For instance his possition, his height and if he can move in some direction. You can use these info in "if" condition or for loops

robot.canMove(direction)
Check if the robot can move in the specified direction.
robot.x
robot.y
The coordinnate of the robot on the grid. The origin of the grid is at the top left corner of the map. You can't modify this value directly.
robot.height
The height of the robot to the first block below him. A height of zero means that the robot is right above the block
robot.over
The type of block the robot is above.

Function creation

You can create function with the + button on the side bar. In your programme, you can use it by calling it. You can use arguments in the function if you need.

Materials

dirt
grass
glass
metal
rock
wood
plank
sand
leaves
leaves2