https://github.com/bast/fizz-buzz
Superseded by https://github.com/bast/calculator.
https://github.com/bast/fizz-buzz
Last synced: 3 months ago
JSON representation
Superseded by https://github.com/bast/calculator.
- Host: GitHub
- URL: https://github.com/bast/fizz-buzz
- Owner: bast
- License: other
- Created: 2016-12-11T12:56:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T09:15:04.000Z (about 9 years ago)
- Last Synced: 2025-10-20T12:33:12.391Z (7 months ago)
- Language: FORTRAN
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](../master/LICENSE.md)
# fizz-buzz
Exercise to practice building projects with [CMake](https://cmake.org).
## Background
Inspired by a [Project Euler exercise](https://projecteuler.net/problem=1) and
based on the [popular game](https://en.wikipedia.org/wiki/Fizz_buzz) and
popular programming job interview question where you have to say/print "Fizz" if a
natural number is divisible by 3 and "Buzz" if it is divisible by 5:
```
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
Fizz Buzz
...
```
We wish to build a code which computes the "Fizz-buzz sum" for a given natural
number N, summing all natural numbers <= N which are multiples of 3 or 5. For
N=10 the sum is 3+5+6+9+10 = 33.
The source code and unit tests are there:
```shell
.
|-- LICENSE.md
|-- README.md
|-- src
| |-- divisible.f90
| |-- fizz_buzz.f90
| |-- fizz_buzz.h
| `-- main.cpp
`-- test
|-- fizz_buzz.cpp
`-- main.cpp
```
## Tasks
- Build a shared library.
- Build and link the main program.
- Build the unit tests and link against [Google Test](https://github.com/google/googletest).
- Define a version number inside CMake and print it to the output of the executable.
- Print the Git hash to the output of the executable.
- Create an installer so the program can be installed properly (GNU standards).
- Create a DEB or RPM package (if relevant for your distribution).