Fizz Buzz, Object-Oriented Edition: Exploring the Open/Closed Principle With Polymorphism and Metaprogramming

Fizz Buzz, the children s game turned coding interview question, requires little more than basic programming literacy to solve. But it has just enough complexity that it can also be used to illustrate some important tenets of object-oriented design through refactoring. The premise of the game is to count up from one, but replace the number with Fizz if it s divisible by three, Buzz if it s…