Skip to content

Hello World

You need: one Programmable Computer. Nothing else.

  1. Place the computer and right-click it with an empty hand.
  2. Select Open Editor. Select all the text with Ctrl+A and delete it.
  3. Type this program:
on startup {
print("Hello, world!")
}
  1. Select Save & Apply. The computer’s screen turns green: the program is running.
  2. Select Debug ▸ in the editor. Under Output you see Hello, world!

on startup runs once, when the program starts. print writes a line to the program’s output.

Programs can remember things in globals. A global keeps its value even when the program stops and starts again.

global ticks = 0
on startup {
print("Starting the clock")
}
on timer.every(20) {
ticks++
print(str(ticks) + " seconds")
}

on timer.every(20) runs every 20 game ticks, about once a second. ticks++ adds one to ticks, and str(ticks) turns the number into text so it can be joined with " seconds".

Select Stop, then Start / Restart: the count continues where it was, because ticks is a global.

  • Programs are made of event handlers that start with on.
  • print shows text in the debug panel’s Output.
  • global values are saved.

Next: build an intruder alarm, or learn more about the language in values and variables.