Jump to content

Fizz buzz

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Citation bot (talk | contribs) at 12:43, 12 February 2023 (Alter: url. URLs might have been anonymized. | Use this bot. Report bugs. | Suggested by Superegz | Category:Mathematical games | #UCB_Category 15/64). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Fizz buzz is a group word game for children to teach them about division.[1] Players take turns to count incrementally, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz", and any number divisible by both 3 and 5 with the word "fizzbuzz".[2]

Play

Players generally sit in a circle. The player designated to go first says the number "1", and the players then count upwards in turn. However, any number divisible by three is replaced by the word fizz and any number divisible by five by the word buzz. Numbers divisible by both three and five (i.e. divisible by 15) become fizz buzz. A player who hesitates or makes a mistake is eliminated.

For example, a typical round of fizz buzz would start as follows:

1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ...

Other variations

In some versions of the game, other divisibility rules such as 7 can be used instead. Another rule that may be used to complicate the game is where numbers containing a digit also trigger the corresponding rule (for instance, 52 would use the same rule for a number divisible by 5).[3]

Programming

Fizz buzz (often spelled FizzBuzz in this context) has been used as an interview screening device for computer programmers.[4][5] Writing a program to output the first 100 FizzBuzz numbers is a relatively trivial problem requiring little more than a loop and conditional statements. However, its value in coding interviews is to analyze fundamental coding habits that may be indicative of overall coding ingenuity.[6]

References

  1. ^ Rees, Janet (2002). Fizz Buzz: 101 Spoken Numeracy Games – Ideal for Mental Maths. Learning Development Aids. ISBN 978-1855033528.
  2. ^ "tom scott fizzbuzz - Google Search". www.google.com. Retrieved 2023-01-30.
  3. ^ Hartley, Michael. "Fizz Buzz". Dr. Mike's Math Games for Kids. Retrieved 10 November 2020.
  4. ^ Imran Ghory (2007-01-24). "Using FizzBuzz to Find Developers who Grok Coding." Imran On Tech (blog).
  5. ^ Jeff Atwood (2007-02-26). "Why Can't Programmers.. Program?" Coding Horror (blog).
  6. ^ Joel Grus (2020-06-06). "Ten Essays on Fizz Buzz". Joel Grus (blog).