1.4 KiB
1.4 KiB
Claro Quick Start Guide
Programming Made Simple
What is Claro?
Claro is a small scripting language designed for beginners. It uses readable commands like SAY, ASK, SET, and TEACH.
1. Show a message
SAY "Hello!"
Run it:
./claro hello.claro
2. Ask a question
ASK "What is your name?" AS name
SAY "Hello " + name
3. Remember information
SET score TO 10
SAY score
4. Make a choice
IF score >= 5
SAY "Good job!"
ELSE
SAY "Try again."
ENDIF
5. Repeat something
DO 3 TIMES
SAY "Practice"
DONE
6. Use a list
SET items TO LIST
ADD "milk" TO items
ADD "bread" TO items
FOR EACH item IN items
SAY item
DONE
7. Teach a function
TEACH greet TAKES name
RETURN "Hello " + name
LEARNED
CALL greet WITH "Alex"
SAY RESULT
8. Save a file
WRITE FILE "note.txt" WITH "Hello from Claro"
READ FILE "note.txt" AS note
SAY note
Good first project: a quiz
SAY "Tiny Quiz"
ASK "What is 2 + 2?" AS answer
IF answer = 4
SAY "Correct!"
ELSE
SAY "The answer is 4."
ENDIF
Tips
- Use
SAYto show information. - Use
ASKto get information. - Use
SETto remember information. - Use
IFwhen the program needs to choose. - Use
DOorFORwhen something repeats. - Use
TEACHto make reusable code.