Files
Toy/scripts/fizzbuzz.toy
Kayne Ruse 6cc331d462 While is working but untested, read more
* TODO: break and continue keywords need to be implemented
* TODO: while-then needs testing
* Fixed the parser not liking zero-length strings
2024-11-26 14:48:24 +11:00

28 lines
309 B
Plaintext

//moment of truth
var counter: int = 1;
while (counter <= 100) {
var result: string = "";
if (counter % 3 == 0) {
result = result .. "fizz";
}
if (counter % 5 == 0) {
result = result .. "buzz";
}
//finally
if (result == "") {
print counter;
}
else {
print result;
}
counter += 1;
}