// A silly riddle game in C++, follow the instructions and see if the program is right! // Author: Brian Brindle #include //using std::cout; //using std::cin; //using std::endl; #include // for getch() #include // for getline() using namespace std; void main() { string temp; int i=0; bool repeat = true; while (repeat) { cout << "Think of a number from 1 to 10... (press enter) "; getline(cin, temp, '\n'); if (!("")) { cout << "\nNO, don't tell me, just think of it, in your head..... (press enter) "; getch(); } cout << "\nMultiply that number by 9... (press enter) "; getch(); cout << "\n\nAdd the two digits together [example: 25 is 2 + 5 = 7] ... (press enter) "; getch(); cout << "\n\nSubtract 5 from your number... (press enter) "; getch(); cout << "\n\nPick the letter that matches your number [example: A=1, B=2, C=3, etc.] ...\n" << "(press enter) "; getch(); cout << "\n\nPick a country in Europe that starts with that letter..."; cout << "\n\nSome examples: Britain, Ireland, France, Spain, Portugal, Italy, Denmark, \n" << "Holland, Germany, Austria, Sweden, Norway, Poland, Russian, etc." << endl << "(press enter) "; getch(); cout << "\n\nNow with the last letter of your country,\n" << "pick an animal that starts with that letter... (press enter) "; getch(); cout << "\n\nWith the last letter of the animal, pick a color that starts with that letter..." << "(press enter) "; getch(); cout << "\n\n\n I have a question for you... "<< endl << endl << " Have you ever seen 4 ORANGE KANGAROOS IN DENMARK?" << endl << endl << endl; cout << "Play again? Enter 1 for YES, 0 for NO... (then enter): "; cin >> i; if (i == 1) repeat = true; else repeat = false; cout << endl << endl << endl; } }