The word part borrowed from the past written, and re-wrote a command line under the hangman.
Https://github.com/shalliestera/hangman
//guess word game #ifndef hangman_h_#define hangman_h_#include <string>class Hangman {private:static const int NUM = 26; Const char* Wordlist[num] = {"Apiary", "Beetle", "cereal", "Danger", "Ensign", "florid", "garage", "health", "insult", "Jac Kal "," Keeper "," loaner "," Manage "," nonce "," onset "," plaid "," quilt "," remote "," stolid "," Train "," useful "," valid "," WH ence "," Xenon "," yearn "," Zippy "};std::string m_word;//Save randomly selected words std::string m_show;//Save the letters of the guessed pair while being prompted std::string m_ wrong;//Save the wrong-guessing letter int m_chances;//Private Methods # unlisted internal method void init (int chances = 6);//Initialize void check (char ch);//Check the letter pair to void Youwin (); void Gameover (); Const std::string& Rightword () const {return m_word;} Const std::string& youguess () const {return m_show;} Public:explicit Hangman (int chances = 6); ctors// guessed returns true, error false void guess (); void Tips () const;}; #endif//Hangman_h_
Command line Hangman