1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int option = 0; //to be checked against for inital menu
  8. string dir = ""; //for the movement loop
  9. cout<<"Welcome to Townsville, USA!\n";
  10. cout<<"Enter 1 for a new game, 2 to load a saved game, or 3 to quit.\n>";
  11. //this is the logic for allowing the user to choose new/load/quit
  12. do {
  13. cin>>option;
  14. //1 = new game, so starts loop to get user input for movement
  15. if (option==1) {
  16. cout<<"You are in the middle of the city\n";
  17. cout<<"Train by bullying children, robbing banks, and doing other dasterdly deads\n";
  18. cout<<"to prepare for your ultimate showdown with the Powerpuff Girls.\n";
  19. cout<<"What do you want to do? \(Type help for a list of commands).\n>";
  20. //movement loop
  21. do{
  22. cin>>dir;
  23. if(dir=="north" || dir=="n"){
  24. cout<<"You go north. All you can see are skyscrapers.\n>";
  25. }
  26. else if (dir=="south" || dir=="s") {
  27. cout<<"You go north. All you can see are skyscrapers.\n>";
  28. }
  29. else if (dir=="east" || dir=="e") {
  30. cout<<"You go east. All you can see are skyscrapers.\n>";
  31. }
  32. else if (dir=="west" || dir=="w") {
  33. cout<<"You go west. All you can see are skyscrapers.\n>";
  34. }
  35. else if (dir == "look" || dir == "l") {
  36. cout<<"You look around, but do not see anyone nearby to terrorize.\n>";
  37. }
  38. else if (dir == "help") {
  39. cout<<"Available commands:\nMovement: Input north, south, east, west, or the first letter of the direction to move.\n";
  40. cout<<"Look around with l or look.\nQuit with q or quit.\n>";
  41. }
  42. else if (dir=="quit" || dir=="q") {
  43. cout<<"Quitting.\n";
  44. return 0;
  45. }
  46. else {
  47. cout<<"Command not recognized. Please try again.\n>";
  48. }
  49. }
  50. while(dir!="q" || dir!="quit");
  51. }
  52. //2 = load game, not yet implemented
  53. else if (option == 2) {
  54. cout<<"Not implemented yet. Please choose another option.\n>";
  55. }
  56. //3 = quit
  57. else if (option == 3) {
  58. cout<<"Nobody likes a quitter. The Powerpuff Girls win again! :\(\n";
  59. return 0;
  60. }
  61. //catches input that != 1,2,3, still fails on non-int inputs
  62. else {
  63. cout<<"Command not recognized. Please input 1, 2 or 3.\n>";
  64. }
  65. }
  66. while (option != 3);
  67. //it'll never actually get out of the initial do/while loop because all the quit options contain return 0;
  68. return 0;
  69. }
  70.