Lesson 1 — Your first program
You are here
- Your first program ←
- Values and variables
- Making decisions
- Repeating things
- Functions
- Lists and hashes
- Strings
- Organizing programs
- Classes
What are we learning?
You will write one instruction, run it, and see text appear.
A program is a list of instructions for the computer.
An instruction is one step, like “print this sentence.”
The smallest useful program
echo
say("Hello, Echo!");What each part means
| Piece | Meaning |
|---|---|
say | Tell Echo to print something |
( ... ) | The thing to print goes inside |
"Hello, Echo!" | Text (words) — always in quotes |
; | End of this instruction |
Output
text
Hello, Echo!How to run it
In the Playground
- Open the Playground.
- Wait until status shows Ready.
- Make sure the left side contains the line above (or choose the Hello example).
- Click Run.
- Read the OUTPUT panel on the right.
On your computer
- Save the line in a file named
hello.echo. - In Terminal, go to that folder.
- Run:
bash
elang hello.echo(See Install Echo if elang is not set up yet.)
Try it — change the message
Change the text inside the quotes to your name, for example:
echo
say("Hello, Ada!");Expected output:
text
Hello, Ada!Run it again. You just changed an Echo program.
Fix it — missing semicolon
This is wrong (no ; at the end):
echo
say("Hello, Echo!")Echo stops and says it expected ;.
Add the semicolon and run again.
What you learned
- A program is a list of instructions.
sayprints text.- Text goes in quotes.
- Instructions end with
;.
Next
→ Lesson 2 — Values and variables
Also: Choose your path · Common mistakes
