Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dmerejkowsky committed Aug 29, 2022
1 parent 6d78714 commit a169a76
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions java/src/main/java/fr/arolla/FizzBuzz.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,10 @@


public class FizzBuzz {
/**
* Implements the fizzbuzz game
*
* @param number the number
* @return the output
* if number is divisible by 3:
* return "fizz"
* if number is divisible by 5:
* return "buzz"
* if number is divisible by 15:
* return "fizzbuzz"
* else
* return the number a string
*/
public static String fizzBuzz(int number) {
boolean divisibleBy3 = number % 3 == 0;
boolean divisibleBy5 = number % 5 == 0;

// Note: keep this test first
if (divisibleBy3 && divisibleBy5) {
return "fizzbuzz";
}
Expand Down

0 comments on commit a169a76

Please sign in to comment.