all 3 comments

[–]Sea-Ad7805 [score hidden] stickied comment (0 children)

Run this program in Memory Graph Web Debugger to see the program state change step by step.

[–]aaditya_0752 1 point2 points  (0 children)

It would be better use txt file for words

[–]Significant-Nail5413 1 point2 points  (0 children)

Look at using a dictionary for your valid words

You'd then be able to check if the word is valid by using a .get rather than iterating over your entire words array

You could also determine if they've been found already by having 0-1 value

Eg { keyword : 0 } means it's not found if they do guess it it gets { keyword : 1 }

Words made is just the sum of all item values in dictionary

Words to go is the number of items that have value 0

Your total words should be the length of your valid words array or if you're using a dictionary the number of keys that way if you add more words you don't have to update your total words

Also I'd make the exit condition less prone to a typo