28 Jan 2008 chalst   » (Master)

FizzBuzz
Zaitcev wrote: English kids who play this game in kindergarten are freaking geniuses. The only sensible plan seems to be to keep two counters, which is actually quite challenging.

It seems tome that a better strategy would be to count in groups of 15 at a time, and memorise where the Fizzes, Buzzes and FizzBuzzes occur. It's feasible to make a rhythm out of it, to keep track of where you are. I think I could teach my 4 year-old to count to such a rhythm, though her grasp of number greater than 12 is a bit shaky at present (she starts making up the sequence, repetitions and all, when she gets unsure), so maybe her rendition wouldn't be so impressive.

If I were to try to code this in 2mins, I'd probably choose perl, and choose from an array of 15 format strings. Maybe I try that, see how long it takes.

The rather harder version of the puzzle if that you call "Fizz" if either the number is divisble by, or whose decimal expansion contains, 3, likewise for Buzz, FizzBuzz.

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!