1
0
dust/examples/fizzbuzz.ds

26 lines
329 B
Plaintext
Raw Normal View History

2024-08-20 19:55:35 +00:00
let mut count = 1
2024-03-25 04:16:55 +00:00
while count <= 15 {
2024-08-20 19:55:35 +00:00
let divides_by_3 = count % 3 == 0
let divides_by_5 = count % 5 == 0
2024-03-25 04:16:55 +00:00
2024-11-18 01:32:53 +00:00
if divides_by_3 && divides_by_5 {
write_line("fizzbuzz")
return
2024-08-20 19:55:35 +00:00
}
2024-05-20 21:15:05 +00:00
2024-11-18 01:32:53 +00:00
if divides_by_3 {
write_line("fizz")
return
}
if divides_by_5 {
write_line("buzz")
return
}
write_line(count)
2024-08-10 08:45:30 +00:00
2024-03-25 04:16:55 +00:00
count += 1
}