From UBC Wiki


Authors: Jordan Schalm, David Julien, Seerat Sekhon

What is the problem?

State the general problem. If applicable, tell us what information you will use, e.g., a link to some web site that provides the information you used. What will you do? The problem we aim to solve is implementing the "code-maker" player to a game of Mastermind. The program will respond to guesses made by the player based on the code.

What is the something extra?

What is the in-depth aspect you will do? If the problem is related to some other group's project, tell us how they fit together. If in doubt, include the information. The in-depth aspect to our project will be allowing the game to have multiple gameplay settings. One of the settings is allowing the player to choose whether the generated code will allow duplicate pegs of the same colour. Another setting will allow the player to choose how many guessing turns they are allowed before they lose.

What did we learn from doing this?

(This should be written after you have done the work.) What is the bottom-line? Is logic programming suitable for (part-of) the task? Make sure you include the evidence for your claims. After implementing the Mastermind bot using Prolog, we have decided that logic programming is a suitable tool for this task. The Bot responds to guesses by generating a hint based on how close the guess is to the actual code. We initially had concerns about Prolog's viability for a few components of this project: generating random codes and receiving and responding to user input between rounds. We were able to apply Prolog and logic programming to these problems using the random function to generate codes at the beginning of a game, and the read/write methods to "pause" the game to display hints and accept a new code. Therefore our conclusion is that Prolog is suitable for this task.