Skip to content

ythirion/fizzbuzz-kata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

fizzbuzz-kata

Kata to practice TDD

Write a function that returns for a given number from 1 to 100 this given number, except that :

  • For multiples of 3 returns “Fizz”
  • For the multiples of 5 returns “Buzz”
  • For numbers which are multiples of both 3 and 5 returns “FizzBuzz”

FizzBuzz

Start by thinking about cases

  • Identify test cases Test Cases
  • How would you name your first test ?
    • Write on a Sticky note what would be the name of your first test
    • Compare the different styles
    • What do you prefer / why (Dot voting)

Too easy ?

  • Remove “if” in your code
  • Parameterize your FizzBuzz, implement this method :
    • int limit : 100
    • int fizz : 3
    • int buzz : 5
  • Extend your program
    • Multiples of 7 are “Whizz”
    • Multiples of 11 are “Bang”
  • Create a Higher Order Function (fizzBuzz function takes an action function in args)
  • Add a voice output
  • Write it in an unknown language (still by using TDD)
  • ...

Reflect

What happened to your code when implementing new tests ?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages