Problem 153
Hangman
Write a program to play a word-guessing game like Hangman.
- It must randomly choose a word from a list of words.
- It must stop when all the letters are guessed.
- It must give them limited tries and stop after they run out.
- It must display letters they have already guessed (either only the incorrect guesses or all guesses).
-=-=-=-=-=-=-=-=-=-=-=-=-=- Word: _ _ _ _ _ _ _ Misses: Guess: a -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: _ a _ _ _ a _ Misses: Guess: n -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: _ a n _ _ a n Misses: Guess: y -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: _ a n _ _ a n Misses: y Guess: r -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: _ a n _ _ a n Misses: y r Guess: h -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: h a n _ _ a n Misses: y r Guess: g -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: h a n g _ a n Misses: y r Guess: m -=-=-=-=-=-=-=-=-=-=-=-=-=- Word: h a n g m a n Misses: y r YOU GOT IT! Play "again" or "quit"? quit
◄ 152: Tic-Tac-Toe 163.1: Web Addresses ►
Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.