NICOLÁS BOTTARINI
Fizz-Buzz

Fizz-Buzz

A simple game to start your TDD journey.

Level:Novice
Duration:Short
Topics:
TDD

Instructions

  • Write a function that for each given number returns a number.
  • For multiples of three it returns Fizz instead of the number.
  • For multiples of five it returns Buzz instead of the number.
  • For numbers which are multiples of both three and five it returns FizzBuzz instead of the number.

Example

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz

Credits

  • Image © Ezra Hill