Advertisement
KillianMills

hangman.h

Oct 1st, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.31 KB | None | 0 0
  1. #include <string>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. class hangman
  7. {
  8. public:
  9.     //constructor
  10.     hangman(bool);
  11.  
  12.     //methods
  13.    
  14.     void inputGuesses(); // asks the user to input amount of guesses allowed
  15.     void inputWordSize(); // asked the user to input the word size they want
  16.     void dashX(); // makes a string of dashes of the same length the user inputted
  17.     void readFile(); // read the dictionary file
  18.     void difficulty(); // based on the word size it sorts the dictionary into a smaller vector
  19.     string random(); // randomly selects a word from the now smaller vector
  20.     void mainGame(); // prompts the user to input char guesses until they get the word or run out of guesses
  21.  
  22.     void ending();      //print statement declaring win or loss at the end
  23.  
  24.  
  25.     //instance variables
  26.     int guesses; //how many guesses the user has left
  27.     int wordSize; //the size of the word they are guessing
  28.     char userGuess; // the char input for each letter guessed
  29.     string currentWord; //the string to be checked against, will change as needed
  30.     string dashWord; // a string of length wordSize filling as - initially
  31.     string usedLetters; // a string which keeps track of all user char inputs
  32.  
  33.     vector<string> vecsVector; // holds the entire dictionary file
  34.     vector<string> sliceVector; // holds the reduced dictionary file
  35.    
  36.     bool debug;
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement