CS312 - 2019 Mastermind

From UBC Wiki

Mastermind

Authors: Deina Kellezi, Erik Gylling

What is the problem?

We would like to implement Mastermind in prolog, where the player is playing against the computer.

Mastermind is a code game, where player1 creates a code based of 4 colors.

The position in the code matters, so code(red, green, blue, yellow) is not the same as code(green, red, blue, yellow).

Player2 will get marks based on the guess. If he has a color right he will get a red mark, if he has the color and position right he will get a green mark.

The goal for player2 is to solve the code in 20 tries, if he doesn´t succeed then player1 wins.

Player1 will be the computer in our implementation.

What is the something extra?

The user can choose a difficulty in the begining, and then the number of tries will be based on that.

What did we learn from doing this?

We learned how the compiler works, and that the compiler will execute everything in a clause until it´s proven wrong.

Github link:

https://github.com/Gylling/Mastermind