Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Age Calculator

lumen --examples age
yearNow = 2026
userYear = 0
println('Hello, world!')
print('Enter your birth year: ')
userYear = inputInt()
age = yearNow - userYear
print('Your age: ')
println(age)

A minimal but complete program: two variables, an integer read with inputInt(), one subtraction, and a mix of print and println.

Touches: variables, input/output, arithmetic operators.

Scan into Android

See Lumen on Android for how the scan-and-run pipeline works.