Well, you know the old adage: “Good artists copy, great artists steal”
Well, you know the old adage: “Good artists copy, great artists steal”
Luckily I have 6 years of Electronics manufacturing experience, so the math and theory are the things I’ll need to learn most of. Unfortunately, those things are the hardest part…
Me, whose going to start studying EE: 😭
Probably. I’m too autistic to recognize when those prompts happen, so I usually play all my board games in silence.
Having the output of each thing you tried would help us get a feel for where your code was messing up without us having to run it ourselves to get the output.
That said, for code snippet 1, you’re inserting the letter instead of replacing the underscore with the letter. Not only that, but your for-loop essentially does the following:
chosen_word
guess
is in the above loop
display
array and add guess
that many times (effectively doubling the `display array)Your second code snippet does the same thing, but with actual formatting so that Python could run the code.
I believe your third code snippet introduces char
but then returns to letter
. It might work if you replaced char
with letter
again. Also += letter
will add the letter to the end of display
, which is not what you want to do.
I did my own version of Hangman in Python a couple years ago if you want to look at the code and see what I did. I’m just a hobbyist, so it’s not fantastic, but it might give you an idea of how someone else has approached the problem.
Surprisingly enough, guys who have hair like this have a 100% chance of stealing your girl.
Ironically enough, this is also the code that is perplexing Elon Musk over at X Twitter
This might be controversial, but the new Denis Villeneuve movies are much better than the book. Maybe watch the movies and read the book or trawl the wiki after for more context.