Difference between revisions of "Talk:Tutorials"

From ComputerCraft Wiki
Jump to: navigation, search
(Hole digging turtle)
(Cleanup: new section)
Line 64: Line 64:
 
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!
 +
 +
== Cleanup ==
 +
 +
This tutorials section is badly in need of a cleanup. The only page here ''that is actually a tutorial'' is the "Hello World!" script, and everyone who's ever coded in any language knows that is the most basic script you can create, and always the first script for new languages.
 +
''Every'' other page here is just throwing scripts at the user. The "Password protected door" page screenshots are ignoring ''all'' best practices. I'll be rewriting this section, if you want to help, use the current pages as an example of what ''not'' to do.
 +
Tutorials should be for teaching, not showing off. [[User:My hat stinks|my_hat_stinks]] 11:13, 15 May 2012 (UTC)

Revision as of 11:13, 15 May 2012

Here is a bunch of tutorials!

Hole digging turtle

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!

Cleanup

This tutorials section is badly in need of a cleanup. The only page here that is actually a tutorial is the "Hello World!" script, and everyone who's ever coded in any language knows that is the most basic script you can create, and always the first script for new languages. Every other page here is just throwing scripts at the user. The "Password protected door" page screenshots are ignoring all best practices. I'll be rewriting this section, if you want to help, use the current pages as an example of what not to do. Tutorials should be for teaching, not showing off. my_hat_stinks 11:13, 15 May 2012 (UTC)