Introduction To Programming
Through minecraft
Creating The Robot
Create a snowman by placing vertically stacking two snow blocks on the ground and then place a pumpkin on top of them. Typing 'kit robot' will give you the materials needed to make a robot.
Programming The Robot
Each movment command can also except a parameter to make the robot move a given number of blocks.
For example forward(10); will make the robot move 10 blocks forward.
When performing the challenges you need to execute: getReward();
to get the reward when you think you reached the goal (the diamond block).
<!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -->
Movement:
forward();
backward();
left();
right();
jumpForward();
jumpBackward();
jumpLeft();
jumpRight();
getReward();
Setting Blocks:
setBlock();
setBlockForward();
setBlockBackward();
setBlockRight();
setBlockLeft();
Loops:
repeat(<number of times>)
{
<instructions to repeat>
}
Function Template:
function <name> ()
{
<function body>
}
With Parameters:
function <name> (<param1>, <param2>, …. )
{
<function body>
}