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 the bot one case in the specified direction. dir can be "left", "right", "up" or "down" (case sensitive).
- drop a block of the specified material below the robot. The block will then fall. material can be any block type below
- Display the message in the console
- Make the robot wait for the time of one action
- alias of move("left")
- alias of move("right")
- alias of move("up")
- alias of move("down")
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
- Check if the robot can move in the specified direction.
- 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.
- The height of the robot to the first block below him. A height of zero means that the robot is right above the block
- The type of block the robot is above.
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.