Examples
Examples
Each card is its own page, with a copyable .alana program.
Start small. The kitchen sink is there when you feel brave.
Arithmetic
Numbers, add, sub, returning. Soft launch.
All types
str, schar, boolean, new, redefine. The whole wardrobe.
Parse & read
parsenum(readln) and a polite readk.
TryParse
Safe numeric parse, with a success flag and no drama.
Loops
while, for, forevery. Repeating yourself, but cute.
If / elseif / else
or, and, and a fallback for when nobody was right.
Comparisons
Every comparison keyword, in one slightly extra chain.
Functions
Return a boolean from call. Very decisive.
Arrays & scopes
length, push, pop, mutate in a func.
Imports & fields
Two files. public is the front door.
Classes & self
newobj, methods, and a birthday. Twice, for Jacob.
Basic inheritance
Dog extends Animal. Rex borrows GetName.
parent
Call upstairs, then add “is a developer”.
override
Speak() becomes Woof. Polymorphism, softly.
abstract
Shape refuses. Square finishes Area.
HTTP, JSON & errors
including the standard library, then POST and GET.
Kitchen sink
The long tour. She packed almost everything.