on 6d45ede help sign in
38 lines 851 B history raw
1---
2navhome: /docs
3sort: 1
4comments: true
5---
7# Friends of FizzBuzz
91. Consider the following implementation of FizzBuzz, which is
10 equivalent to the one in the [Demo](../../demo) section.
12 ```
13 |= end/atom
14 =+ count=1
15 |-
16 ^- (list tape)
17 ?: =(end count)
18 ~
19 :-
20 ?: =(0 (mod count 15))
21 "FizzBuzz"
22 ?: =(0 (mod count 5))
23 "Fizz"
24 ?: =(0 (mod count 3))
25 "Buzz"
26 (pave !>(count))
27 $(count (add 1 count))
28 ```
30 Modify this to produce "Fuzz" when the number is divisible by
31 7, "Fuzz" when divisible by 21, "FuzzFizz" when divisible by 35,
32 and "FuzzFizzBuzz" when divisible by 105.
341. Modify FizzBuzz from the previous exercise to take both a
35 start and an end number.
371. Modify FizzBuzz from the previous exercise to count down
38 instead of up.