User Tools

Site Tools


labs:minecraft

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
labs:minecraft [2017/05/17 12:58]
mikoenig
labs:minecraft [2020/08/31 21:05] (current)
Line 20: Line 20:
 Run and read through the example program ("​TurtleMain"​). Run and read through the example program ("​TurtleMain"​).
 If you can't find the turtle moving about, try printing its location using ''​System.out.println(turtle.getLocation())''​. If you can't find the turtle moving about, try printing its location using ''​System.out.println(turtle.getLocation())''​.
-If you have trouble understanding what's going on, be sure to check out the [[labs:​minecraft#​Hints|Hints section]] below! 
- 
 ==== Hints ==== ==== Hints ====
   * In Minecraft the y coordinate is used for the height axis: near 0 you will encounter indestructible bedrock blocks, while ocean level is 64.   * In Minecraft the y coordinate is used for the height axis: near 0 you will encounter indestructible bedrock blocks, while ocean level is 64.
Line 33: Line 31:
 ==== Hints ==== ==== Hints ====
   * Once turtles start placing blocks in the correct spots, the progress of the building will be displayed in in-game chat.   * Once turtles start placing blocks in the correct spots, the progress of the building will be displayed in in-game chat.
-  * If a turtle function call fails (i.e., returns false), you can use the getFailureReason() method to obtain a string containing the reason. The reason will also be output to stderr.+  * If a turtle function call fails (i.e., returns false), you can use the ''​getFailureReason()'' ​method to obtain a string containing the reason. The reason will also be output to stderr.
   * A turtle can interact with the 3 blocks in front of, above and below them. To access other blocks it needs to move or turn.   * A turtle can interact with the 3 blocks in front of, above and below them. To access other blocks it needs to move or turn.
-  * Turtles have an inventory of 16 slots labeled 1 through 16, all starting out empty. A slot can hold up to 64 of any single block type. When a block is mined it is placed in the first slot of its type (if there is any) or into the first empty slot (if there is not). Use the select(int slot) function to choose which slot is used for actions, e.g., for placing blocks from. +  * Turtles have an inventory of 16 slots labeled 1 through 16, all starting out empty. A slot can hold up to 64 of any single block type. When a block is mined it is placed in the first slot of its type (if there is any) or into the first empty slot (if there is not). Use the ''​select(int slot)'' ​function to choose which slot is used for actions, e.g., for placing blocks from. 
-  * We extended the [[http://​computercraft.info/​wiki/​Turtle_%28API%29|Turtle API]] by 2 additional methods to allow a turtle to determine its position and orientation in the world: getLocation() and getFacing().+  * We extended the [[http://​computercraft.info/​wiki/​Turtle_%28API%29|Turtle API]] by 2 additional methods to allow a turtle to determine its position and orientation in the world: ​''​getLocation()'' ​and ''​getFacing()''​.
  
  
 ===== Exercise 2 ===== ===== Exercise 2 =====
 +**Setup:** Copy ''/​home/​lab/​local-data/​turtles/​exercise2/​ComputerCraft.cfg''​ over the existing file of the same name in ''/​home/​lab/​.minecraft/​config'',​ and restart Minecraft.
 +
 Now that you have understood the basics, it is time to add some parallelization! Build tower hollow of height 10 with a 5x5 area and a few holes in the side (see whiteboard). The tower should be made of cobblestone only (block name ''​minecraft:​cobblestone''​). Now that you have understood the basics, it is time to add some parallelization! Build tower hollow of height 10 with a 5x5 area and a few holes in the side (see whiteboard). The tower should be made of cobblestone only (block name ''​minecraft:​cobblestone''​).
 Again, the tower should start at y = 90 and be centered around the spawning location. Again, the tower should start at y = 90 and be centered around the spawning location.
  
-Try to complete this task as quickly as possible by using as many turtles as you can handle! On world seed "qwer" ​60 seconds is a good time. The assistants'​ record is 47.seconds+Try to complete this task as quickly as possible by using as many turtles as you can handle! On world seed ''​qwer'' ​60 seconds is a good time. The assistants'​ record is 43.seconds.
- +
-To tell the mod to look for the tower shape instead of the square, copy ''/​home/​lab/​local-data/​turtles/​exercise2/​ComputerCraft.cfg''​ over the existing file of the same name in ''/​home/​lab/​.minecraft/​config'',​ and restart Minecraft.+
  
 ==== Hints ==== ==== Hints ====
labs/minecraft.1495018716.txt.gz · Last modified: 2020/08/31 21:05 (external edit)