dust/examples/fizzbuzz.ds

19 lines
288 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-31 19:21:13 +00:00
while count <= 15 {
2023-10-24 00:45:47 +00:00
divides_by_3 = count % 3 == 0
divides_by_5 = count % 5 == 0
2023-10-07 01:59:01 +00:00
2023-10-31 19:21:13 +00:00
if divides_by_3 && divides_by_5 {
2023-11-15 01:00:57 +00:00
(output 'fizzbuzz')
2023-10-31 19:21:13 +00:00
} else if divides_by_3 {
2023-11-15 01:00:57 +00:00
(output 'fizz')
2023-10-31 19:21:13 +00:00
} else if divides_by_5 {
2023-11-15 01:00:57 +00:00
(output 'buzz')
2023-10-31 19:21:13 +00:00
} else {
2023-11-15 01:00:57 +00:00
(output count)
2023-10-31 19:21:13 +00:00
}
2023-10-09 19:54:47 +00:00
count += 1
2023-10-31 19:21:13 +00:00
}