FizzBuzz Algorithm (Swift)

February 6, 2019

Yo yo guys, this is my first post about Swift programming language. This time I am going to explain how to use FizzBuzz algorithm.

First of all what is FizzBuzz?

Fizz buzz is a group word game for children to teach them about division. 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”.

How to play FizzBuzz and rules for the same game?

Players generally sit in a circle. The player designated to go first says the number “1”, and each player thenceforth counts one number in turn. However, any number divisible by three is replaced by the word fizz and any divisible by five by the word buzz. Numbers divisible by both become fizz buzz. A player who hesitates or makes a mistake is eliminated from the game. For example, a typical round of fizz buzz would start as follows: