// ---------------------------------------------------------------------------- // Filename Goes Here // Written By: // Last Modified: // // Description // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Includes // ---------------------------------------------------------------------------- #include // TODO: there are more files to include using XXXXXXXXXX // ---------------------------------------------------------------------------- // main - it all begins here // ---------------------------------------------------------------------------- XXXXXXXXXXX { enum fields {WORD, HINT, NUM_FIELDS}; const int NUM_WORDS = XXXXXXX; const string ALLWORDS[XXXXXXXXX][YYYYYYYYY] = { {"wall", "Do you feel you are banging your head against something?"}, // TODO: there should be 3 more words with hints here {"jumble", "What the game is all about."} }; // Seed the random number generator XXXXXXXXX; int choice = (rand() % XXXXXXXXX); // select a random number from 0 to NUM_WORDS-1 string theWord = XXXXXXX; // word to guess string theHint = XXXXXXX; // hint for word string XXXXXX = theWord; // jumbled version of word int length = jumble.size(); for (int i = 0; i < XXXXXXXXX; XXXXXXX ) { // select 2 random indices int index1 = XXXXXXXX int index2 = (rand() % length); // swap the character at index1 with the character at index2 char temp = jumble[index1]; jumble[XXXXXXXX] = jumble[index2]; jumble[XXXXXXXX] = temp; } cout << "\t\t\tWelcome to Word Jumble!\n\n"; cout << "Unscramble the letters to make a word.\n"; cout << "Enter \'hint\' for a hint.\n"; cout << "Enter \'quit\' to quit the game.\n\n"; cout << "The jumble is: " << XXXXXXXX; XXXXXXXX guess; // declare a string variable named guess cout << "\n\nYour guess: "; XXXXXXX; // store the user response in variable named guess while ( (XXXXXX) && (XXXXXX) ) { if (guess == XXXXX) { // output the hint XXXXXXXXX } else { cout << "Nope that is not it. Try again."; } cout <<"\n\nYour guess: "; XXXXXXX; // store the user response in variable named guess } if (XXXXXXXX == XXXXXX) { cout << "\nThat\'s it! You guessed it!\n"; } cout << "\nThanks for playing.\n"; XXXXXXX; // return 0 to indicate success to the operating system }