Computercraft:Hello World Tutorial: Difference between revisions
(Undo revision 2536 by 194.190.23.11 (talk)) |
(Undo revision 1850 by 91.121.27.33 (talk)) |
||
Line 1: | Line 1: | ||
==If you havn't read the [[Computercraft:Getting Started]], do that first!== | |||
It is required to read that first, before you can start with the tutorials! | |||
==What is "Hello World"== | |||
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. | |||
==The tutorial== | |||
[[File:HW2.png|thumb|264px|"Hello World" code]] | |||
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) | |||
==See Also== | |||
*[[Computercraft Tutorials]] | |||
[[Category:Computercraft]] | |||
[[Category:Tutorials]] |
Latest revision as of 15:09, 29 July 2012
Contents
If you havn't read the Computercraft:Getting Started, do that first!
It is required to read that first, before you can start with the tutorials!
What is "Hello World"
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.
The tutorial
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)