2024-08-05 18:47:24 +02:00

31 lines
374 B
Plaintext

import log
import sys
main() {
fizzbuzz(15)
}
fizzbuzz(n Int) {
x := 1
loop {
switch {
x % 15 == 0 { print("FizzBuzz", 8) }
x % 5 == 0 { print("Buzz", 4) }
x % 3 == 0 { print("Fizz", 4) }
_ { log.number(x) }
}
x += 1
if x > n {
return
}
print(" ", 1)
}
}
print(address Pointer, length Int) {
sys.write(1, address, length)
}