HOME

TheInfoList



OR:

Fizz buzz is a group word game for children to teach them about
division Division or divider may refer to: Mathematics *Division (mathematics), the inverse of multiplication *Division algorithm, a method for computing the result of mathematical division Military *Division (military), a formation typically consisting ...
. 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".


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 In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
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:


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).


Programming

Fizz buzz (often spelled FizzBuzz in this context) has been used as an interview screening device for
computer programmers A computer programmer, sometimes referred to as a software developer, a software engineer, a programmer or a coder, is a person who creates computer programs — often for larger computer software. A programmer is someone who writes/creates ...
. Writing a
program Program, programme, programmer, or programming may refer to: Business and management * Program management, the process of managing several related projects * Time management * Program, a part of planning Arts and entertainment Audio * Progra ...
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.Joel Grus (2020-06-06)
"Ten Essays on Fizz Buzz"
''Joel Grus'' (blog).


References


External links




Rosetta Code: Fizz Buzz at Rosetta Code

Fizz Buzz
JavaScript interview code
Euler's FizzBuzz
an unorthodox programmatic solution making use of Euler's theorem
Enterprise FizzBuzz
Comical 'enterprise' implementation of FizzBuzz with intentional verbosity Car games Children's games Drinking games Mathematical games Division (mathematics)