mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
27 lines
369 B
Plaintext
27 lines
369 B
Plaintext
//standard example, using 'while' instead of 'for', because it's not ready yet
|
|
|
|
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 result;
|
|
}
|
|
else {
|
|
print counter;
|
|
}
|
|
|
|
counter += 1;
|
|
}
|
|
|