Command line Hangman

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.