Hangman banner

Hangman

4 devlogs
4h 59m

A text-based Hangman game written in Python where the player tries to guess a hidden word letter by letter before running out of attempts. Run the program and a random word will be chosen — you'll be told how many letters it has. Enter one letter …

A text-based Hangman game written in Python where the player tries to guess a hidden word letter by letter before running out of attempts. Run the program and a random word will be chosen — you’ll be told how many letters it has. Enter one letter at a time, and if the letter is in the word its position will be revealed. After each guess you can choose to attempt the full word. You have 10 errors before the hangman is complete and you lose.

This project uses AI

I used Claude to guide me through any problem I had.

Demo Repository

Loading README...

evan.dcassidy

Shipped this project!

I made the classic hangman game that we all know. It keeps track of the incorrectly guessed letters, the amount of times you guess wrong (max. 10) and it updates the correctly guessed letters to the word. Example: _a_t
The hardest part was changing the underscores for letters and some bug that I couldn’t figure out what was the problem.
I’m very happy on how it turned out. :)

evan.dcassidy

I`ve now finished the project.
I added the picture of the hangman and each time that you guess the letter or word incorrectly, it prints a new part of the picture until it completes it and that´s when you lose.
Now it says what letters you already guessed (correct and incorrect ones) using the .append() command which I learned. I also fixed two bugs and that would be my finished project.

Attachment
Attachment
0
evan.dcassidy

I figured out a way of updating the underscores after each correct guess by using:
correct_letters[i] = char
It took me an excesively long time to make the game end when the error count reached 0 but in the end I was able to make it.
I also fixed a few bugs and that´s it!!

Attachment
Attachment
0
evan.dcassidy

I added underscores for each letter of the word but now I have to figure out how to update them so each time you guess a letter instead of all underscores, there is underscores and the letter you guessed. I also made an error counter which will lead to the actual hangman “picture” that we all know.
I learned the .join() command and the .index() command.

Attachment
0
evan.dcassidy

I started my project by making a list of 50 words. Then I choose a random word from that list and ask for a letter. Then, I say if you guessed correctly and in which position the letter is in or if there isn’t a letter in the word at all.
I learned a few new commands: len(), random.choice(), .index() and .isalpha()

Attachment
0