Share your repls and programming experiences

← Back to all posts
Hangman
FallenAngel6 (31)

So, I've been fiddling around with C++ for a few months and I decided to make a console-based game with it. It's the very generic game: Hangman.

It ain't much, but it's honest work. I spent a while making the ASCII art and code, so please enjoy.

Comments
hotnewtop
DynamicSquid (4897)

Cool! Just a tip though, on line 102:

// this,
if(int(chosen.find(guess)) >= 0 && used[int(guess) - 97] != true)

// can be changed to this:
if (chosen.find(guess) != string::npos && !used[guess - 'a'])