Tuesday 5 August 2014

Classic Programming Problem: FizzBuzz

Designing a program to model the FizzBuzz word game is often used to test a person's programming knowledge. Here are the game's basic rules:

  1. Start at the number 1
  2. Count upwards by 1 each turn
  3. If the number that turn is a multiple of 3 then replace the number with the word Fizz
  4. If the number that is a multiple of 5 then replace the number with the word Buzz
  5. Finally, if the number is a multiple of both 3 and 5 then replace the number with the combination of the two words: FizzBuzz