1
0
dust/examples/fizzbuzz.ds

19 lines
284 B
Plaintext
Raw Permalink 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-12-30 02:15:03 +00:00
output('fizzbuzz')
2023-10-31 19:21:13 +00:00
} else if divides_by_3 {
2023-12-30 02:15:03 +00:00
output('fizz')
2023-10-31 19:21:13 +00:00
} else if divides_by_5 {
2023-12-30 02:15:03 +00:00
output('buzz')
2023-10-31 19:21:13 +00:00
} else {
2023-12-30 02:15:03 +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
}