Hangman

In this project, you must implement a computer version of the game hangman. Your
program should randomly load each word from a text file which contains an integer,representing the number of words in the file, followed by each word, one per line. An example of such a file is the following:


4
kitchen
telephone
sledgehammer
feline


The program should choose a word at random from the file and display that word
to the player with each letter replaced by a hyphen. The player should then be
allowed to guess a letter. If the letter has already been guessed, the program should alert the user to guess again without penalty. If the letter exists in the word, the program should reveal those letters in the hidden word. If the letter does not exist in the word, the program should increment the number of missed guesses by one. If all of the letters are revealed, the player wins. If the number of missed guesses becomes greater than 5, the player loses. The game should continue until one of those outcomes is reached.

My code will follow soon...
Ok, I have a problem already with this program. My partner and I have decided that it would be best to use an array to store the words in so that we can access the words at random. We have to get them from the text file that I mentioned above ^^. How? We have tried a billion different ways, but we never can get them in the array... Any help would be appreciated. Thanks.
Have you successfully opened the file and read anything? At what point do you get the problem?
We have the file opened, but it won't store the information the way we want it to. When I get a chance, I will post what I have. It's pretty pitiful, but we just can't figure it out. It will be up today.
Topic archived. No new replies allowed.