Fifty Fizzbuzzes (Patreon)
Content
I did it! I made Fifty Fizzbuzzes! Yes, fifty different implementations of the classic Fizzbuzz programming exercise. Some of them output the solution. Some of them are flagrantly wrong. Some write you poetry, some play you songs.
Twitter user @quasiben was kind enough to figure out how to host an interactive version with all the dependencies, go here and click Fifty Fizzbuzzes.ipynb (it might take a minute to load).
It's on my github here, where it's read-only, unless you download the file and run it, for which you'll need jupyter python stuff. I use Anaconda.
Fifty is a lot of programs, even if many are just 1 to 5 lines. It was an intense exercise.
favourites:
#22, which uses a linear regression and proves AI is smarter than humans.
#25, which reveals the state of mind of someone who's halfway through writing 50 fizzbuzzes.
#32, which plays a quite musical auralization of the algorithm ♬
#40, a chatbot that will listen to you and write you a poem ✍️
#48, a complete text adventure with sound effects and monsters to fight 👻🗡
#49, for the comments.
discussion:
Tell me if it works and what your favorite fizzbuzz is, and other favourite implementations. For example here's one about using a neural network that I find quite inspiring and hope to have the skills to do soon.
Also if you're a python person who can critique any parts where I could have done something more easily if I only knew about some method or another, let me know that too! I am still getting to know the basics of how python does things, which was the point of this exercise.
Here's a public post about the project on my website, which is a good place to share it from. But I wanted a private post here on Patreon where we can have comments and discussion.
intro text on "Make 50 of Something" and "Fizzbuzz":
One of the many things I learned from Evelyn Eastmond in my time working with her is this technique for deeply exploring, releasing yourself from preconceptions, thinking in new ways.
You make 50 of something. In one big marathon. (Maybe spaced over a few days, but it's important to exhaust your possibilities to break and illuminate habits, rather than making habits as with making a thing a week.)
50 is a LOT, and it takes you on this weird journey of ups and downs and complexifying and simplifying and combining and taking apart. It can be oddly emotional and intense.
This technique was meant for artists, but my research group has used it for VR stuff and programming language design too. So now to learn python, over the weekend I made 50 implementations of fizzbuzz.
Fizzbuzz is a classic simple programming exercise and common interview question based on a classic kids game, where you take turns counting, but if the number is divisible by 3 you say "fizz", and if it's divisible for 5 you say "buzz", and if it's divisible by both you say "fizzbuzz".
Enjoy!
Vi
P.S. If you talk to the poem-friend bot and it writes you a poem, share it here if you like! I'm curious to see.