1
0
dust/examples/fizzbuzz.ds

24 lines
304 B
Plaintext
Raw Normal View History

use std.io
2024-03-25 04:16:55 +00:00
count = 1
while count <= 15 {
divides_by_3 = count % 3 == 0
divides_by_5 = count % 5 == 0
2024-05-20 21:15:05 +00:00
output = if divides_by_3 && divides_by_5 {
'fizzbuzz'
2024-03-25 04:16:55 +00:00
} else if divides_by_3 {
2024-05-20 21:15:05 +00:00
'fizz'
2024-03-25 04:16:55 +00:00
} else if divides_by_5 {
2024-05-20 21:15:05 +00:00
'buzz'
} else {
2024-05-21 21:07:12 +00:00
count as str
2024-03-25 04:16:55 +00:00
}
2024-05-20 21:15:05 +00:00
io.write_line(output)
2024-03-25 04:16:55 +00:00
count += 1
}
2024-06-19 04:05:58 +00:00