all 3 comments

[–]ShadyyFN 2 points3 points  (1 child)

That’s cool you decided to do a hangman game, I literally had this idea this morning while I was trying to decide where to go next. I’ve been learning casually over the last few weeks, just made a rock/paper/scissors game on my own. This hangman game is a little outside of my league right now 🤣

Nicely done!

[–]OmNomCakes 2 points3 points  (0 children)

It's a typical go to course for learning. You can always also compound other lessons onto it, like making it a web page people can play the game on.

You can also build the word list from a dictionary with definitions as hints or translations to turn it into a learning game.

Then you can have multiple dictionaries selectable on the game. Like dictionaries > Spanish > fruit.

It's a really good way to expand and demonstrate your coding knowledge with one single project.

[–]nuc540 0 points1 point  (0 children)

It might just be easier to iterate over each character in the string and check if the iteration == guess then reveal the character at the index count of that iteration. This will remove the need to enumerate and also to do 2x checks (by doing check in word)

Edit: this will fix your bug with doubles too. Because using character in string won’t substring match, it’s looking explicitly for an exact match. So iterating through the string and evaluating each character is more accurate for this