Hacker News new | ask | show | jobs
by geraldbauer 2956 days ago
Big fan of fizz buzz. Edited / wrote / collected a (free open source) book titled "FizzBuzz (1, 2, Fizz, 4, Buzz,...) by Example - There's More Than One Way To Do It" [1] in the Yuki & Moto Press incl. functional, object-oriented, code-golf, and many more styles / versions. Happy fizz buzzing.

[1] https://yukimotopress.github.io/fizzbuzz

2 comments

If you want another I did it purely with Lambdas in C# [1].

[1] https://github.com/tonyedgecombe/functionalfizzbuzz/blob/mas...

My python teacher asked us an implementation of the factorial function.

I did almost the same as you, bootstrapping almost every constructs in python lambdas, and then, before handing it to him, I put it all on one line.

But I'm a good person, in a comment above that line, I copy pasted the same line with 'lambda' replaced by 'λ'.

(I did not use church numerals and there were no strings involved)

wow, you weren't kidding. you bootstrapped all your constructs from pure lambda-calculus!

I award you Best Use of Dynamic.

I found it a useful exercise for teaching Rust: https://chrismorgan.info/blog/rust-fizzbuzz.html