Skip to content

khantzen/FizzBuzzFactory-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FizzBuzz Factory

This is an avanced FizzBuzz exercice, complete each iteration without looking to the next one

We consider an iteration completed when its specifications are implement and working, and the precedent iteration are still working.

PS: I am writting this readme after finishing the code, so it is not impossible that the iteration are not perfectly matching my code

Iteration 1

Write a fizzBuzzIter1 method that take an integer as an input and return:

  • If the input is divisible by 3, return Fizz
  • If the input is divisible by 5, return Buzz
  • If the input is divisible by 3 and 5, return FizzBuzz
  • Else return the input

Iteration 2

Write a fizzBuzzIter2 method that take an integer as an input and return:

  • If the input is divisible by 7, return Fizz
  • If the input is divisible by 11, return Buzz
  • If the input is divisible bt 7 and 11, return FizzBuzz
  • Else return the input

Retro

  • What do you think about your code ?
  • What does your code is thinking about you ?
  • Is there any duplication ?
  • Can you refactor your code, so there is no duplication ?
  • What made you sure you didn't broke anything during your refactor ?

Iteration 3

Write a fizzBuzzIter3 method that take an integer as input

  • If the input is divisible by 13, return Fizz
  • If the input is divisible by 17, return Buzz
  • If the input is divisible by 19, return Fuzz
  • If the input is divisible by 23, return Bizz
  • If more than one rule match, return the result concatenation in the order of apparition
  • Else return the input

Retro

  • What do you think about your code ?
  • What does your code is thinking about you ?
  • Can you refactor your code, so every FizzBuzz methods works in a similarity way ?

Iteration 4

Write a superFizzBuzz method that take an integer as input

  • If the input is not divisible by 3, return Fizz
  • If the input is odd, return Buzz
  • If the input is a perfect square, return Fuzz
  • If more than one rule match, return the result concatenation in the order of apparition
  • Else return the input

Retro

  • What do you think about your code ?
  • What does your code is thinking about you ?
  • Can you refactor your code, so every FizzBuzz methods works in a similarity way ?

To go further

  • If more than one rule match maybe you want a way to define the concatenation order

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages