Improved fizzbuzz example
This commit is contained in:
parent
3ad9510421
commit
f9ff83136a
@ -10,18 +10,10 @@ fizzbuzz(n) {
|
||||
|
||||
loop {
|
||||
switch {
|
||||
x % 15 == 0 {
|
||||
print("FizzBuzz", 8)
|
||||
}
|
||||
x % 5 == 0 {
|
||||
print("Buzz", 4)
|
||||
}
|
||||
x % 3 == 0 {
|
||||
print("Fizz", 4)
|
||||
}
|
||||
_ {
|
||||
log.number(x)
|
||||
}
|
||||
x % 15 == 0 { print("FizzBuzz", 8) }
|
||||
x % 5 == 0 { print("Buzz", 4) }
|
||||
x % 3 == 0 { print("Fizz", 4) }
|
||||
_ { log.number(x) }
|
||||
}
|
||||
|
||||
x += 1
|
||||
|
Loading…
Reference in New Issue
Block a user