Ghislain_Mike

Scrabble Game

Feb 15th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     // variable declaration
  8.     string WORD;
  9.     string QUESTION[2] = {"car", "r, c, a"};
  10.  
  11.     // ofstream MY_FILE;
  12.     // MY_FILE.open("ScrabbleGame.txt");
  13.  
  14.     cout << "Hello and welcome to \"Scrabble Game!\" (enter 'exit' to close).\n";
  15.  
  16.     do {
  17.         cout << "Form a sentence using the following characters: " << QUESTION[1] << "\n\t";
  18.         cin >> WORD;
  19.         if (QUESTION[0] == WORD) cout << "\tyou are correct!\n" ;
  20.         else cout << "\tOops!, try again!\n";
  21.  
  22.         // reset QUESTION to something else
  23.  
  24.     } while(WORD != "exit");
  25.  
  26.     // MY_FILE.close();
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment