Send to Printer


FizzBuzz with Non-Smalltalkers

July 19, 2011 20:36:32.000

Randal Schwartz got some oohs and ahs recently at the Rio de Janeiro Dojo:

To rehearse, I had done the exercise earlier in the day, so I had a sense of where the code was going, although the actual solution from the group effort was a bit different. We finished in about 45 minutes, and with the remaining time, we tackled the second stage (decimal values containing a 3 digit, not just numbers that are multiples of 3). After completing that, I showed that we could put the logic for #isFizz and #isBuzz over in the Integer class, which was pretty amazing unless you've seen it before, and even got the protocol category right so that the MCZ package contained the monkeypatches. Finally, I loaded the MCZ into a new image, and ran the tests. All green. It was a fun experience, and they later told me that they'd never even started the second stage question before with other languages, let alone getting it to a place where a file could easily be handed around with the solution (including tests).

He also visited the LA Smalltalk User's group - follow the link for that report.

Technorati Tags:

posted by James Robertson


Re: FizzBuzz with Non-Smalltalkers

[anonymous] July 20, 2011 6:47:40.925

Wow, the arguments on that thread over the best way to swap 2 variables. Is it my age, or am I not sufficiently in love with my own cleverness to debate such trivial things?

 Share Tweet This