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

  1. The program asks the user for his/her name.
  2. The program asks the user how many pegs should be guessed. Legal values are 1 - 8. Be able to handle erroneous integer inputs.
  3. The program asks the user how many colors should be used. Legal values are 1 - 6. Be able to handle erroneous integer inputs.
  4. The program asks the user for his/her next guess.
  5. The program clears the terminal window.
  6. The program displays the complete history of the current game. This should include all guesses (and results) made in the current game.
  7. If the game is not over, go to step 4.
  8. The program displays a message stating whether the user has won or lost the current game.
  9. The program displays a message displaying the total number of wins and losses for the user.
  10. The program asks the user if he/she would like to play again.
  11. If the answer is yes, go to step 4.

Grading

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.