Simple python题目:Hangman Game–“guess the word”
当前位置:以往案例 > >Simple python题目:Hangman Game–“guess the word”
2017-12-22

CSC Python Project

Hangman Game–“guess the word” game

In this project, I plan to code the classic hangman game, where the computer selects a word randomly from a list, and the player guesses letters.  The user needs to be able to input letter guesses. Also, a limit will be set on how many guesses the user can use and the number of guesses left will be displayed.

Correct guesses will be indicated positionally.

For instance, for the secret word "telephone", if the player has correctly guessed nothing, display underscores for all 9 letters:
_ _ _ _ _ _ _ _ _
Later if the user has correctly selected e, the program will display:
_ e _ e _ _ _ _ _
and then if n is selected,
_ e _ e _ _ _ n _

Therefore, the program needs functions to check if the user has actually inputted a single letter, to check if the inputted letter is in the hidden word (and if it is, how many times it appears), to print letters, and a counter variable to limit guesses.


I am considering following possible elaborations after I get a basic text version working:

· display wrong past letter choices or remaining choices

· multiple games with score kept

· choice of easier and harder versions with words of different difficulty levels (number of guesses allowed will be different for different difficulty levels)

· text graphics or regular graphics just for a hangman image

· (lots of extra credit) a totally graphics based version, where the alphabet is shown in little boxes on the graphics screen and the user just clicks on the next letter chosen…..

· (Also lots of extra credit) fancier version on the web, possibly with Hangman images. The web version could involve typing a letter choice or clicking a radio button for the right letter….


If you want to take this project a step further, set up a hangman image that changes!


在线提交订单