Files
Claro/docs/FIRST_HOUR.md
Hermes Agent d555071406 fix: stabilize learning path, reliability and legacy Windows builds
Unify beginner syntax while preserving compatibility, repair ownership and parser guards, add verified distribution tooling and VC6 Windows 98 build inputs, and clarify documentation and release status. Preserve DOS build-input line endings and exclude generated binaries/caches.
2026-10-20 22:40:19 +00:00

98 lines
1.3 KiB
Markdown

# Claro First Hour
This is a simple first-hour lesson path for new learners. Keep each lesson short. Let the learner run the program after every change.
Use the same short forms throughout this guide. See [the syntax rules](SYNTAX.md)
for a small reference; older forms are kept in [compatibility syntax](COMPATIBILITY.md).
## 1. Say hello
```claro
SAY "Hello!"
```
## 2. Ask a question
```claro
ASK "What is your name?" name
SAY "Hello " + name
```
## 3. Store a variable
```claro
SET score 0
SAY score
```
## 4. Do simple math
```claro
SET score 0
SET score score + 1
SAY score
```
## 5. Make a decision
```claro
ASK "What is 2 + 2?" answer
IF answer = 4
SAY "Correct!"
ELSE
SAY "The answer is 4."
END
```
Simple number-looking input can compare naturally with numbers.
## 6. Repeat something
```claro
DO 3 TIMES
SAY "Practice helps"
END
```
## 7. Use a list
```claro
SET items LIST
ADD "milk" TO items
ADD "bread" TO items
FOR EACH item IN items
SAY item
END
```
## 8. Teach a function
```claro
TEACH add a b
RETURN a + b
END
DO add 2 3
SAY RESULT
```
Expected output:
```text
5
```
## 9. Save and load text
```claro
WRITE FILE "note.txt" WITH "Hello"
READ FILE "note.txt" AS text
SAY text
```
## 10. Build a tiny quiz
Try `examples/quiz.claro`.