Implementation of the Mastermind game in ANSI-C.
This work was done during 5th and last laboratory of the course of Fundamentals of Informatics at Polytechnic of Milan.
Made by federicovilla55, marcodotsh and Tresza24.
There are two players: the codebreaker and the codemaster. The codemaster creates a secret four-digit sequence of coloured pegs. To win, the codebreaker must guess the secret sequence of pegs within a set number of attempts.
After each attempt of the codebreaker, the codemaster should tell:
- how many pegs he guess correctly (these are the black pegs),
- how many pegs have the correct color but the wrong position (these are the white pegs).
Run make
, then run make clean
if you want to delete object files.
Run ./mastermind.out
.
Enjoy.