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
|
|
|
|
|
|
|
|
if divides_by_3 && divides_by_5 {
|
2024-03-25 05:56:06 +00:00
|
|
|
io.write_line('fizzbuzz')
|
2024-03-25 04:16:55 +00:00
|
|
|
} else if divides_by_3 {
|
2024-03-25 05:56:06 +00:00
|
|
|
io.write_line('fizz')
|
2024-03-25 04:16:55 +00:00
|
|
|
} else if divides_by_5 {
|
2024-03-25 05:56:06 +00:00
|
|
|
io.write_line('buzz')
|
2024-03-25 04:16:55 +00:00
|
|
|
} else {
|
2024-03-25 05:56:06 +00:00
|
|
|
io.write_line(count)
|
2024-03-25 04:16:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
count += 1
|
|
|
|
}
|