This assignment is your capstone project for the semester. It gives you a chance to...
You will build a program that allows the user to play the game Mastermind against the computer. If you are unfamiliar with this game, read this gentle introduction to the game and its rules.
*** NEW *** You can download a demo version of Mastermind to play against. Use it to learn the rules. But you do not have to implement all the same functionality. It is only a demo of what is possible!
The assignment specifies a minimal set of requirements. If your program satisfies these requirements, it will allow the use to play the game in a simple way. As specified it may not be very flexible, but it will provide us with many opportunities for enhancement and extension!
Working in Pairs
For this assignment, you may work with a partner from the class. If you choose to work with someone, then both you and your prospective partner must send me e-mail saying so by 4:00 PM on Thursday, April 21. I have said this before, and this time I will enforce it in all cases: No exceptions.
Implement a program that allows a user to play Mastermind against the computer. Your program should allow all of the "variables" in the rules -- the number of items in the code sequence, the number of possibilities in the set of choices, the number of guesses allowed to the code breaker -- to be variables when creating an instance of the game.
For this assignment, you may assume that the computer player will act as the code maker and that the human player will act as the code breaker. However, as much as possible, you should design your program in a way that we could change the roles of the players with the fewest and most localized changes to your code.
(Ideally, I would like to be able to write a driver class that allows the human and computer players to alternate roles in a match of games.)
For this assignment, you may assume that the set of choices from which codes are built consists of colors. However, as much as possible, you should design your program in a way that we could change the "alphabet" of the code with the fewest and most localized changes to your code.
(Ideally, I would like to be able to create an instance of the game with any set of items that can display themselves to the screen and compare themselves to other members of the set for equality.)
Your program should provide at least the following features:
You must create a file named Mastermind.java that
I am willing to grant up to 4 points of extra credit for work done above and beyond the minimum specification outlined above. I am especially interested in work that generalizes the program and makes use of polymorphism to increase its flexibility.
In order to qualify for extra credit, you must propose your extension(s) to me by 4:00 PM on Tuesday, April 26. If I think that your proposal merits extra credit, I will approve it and tell you how many extra credit points I am willing to award for work that fulfills the proposal.
By the due date and time, submit the files:
readme.txt should be a text file that documents your design and that describes the files in your submission. This file should also describe how to use the program, both for the end user who plays the game and for a programmer who might want to modify the application class. Include in this file the same sort of header with which you document all files.
Be sure that your submission follows all
homework submission requirements.
In particular, be sure to staple your print-outs in the order listed above!