2023-10-09 15:54:47 -04:00
|
|
|
count = 1
|
2023-10-06 08:17:37 -04:00
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
while count <= 15 {
|
2023-10-23 20:45:47 -04:00
|
|
|
divides_by_3 = count % 3 == 0
|
|
|
|
divides_by_5 = count % 5 == 0
|
2023-10-06 21:59:01 -04:00
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
if divides_by_3 && divides_by_5 {
|
2023-10-31 13:04:22 -04:00
|
|
|
output 'fizzbuzz'
|
2023-10-31 15:21:13 -04:00
|
|
|
} else if divides_by_3 {
|
2023-10-31 13:04:22 -04:00
|
|
|
output 'fizz'
|
2023-10-31 15:21:13 -04:00
|
|
|
} else if divides_by_5 {
|
2023-10-31 13:04:22 -04:00
|
|
|
output 'buzz'
|
2023-10-31 15:21:13 -04:00
|
|
|
} else {
|
2023-10-31 13:04:22 -04:00
|
|
|
output count
|
2023-10-31 15:21:13 -04:00
|
|
|
}
|
2023-10-09 15:54:47 -04:00
|
|
|
|
|
|
|
count += 1
|
2023-10-31 15:21:13 -04:00
|
|
|
}
|