8000 GitHub - alvaromr/fizzbuzz-kata: Simple TDD kata
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

alvaromr/fizzbuzz-kata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fizz Buzz Kata

Simple Test Driven Development Kata

Simple Rules

For a given number return:

  • “Fizz” if the number is divisible by 3
  • “Buzz” if the number is divisible by 5
  • “FizzBuzz” if the number is divisible by 3 and 5
  • The number if no other requirement is fulfilled

Requirements

  • Write a method, which, given a number, returns the correct word according to the rules
  • Solve the problem using TDD.

Challenges

  • Try to avoid using if-else chains.
  • Try the extended rules.
  • Try the super extended rules.

Extended Rules

For a given number return:

  • “Fizz” if the number is divisible by 3 or contains digit 3
  • “Buzz” if the number is divisible by 5 or contains digit 5
  • “FizzBuzz” if the number is divisible by 3 and 5, or contains digits 3 or 5
  • The number if no other requirement is fulfilled

Super Extended Rules

For a given number return:

  • “Fizz” if the number is divisible by 3 or contains digit 3
  • “Buzz” if the number is divisible by 5 or contains digit 5
  • “Wozz” if the number is divisible by 7 or contains digit 7
  • “FizzBuzz” if the number is divisible by 3 and 5, or contains digits 3 or 5
  • “FizzWozz” if the number is divisible by 3 and 7, or contains digits 3 or 7
  • “BuzzWozz” if the number is divisible by 5 and 7, or contains digits 5 or 7
  • “FizzBuzzWozz” if the number is divisible by 3, 5 and 7, or contains digits 3, 5 or 7
  • The number if no other requirement is fulfilled

About

Simple TDD kata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0