Difference between revisions of "Hello World Tutorial"
(Undo revision 3691 by 96.235.236.248 (talk)) |
(→Creating the Program) |
||
Line 2: | Line 2: | ||
This tutorial is for those who are just getting started with ComputerCraft. | This tutorial is for those who are just getting started with ComputerCraft. | ||
− | + | Eating Cookie Monster :O--[[Special:Contributions/68.230.69.13|68.230.69.13]] 15:55, 26 November 2012 (MSK) | |
Creating a Hello World program is a simple task and does not require much knowledge in Lua or ComputerCraft. | Creating a Hello World program is a simple task and does not require much knowledge in Lua or ComputerCraft. |
Revision as of 11:55, 26 November 2012
This tutorial is for those who are just getting started with ComputerCraft.
Eating Cookie Monster :O--68.230.69.13 15:55, 26 November 2012 (MSK)
Creating a Hello World program is a simple task and does not require much knowledge in Lua or ComputerCraft. The first step is to create the program so we can edit it. Access your computer and type:
edit helloworld
You will now have a blank program that you can edit.
We can make the computer print "Hello World!" in three different ways.
To print it letter by letter, type:
textutils.slowPrint("Hello World!")
Please don't overuse slowprint as it can annoy some users.
To just print it, type:
print("Hello World!")
You can also use:
write("Hello World!\n")
Using \n will make the console go to the next line. (print does this automatically!)
Now, press CTRL and make sure Save is selected, then press ENTER or RETURN. The program is now completed and saved, so let's exit edit mode. Press CTRL and select Exit by using the arrow keys. Once selected press ENTER or RETURN.
To test it, type:
helloworld
Simple isn't it?
What We Learned
- How to create a program.
- How to edit a program.
- How to "slow print" text.
- How to print text.
- How to save a program.
- How to run a program.
Code
textutils.slowPrint("Hello World!") print("Hello World!")