Aquariumvlog (talk | contribs) (Computercraft Hello World tutorial) |
(Undo revision 1850 by 91.121.27.33 (talk)) |
(3 intermediate revisions by 3 users not shown) | |
(No difference)
|
It is required to read that first, before you can start with the tutorials!
Hello World is gonna be your first basic program. It will display the text "Hello World" when you run it. This program isn't gonna be anything big, as it is mainly your begin at the wonderfull LUA language.
1. To start, just craft a computer and place it. (If you didn't do that yet)
2. Open the computer, and create a program. Call it how you like it, but i will be using "hw" as name. ( Type "edit filename" to create the file!)
3. The function you are gonna need is the "print" function, so type in
print "Hello World" What you just did, was told the computer by typing "print". That there was gonna be some text he had to display. What he could be displaying could be anything, such as an variable. But that aren't we doing here, it just has to display the same text at all times. Thats thy the "Hello World" is between those quotation marks.
4. Save the program, and run it to check if it works. (Save/Exit in [ctrl] menu)
Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.