Computercraft:Hello World Tutorial

Revision as of 15:09, 29 July 2012 by 82.69.100.52 (talk) (Undo revision 1850 by 91.121.27.33 (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

"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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis