uh, the word is supposed to be chosen when the game starts, not ends
(which explains why I lose every time, and there's no code for winning. so this is not even hangman)
It's like hangman, but the computer cheats. You could do the same in a real game.
I could make a more fair hangman game
I have a hangman game in my Kevin MacLeod Music Repository project. There's also a Web Dev and OOP option.
It's supposed to be like that. I wanted to make an unfair game of hangman.
The original UC Berkeley version of BJC has a lab assignment to write Hangman and then the next one to write "Evil Hangman" which does this.
When we brought BJC to New York high schools, one of the first things they told us was that Black students have unpleasant associations with that game and so we shouldn't use it. This was before the recent huge explosion of white people's interest in Black people's experience, so the fact that we had to be told wasn't as damning as it would be today, but of course once it was pointed out to us it was obviously a concern.
Not that nobody's ever allowed to play (or program) Hangman again! I'm just explaining why it's not in our curriculum any more. A curriculum that might be used anywhere has to bend over backward, more than individual people do.