39 lines
442 B
Plaintext
Raw Normal View History

2024-08-02 23:11:22 +00:00
import log
import sys
main() {
fizzbuzz(15)
}
fizzbuzz(n) {
x := 1
loop {
// TODO: implement switch statement
if x % 15 == 0 {
print("FizzBuzz", 8)
} else {
if x % 5 == 0 {
print("Buzz", 4)
} else {
if x % 3 == 0 {
print("Fizz", 4)
} else {
log.number(x)
}
}
}
x += 1
if x > n {
return
} else {
print(" ", 1)
}
}
}
print(address, length) {
sys.write(1, address, length)
}