Files
Toy/scripts/fizzbuzz.toy
T
Ratstail91 6c055a0435 Implemented garbage collection
As a whole, this is still tentative.
2026-05-08 16:28:12 +10:00

25 lines
355 B
Plaintext

//standard example, using 'while' instead of 'for', because it's not ready yet
var counter: Int = 0;
while (++counter <= 100) {
var result: String = "";
if (counter % 3 == 0) {
result = result .. "fizz";
}
if (counter % 5 == 0) {
result = result .. "buzz";
}
//finally
if (result != "") {
print result;
}
else {
print counter;
}
}