Problem 153

Hangman

Write a program to play a word-guessing game like Hangman.

-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.