
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
Fizzinstead of the number. - For multiples of five it returns
Buzzinstead of the number. - For numbers which are multiples of both three and five it returns
FizzBuzzinstead of the number.
Example
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzzCredits
- Image © Ezra Hill