This is the classic MasterMind game in modern Fortran 2008. Some of the other Mastermind Fortran games out there have subtly incorrect game logic, but this one is believed correct.
Simply type
mastermind
You can play with more than 4 letters by specifying at the command line. Say you want 8 letters:
mastermind 8
B
: the correct color is in the right position
W
: the color is used, but this guess is in the wrong position
0
: this color is not used in the solution anywhere not already B
Pick one of the following methods.
cmake -B build
cmake --build build
# optional
cmake --install build
OR
meson build
meson install -C build
brew tap scivision/tap
brew install mastermind