27 lines
294 B
Plaintext
27 lines
294 B
Plaintext
import io
|
|
import log
|
|
|
|
main() {
|
|
fizzbuzz(15)
|
|
}
|
|
|
|
fizzbuzz(n Int) {
|
|
x := 1
|
|
|
|
loop {
|
|
switch {
|
|
x % 15 == 0 { io.out("FizzBuzz") }
|
|
x % 5 == 0 { io.out("Buzz") }
|
|
x % 3 == 0 { io.out("Fizz") }
|
|
_ { log.number(x) }
|
|
}
|
|
|
|
x += 1
|
|
|
|
if x > n {
|
|
return
|
|
}
|
|
|
|
io.out(" ")
|
|
}
|
|
} |