4 ms·
The thing I really like about the Haskell Fibonacci and that Python FizzBuzz is the ease of scale. Want the next value of fib? Grab it. Want to put more restric
by mercuryrising 14y ago
The thing I really like about the Haskell Fibonacci and that Python FizzBuzz is the ease of scale. Want the next value of fib? Grab it. Want to put more restrictions on fizzbuzz? Add them to this list.
You build the sequence with only the necessary amount of starting information (0:1 for fib, ( (3, "fizz"), (7, "buzz") ), and generate the rest as you need. These are the (I think) most beautiful solutions to problems.
- tel 14y agoThat's more extensible. I think that's the perennial problem with FizzBuzz, whether decides the spec demands generalizability or simplicity.