CPS 06, Spring 2000, Extra Credit Assignment, Jotto

Due Wednesday, April 26 at Midnight

The word game Jotto is similar to mastermind, but played with five-letter words instead of colored pegs. Two players each pick a secret word that is not revealed. Players than take turns guessing five letter words. For each guessed word the opponent tells how many letters are in common with the secret word. For example, if player A picks "flops" as the secret word, and player B guesses "spore", then Player A responds that "spore" has 3 letters in common with his secret word. The player who determines the opponent's secret word with the fewest guesses wins.

You are to implement a program so that the computer can play Jotto against a human. Your program should have the option of letting you enter its "secret" word. Otherwise it should read in a file of words named words.txt that you provide and choose one of these words at random. As part of the deliverables, you should submit a test file containing approximately 30 words. However, you program should work with any file of words, one word per line, so you do not know in advance how many words to expect.

You have a lot of freedom in how you write this, but you should show use good programming practice. Your program should have a reasonably friendly user interface. You must work alone.

Submitting

To submit use
  submit_cps006 assignx jotto.cpp words.txt README

Grading and Credit

Your grade will be based on performance, user interface, and style (good programming practice). This program can add up to 2.0 points to your final average. Thus it can aid you in any category since your extra credit is applied after all of your other grades are merged together into a single grade.