I've always done hangman with 5 guesses: [ head, left arm, right arm, left leg, right leg ]. Feels more fair that way. Also, you have a grammatical error in the code with "You guess was wrong", where it should be "Your guess was wrong". A technique you might like for printing out the diagram, would be to use a marker code like a whitespace character for each piece to be changed and have two copies of the diagram, one with the whitespace marker, the other with the completed diagram, search for the next marker and for each wrong guess replace it with the same index character of the swap diagram. For bonus points use ncurses to place it at a set location in the terminal window and not wait for an enter key upon each guess being entered.
Oh cool, we always used to do it with all the sticks included in the structure to hang the guy. Decided not to draw the ASCII art if the person hanging because then people could change the amount of lives.
Continue making these, really helped a beginner coder like me :)
Thank you, that is awesome to hear!
Oh! Subtle background music. Nice! It's got almost a "Minecraft" vibe to it!
I've always done hangman with 5 guesses: [ head, left arm, right arm, left leg, right leg ]. Feels more fair that way. Also, you have a grammatical error in the code with "You guess was wrong", where it should be "Your guess was wrong". A technique you might like for printing out the diagram, would be to use a marker code like a whitespace character for each piece to be changed and have two copies of the diagram, one with the whitespace marker, the other with the completed diagram, search for the next marker and for each wrong guess replace it with the same index character of the swap diagram. For bonus points use ncurses to place it at a set location in the terminal window and not wait for an enter key upon each guess being entered.
Oh cool, we always used to do it with all the sticks included in the structure to hang the guy. Decided not to draw the ASCII art if the person hanging because then people could change the amount of lives.
When you check if the user typed a letter you should use the build-in function str.isalpha()