/* animal.cpp author: date: Animal/20 questions program for CSCI 262, Spring 2018. */ #include #include #include #include using namespace std; class node { public: string data; node* left; node* right; }; int main() { node* root = read_game_tree(); if (root == NULL) return -1; while (true) { string tmp; int choice; cout << "Welcome to 20 questions!" << endl; cout << " 1) Play the game" << endl; cout << " 2) Save the game file" << endl; cout << " 3) Quit" << endl; cout << "Please make your selection: "; getline(cin, tmp); choice = atoi(tmp); switch (choice) { case 1: play_game(root); break; case 2: save_game_tree(root); break; case 3: break; default: cout << "Sorry, I don't understand." << endl << endl; } if (choice == 3) break; } delete_game_tree(root); return 0; }