Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

CS 2420 Fall 2011 Program 1 20 points See webpage for due date.

Summary: CS 2420 Fall 2011
Program 1 20 points See webpage for due date.

Cheating Hangman

In case you are not familiar with the game Hangman, the rules are as follows:
1. The computer chooses a secret word, and then writes out a number of dashes equal to the word
2. The player begins guessing letters. Whenever he guesses a letter contained in the hidden word, the
computer reveals each instance of that letter in the word. Otherwise, the guess is wrong.
3. The game ends either when all the letters in the word have been revealed or when the guesser has
run out of guesses.
A version of this game has been provided as starter code. The code uses doubly linked lists so that (1)
you are exposed to them (2) pointers are reviewed. Avoid using google to find a more complete
version. You need to be able to code without copying.
Your assignment is to create a version of the game in which the computer cheats.
The trick is this: the computer does not pick a word until it absolutely has to. The game begins
with the computer selecting a word length, but not a word.
When you guess a letter (let's say you guess the letter 'N'), the computer consults its word list to


Source: Allan, Vicki H. - Department of Computer Science, Utah State University


Collections: Computer Technologies and Information Sciences