#include using namespace std; int main() { char userInput; bool userWins {false}, moved {true}; string direction, critter; cout << endl << endl; cout << "You are in a field, surrounded by interesting places" << endl; cout << "Select a direction to travel => "; cin >> userInput; cout << endl; switch(userInput) { case 'a': case 'E': case 'h': direction = "east"; critter = "lion"; break; case 'w': case 'N': case 'k': direction = "north"; critter = "polar bear"; break; case 's': case 'S': case 'j': direction = "south"; critter = "alligator"; break; case 'd': case 'W': case 'l': direction = "west"; critter = "partner of your choice"; userWins = true; break; default: cout << "You selected a non direction." << endl; cout << "You wait in the field until you starve." << endl; moved = false; break; } if (moved) { cout << "You selected to travel " << direction << "." << endl; cout << "You encounter "; if ("alligator" == critter) { cout << "an "; } else { cout << "a "; } cout << critter; if (userWins) { cout << " who lives with you happly ever after!" << endl; } else { cout << " who eats you!" << endl; } } cout << "Game over, you " ; if (userWins) { cout << "win!" << endl; } else { cout << "lose!" << endl; } cout << endl << endl; return 0; }