Return to Blog entry
{
Good old javascript.
also:
fizzbuzz_style_game = function (rules) {
return function (n) { var result = for (var divisor in rules) result += n%divisor?:rulesdivisor return result || n}
}
my_buzz = fizzbuzz_style_game({
3:'fizz', 5:'buzz', 7:'is', 11:'a', 13:'simple', 17:'yet', 19:'interesting', 23:'game'
})
Good software can be changed easily. Parameterisation is the most powerful way to do this.
}