26 lines
282 B
Plaintext
Raw Normal View History

import io
2024-08-03 01:11:22 +02:00
main() {
fizzbuzz(15)
}
2025-02-17 14:31:47 +01:00
fizzbuzz(n int) {
2024-08-03 01:11:22 +02:00
x := 1
loop {
2024-08-03 22:24:40 +02:00
switch {
x % 15 == 0 { io.out("FizzBuzz") }
x % 5 == 0 { io.out("Buzz") }
x % 3 == 0 { io.out("Fizz") }
2025-02-22 18:02:50 +01:00
_ { io.number(x) }
2024-08-03 01:11:22 +02:00
}
x += 1
if x > n {
return
}
2024-08-03 22:24:40 +02:00
io.out(" ")
2024-08-03 01:11:22 +02:00
}
}