Minecraft Robot Programming

Thursday, 27 September 2012 18:07 Lior
Print

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

Write the program using a book and quill. You do not need to sign the book, so you can edit it latter. With the book in your hand, right click on the robot. The robot will execute the program. Tip: you can use copy and paste to paste lines into the book. Make sure to program away from the robot, or the robot will execute the last program in the book.



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>

}

 

Last Updated on Sunday, 07 October 2012 14:11