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