https://github.com/pauloportugal/real-fizzbuzz-java
The Real FizzBuzz in Java
https://github.com/pauloportugal/real-fizzbuzz-java
fizzbuzz java java-8 junit
Last synced: over 1 year ago
JSON representation
The Real FizzBuzz in Java
- Host: GitHub
- URL: https://github.com/pauloportugal/real-fizzbuzz-java
- Owner: PauloPortugal
- Created: 2017-05-20T20:58:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-06-14T22:33:57.000Z (about 3 years ago)
- Last Synced: 2025-02-01T18:43:41.735Z (over 1 year ago)
- Topics: fizzbuzz, java, java-8, junit
- Language: Java
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/PauloPortugal/real-fizzbuzz-java.svg?branch=master)
# The Real FizzBuzz in Java
Prints out the following for a contiguous range of numbers:
* the number
* `fizz` for numbers that are multiples of `3`
* `buzz` for numbers that are multiples of `5`
* `fizzbuzz` for numbers that are multiples of `15`
* if the number contains a `three` output the text `lucky`, overriding any existing behaviour
* report at the end of the program showing how many times each `word` was substituted
There is also a [Clojure version](https://github.com/PauloPortugal/real-fizzbuzz-clojure) and a [Go version](https://github.com/PauloPortugal/real-fizzbuzz-go).
## Example
Running the program over a range from 1-20 one should get the following output:
```
1 2 lucky 4 buzz fizz 7 8 fizz buzz 11 fizz lucky 14 fizzbuzz 16 17 fizz 19 buzz
fizz: 4
buzz: 3
fizzbuzz: 1
lucky: 2
integer: 10
```
## Run
```
mvn clean test exec:java
```