Difference between revisions of "Talk:Tutorials"
(Created page with "=== Hole digging turtle === Here is a quick little code i made, it makes a turtle dig a hole, 4x4 and 4 deep. local function Digpart() turtle.digDown() turtle.down() turtle....") |
(→Hole digging turtle) |
||
Line 3: | Line 3: | ||
Here is a quick little code i made, it makes a turtle dig a hole, 4x4 and 4 deep. | Here is a quick little code i made, it makes a turtle dig a hole, 4x4 and 4 deep. | ||
− | local function Digpart() | + | <nowiki>local function Digpart() |
turtle.digDown() | turtle.digDown() | ||
turtle.down() | turtle.down() | ||
Line 55: | Line 55: | ||
turtle.turnRight() | turtle.turnRight() | ||
turtle.turnRight() | turtle.turnRight() | ||
− | turtle.forward() | + | turtle.forward()</nowiki> |
Lets break it down, its quite simple, the first part creates a function, a function can be reused whenever you want, its just a good way of making things more, Tidy, next we have 4 parts that call the function, this makes the turtle dig the hole 4 times, making it 4 deep. | Lets break it down, its quite simple, the first part creates a function, a function can be reused whenever you want, its just a good way of making things more, Tidy, next we have 4 parts that call the function, this makes the turtle dig the hole 4 times, making it 4 deep. | ||
the next part, is very simple, it gets the little turtle out of the hole, so you don't have to climb down there to get your little friend back. | the next part, is very simple, it gets the little turtle out of the hole, so you don't have to climb down there to get your little friend back. | ||
well, that's my little code, hope you enjoy it! | well, that's my little code, hope you enjoy it! |
Revision as of 05:15, 28 April 2012
Hole digging turtle
Here is a quick little code i made, it makes a turtle dig a hole, 4x4 and 4 deep.
local function Digpart() turtle.digDown() turtle.down() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.turnRight() turtle.dig() turtle.forward() turtle.turnRight() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.turnLeft() turtle.dig() turtle.forward() turtle.turnLeft() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.turnRight() turtle.dig() turtle.forward() turtle.turnRight() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.turnRight() end Digpart() Digpart() Digpart() Digpart() turtle.up() turtle.up() turtle.up() turtle.up() turtle.turnRight() turtle.turnRight() turtle.forward()
Lets break it down, its quite simple, the first part creates a function, a function can be reused whenever you want, its just a good way of making things more, Tidy, next we have 4 parts that call the function, this makes the turtle dig the hole 4 times, making it 4 deep. the next part, is very simple, it gets the little turtle out of the hole, so you don't have to climb down there to get your little friend back. well, that's my little code, hope you enjoy it!