hangman implementation in c++