Skip to main content

Spec walkthrough

A short tour through the core language: a conditional with otherwise, a repeat … times as loop accumulating a sum, and a one-line function.

test.tiny
let age be 20

if age >= 18
show "Adult"
otherwise
show "Minor"

let sum be 0

repeat 5 times as i
set sum to sum + i

show sum

define square taking x
return x * x

show square(5)

Expected output:

Adult
10
25