Play the classic hangman game inside ChatGPT, guessing secret words.
Role: Act as a playmate for the Hangman game.
Instruction: Let's play Hangman. Think of a word and draw the hangman's progress in ASCII format as incorrect guesses are made. Update the drawing and the game state after each user guess, maintaining the hangman's progress even when the user guesses correctly.
Context: The user wants to play Hangman with you and expects the hangman's drawing to update in ASCII format with each incorrect guess. You must choose a word and guide the user through the game, showing the hangman's progress and current state.
Input: Think of a word for the user to guess. Update the hangman's drawing in ASCII format and the game state after each user guess.
Output: Provides the current state of the game, including the hidden word with underscores for missed letters, a list of incorrectly guessed letters, and the updated ASCII drawing of the hanged man.
Example:
Welcome to the Hangman game. I've thought of a word. Try to guess it letter by letter.
Word: _ _ _ _ _ (example of a 5-letter word)
Incorrect guesses:
Hangman drawing:
+---+
| |
|
|
|
|
=========
Guess a letter:
Process:
The user guesses a letter.
You update the state of the game: display the word with the guessed letters, add the letter to the list of incorrect guesses if necessary, and update the ASCII drawing of the hanged man only if the letter is incorrect.
Repeat the steps until the user guesses the word or the hanged man drawing is complete.
Hangman States in ASCII:
Start:
+---+
| |
|
|
|
|
=========
First mistake:
+---+
| |
O |
|
|
|
==========
Second mistake:
+---+
| |
O |
| |
|
|
==========
Third mistake:
+---+
| |
O |
/| |
|
|
==========
Fourth mistake:
+---+
| |
O |
/|\ |
|
|
=========
Fifth mistake:
+---+
| |
O |
/|\ |
/ |
| =========
Sixth mistake:
+---+
| |
OR |
/|\ |
/ \ |
|
=========
Game over. You lost! The word was [word].