1
0
dust/examples/fizzbuzz.ds

19 lines
264 B
Plaintext
Raw Normal View History

2023-10-09 19:54:47 +00:00
count = 1
2023-10-06 12:17:37 +00:00
2023-10-09 19:54:47 +00:00
while count <= 15 {
2023-10-10 21:21:28 +00:00
mod_three = count % 3 == 0
mod_five = count % 5 == 0
2023-10-07 01:59:01 +00:00
2023-10-10 21:21:28 +00:00
if mod_three && mod_five {
(output 'fizzbuzz')
} else if mod_three {
2023-10-09 19:54:47 +00:00
(output 'fizz')
2023-10-10 21:21:28 +00:00
} else if mod_five {
2023-10-09 19:54:47 +00:00
(output 'buzz')
2023-10-10 21:21:28 +00:00
} else {
(output count)
2023-10-06 12:17:37 +00:00
}
2023-10-09 19:54:47 +00:00
count += 1
2023-10-06 12:17:37 +00:00
}