Program 1
Mastermind
due Thursday, February 3rd, 2005 by the start of lab
Lab Partners
Everyone is encouraged to work with one lab partner on this assignment.
If you do work with a partner, submit one solution with both of your
names on it. Also, please look at the
class
collaboration policy so that you know what is and what isn't
allowed.
General Overview
Develop a text-based Mastermind application using the code that
we developed in lecture and in lab from January 19 - January 21
as a starting point. To win a game, a user must find the correct
solution in 10 or fewer tries.
Requirements
- The program asks the user for his/her name.
- The program asks the user how many pegs should be guessed. Legal
values are 1 - 8. Be able to handle erroneous integer inputs.
- The program asks the user how many colors should be used.
Legal values are 1 - 6. Be able to handle erroneous integer inputs.
- The program asks the user for his/her next guess.
- The program clears
the terminal window.
- The program displays the complete history of the current game.
This should include all guesses (and results) made in
the current game.
- If the game is not over, go to step 4.
- The program displays a message stating whether the user has won or lost
the current game.
- The program displays a message displaying the total number of wins
and losses for the user.
- The program asks the user if he/she would like to play again.
- If the answer is yes, go to step 4.
Grading
- 50%. Correctness.
- 10%. Clear, well-formatted, readable output.
- 10%. Appropriate Javadoc comments, precondition and postcondition
comments, and regular comments.
- 30%. An elegant solution. This includes factors such
as good object-oriented design, high quality code,
meaningful variable names, etc.
What to Submit
E-mail your code to Mike Thiesen at
mthiesen@gmail.com in one message. The subject of the message
should be: CS221-xx program1 your-names.
The xx is the number of your lab section.
Mike must receive your e-mail by the start of your lab period
on the date on which the assignment is due. Otherwise there
will be a 25 point per day late penalty.