zopiac

Castle Alpha

Oct 8th, 2010
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 25.08 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Movement {
  3.     public static void main(String args[]) {
  4.         Scanner input = new Scanner(System.in);
  5.         int x = 10;
  6.         int y = 10;
  7.         int area = 1;
  8.         String command = "";
  9.         while (area == 1) {
  10.             if (command.equals("quit")) {
  11.                 area = 0;
  12.                 //######################################################################
  13.                 //######################################################################
  14.             } else if (x == 1 && y == 1) {
  15.                 System.out.println(x + ", " + y + "\nYou are at the intersection of Plum Alley and West Wall Street.\nYou may go east or south.");
  16.                 System.out.println("Command?");
  17.                 command = input.nextLine();
  18.                 while (!command.equals("")) {
  19.                     if (command.equals("n")) {
  20.                         System.out.println("You cannot go that way.");
  21.                         command = "";
  22.                     } else if (command.equals("s")) {
  23.                         ++y;
  24.                         command = "";
  25.                     } else if (command.equals("w")) {
  26.                         System.out.println("You cannot go that way.");
  27.                         command = "";
  28.                     } else if (command.equals("e")) {
  29.                         ++x;
  30.                         command = "";
  31.                     } else if (command.equals("quit")) {
  32.                         command = "quit";
  33.                         break;
  34.                     } else {
  35.                         System.out.println("Unrecognised command. Try again.");
  36.                         command = input.nextLine();
  37.                     }
  38.                 }
  39.                 //######################################################################
  40.                 } else if (x == 1 && y == 2) {
  41.                 System.out.println(x + ", " + y + "\nYou are on West Wall Street.\nYou may go north or south.");
  42.                 System.out.println("Command?");
  43.                 command = input.nextLine();
  44.                 while (!command.equals("")) {
  45.                     if (command.equals("n")) {
  46.                         --y;
  47.                         command = "";
  48.                     } else if (command.equals("s")) {
  49.                         ++y;
  50.                         command = "";
  51.                     } else if (command.equals("w")) {
  52.                         System.out.println("You cannot go that way.");
  53.                         command = "";
  54.                     } else if (command.equals("e")) {
  55.                         System.out.println("You cannot go that way.");
  56.                         command = "";
  57.                     } else if (command.equals("quit")) {
  58.                         command = "quit";
  59.                         break;
  60.                     } else {
  61.                         System.out.println("Unrecognised command. Try again.");
  62.                         command = input.nextLine();
  63.                     }
  64.                 }
  65.                 //######################################################################
  66.             } else if (x == 2 && y == 3) {
  67.                     System.out.println(x + ", " + y + "\nTEXT");
  68.                 System.out.println("Command?");
  69.                 command = input.nextLine();
  70.                 while (!command.equals("")) {
  71.                     if (command.equals("n")) {
  72.                         System.out.println("You cannot go that way.");
  73.                         command = "";
  74.                     } else if (command.equals("s")) {
  75.                         System.out.println("You cannot go that way.");
  76.                         command = "";
  77.                     } else if (command.equals("w")) {
  78.                         System.out.println("You cannot go that way.");
  79.                         command = "";
  80.                     } else if (command.equals("e")) {
  81.                         System.out.println("You cannot go that way.");
  82.                         command = "";
  83.                     } else if (command.equals("quit")) {
  84.                         command = "quit";
  85.                         break;
  86.                     } else {
  87.                         System.out.println("Unrecognised command. Try again.");
  88.                         command = input.nextLine();
  89.                     }
  90.                 }
  91.                     //######################################################################
  92.             } else if (x == 2 && y == 1) {
  93.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.");
  94.                 System.out.println("Command?");
  95.                 command = input.nextLine();
  96.                 while (!command.equals("")) {
  97.                     if (command.equals("n")) {
  98.                         System.out.println("You cannot go that way.");
  99.                         command = "";
  100.                     } else if (command.equals("s")) {
  101.                         System.out.println("You cannot go that way.");
  102.                         command = "";
  103.                     } else if (command.equals("w")) {
  104.                         --x;
  105.                         command = "";
  106.                     } else if (command.equals("e")) {
  107.                         ++x;
  108.                         command = "";
  109.                     } else if (command.equals("quit")) {
  110.                         command = "quit";
  111.                         break;
  112.                     } else {
  113.                         System.out.println("Unrecognised command. Try again.");
  114.                         command = input.nextLine();
  115.                     }
  116.                 }
  117.                 //######################################################################
  118.             } else if (x == 3 && y == 1) {
  119.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.\nThere is a Potions shop to your south.");
  120.                 System.out.println("Command?");
  121.                 command = input.nextLine();
  122.                 while (!command.equals("")) {
  123.                     if (command.equals("n")) {
  124.                         System.out.println("You cannot go that way.");
  125.                         command = "";
  126.                     } else if (command.equals("s")) {
  127.                         System.out.println("Not yet implemented.");
  128.                         command = "";
  129.                     } else if (command.equals("w")) {
  130.                         --x;
  131.                         command = "";
  132.                     } else if (command.equals("e")) {
  133.                         ++x;
  134.                         command = "";
  135.                     } else if (command.equals("quit")) {
  136.                         command = "quit";
  137.                         break;
  138.                     } else {
  139.                         System.out.println("Unrecognised command. Try again.");
  140.                         command = input.nextLine();
  141.                     }
  142.                 }
  143.                 //######################################################################
  144.             } else if (x == 4 && y == 1) {
  145.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.");
  146.                 System.out.println("Command?");
  147.                 command = input.nextLine();
  148.                 while (!command.equals("")) {
  149.                     if (command.equals("n")) {
  150.                         System.out.println("You cannot go that way.");
  151.                         command = "";
  152.                     } else if (command.equals("s")) {
  153.                         System.out.println("You cannot go that way.");
  154.                         command = "";
  155.                     } else if (command.equals("w")) {
  156.                         --x;
  157.                         command = "";
  158.                     } else if (command.equals("e")) {
  159.                         ++x;
  160.                         command = "";
  161.                     } else if (command.equals("quit")) {
  162.                         command = "quit";
  163.                         break;
  164.                     } else {
  165.                         System.out.println("Unrecognised command. Try again.");
  166.                         command = input.nextLine();
  167.                     }
  168.                 }
  169.                 //######################################################################
  170.             } else if (x == 5 && y == 1) {
  171.                 System.out.println(x + ", " + y + "\nYou are at the intersection of Plum Alley and Orchid Lane.\nYou may go east, south, or west.");
  172.                 System.out.println("Command?");
  173.                 command = input.nextLine();
  174.                 while (!command.equals("")) {
  175.                     if (command.equals("n")) {
  176.                         System.out.println("You cannot go that way.");
  177.                         command = "";
  178.                     } else if (command.equals("s")) {
  179. //                      ++y;
  180.                         System.out.println("ERROR: UNAVAILABLE: Unidentified Error.");
  181.                         command = "";
  182.                     } else if (command.equals("w")) {
  183.                         --x;
  184.                         command = "";
  185.                     } else if (command.equals("e")) {
  186.                         ++x;
  187.                         command = "";
  188.                     } else if (command.equals("quit")) {
  189.                         command = "quit";
  190.                         break;
  191.                     } else {
  192.                         System.out.println("Unrecognised command. Try again.");
  193.                         command = input.nextLine();
  194.                     }
  195.                 }
  196.                 //######################################################################//
  197.                 //################################ FAIL ################################//
  198.                 //######################################################################//
  199.                 //################################ FAIL ################################//
  200.                 //######################################################################//
  201. //          } else if (x == 5 && y == 2) {
  202. //              System.out.println(x + ", " + y + "\nYou are on Orchid Lane.\nYou may go north or south.");
  203. //              System.out.println("Command?");
  204. //              command = input.nextLine();
  205. //              while (!command.equals("")) {
  206. //                  if (command.equals("n")) {
  207. //                      --y;
  208. //                  } else if (command.equals("s")) {
  209. //                      ++y;
  210. //                      command = "";
  211. //                  } else if (command.equals("w")) {
  212. //                      System.out.println("You cannot go that way.");
  213. //                      command = "";
  214. //                  } else if (command.equals("e")) {
  215. //                      System.out.println("You cannot go that way.");
  216. //                      command = "";
  217. //                  } else if (command.equals("quit")) {
  218. //                      command = "quit";
  219. //                      break;
  220. //                  } else {
  221. //                      System.out.println("Unrecognised command. Try again.");
  222. //                      command = input.nextLine();
  223. //                  }
  224. //              }
  225.                 //######################################################################
  226.             } else if (x == 6 && y == 1) {
  227.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.");
  228.                 System.out.println("Command?");
  229.                 command = input.nextLine();
  230.                 while (!command.equals("")) {
  231.                     if (command.equals("n")) {
  232.                         System.out.println("You cannot go that way.");
  233.                         command = "";
  234.                     } else if (command.equals("s")) {
  235.                         System.out.println("You cannot go that way.");
  236.                         command = "";
  237.                     } else if (command.equals("w")) {
  238.                         --x;
  239.                         command = "";
  240.                     } else if (command.equals("e")) {
  241.                         ++x;
  242.                         command = "";
  243.                     } else if (command.equals("quit")) {
  244.                         command = "quit";
  245.                         break;
  246.                     } else {
  247.                         System.out.println("Unrecognised command. Try again.");
  248.                         command = input.nextLine();
  249.                     }
  250.                 }
  251.                 //######################################################################
  252.             } else if (x == 7 && y == 1) {
  253.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east, or west.\nThere is a Magic shop to your south.");
  254.  
  255.                 System.out.println("Command?");
  256.                 command = input.nextLine();
  257.                 while (!command.equals("")) {
  258.                     if (command.equals("n")) {
  259.                         System.out.println("You cannot go that way.");
  260.                         command = "";
  261.                     } else if (command.equals("s")) {
  262.                         System.out.println("Not yet implemented.");
  263.                         command = "";
  264.                     } else if (command.equals("w")) {
  265.                         --x;
  266.                         command = "";
  267.                     } else if (command.equals("e")) {
  268.                         ++x;
  269.                         command = "";
  270.                     } else if (command.equals("quit")) {
  271.                         command = "quit";
  272.                         break;
  273.                     } else {
  274.                         System.out.println("Unrecognised command. Try again.");
  275.                         command = input.nextLine();
  276.                     }
  277.                 }
  278.                 //######################################################################
  279.             } else if (x == 8 && y == 1) {
  280.                 System.out.println(x + ", " + y + "\nYou are at the intersection of Plum Alley and Cherry Street.\nYou may go south or west.");
  281.                 System.out.println("Command?");
  282.                 command = input.nextLine();
  283.                 while (!command.equals("")) {
  284.                     if (command.equals("n")) {
  285.                         System.out.println("You cannot go that way.");
  286.                         command = "";
  287.                     } else if (command.equals("s")) {
  288.                         ++y;
  289.                         command = "";
  290.                     } else if (command.equals("w")) {
  291.                         --x;
  292.                         command = "";
  293.                     } else if (command.equals("e")) {
  294.                         System.out.println("You cannot go that way.");
  295.                         command = "";
  296.                     } else if (command.equals("quit")) {
  297.                         command = "quit";
  298.                         break;
  299.                     } else {
  300.                         System.out.println("Unrecognised command. Try again.");
  301.                         command = input.nextLine();
  302.                     }
  303.                 }
  304.                 //######################################################################
  305.                 } else if (x == 8 && y == 2) {
  306.                 System.out.println(x + ", " + y + "\nYou are on Cherry Street.\nYou may go north or south.");
  307.                 System.out.println("Command?");
  308.                 command = input.nextLine();
  309.                 while (!command.equals("")) {
  310.                     if (command.equals("n")) {
  311.                         --y;
  312.                         command = "";
  313.                     } else if (command.equals("s")) {
  314.                         ++y;
  315.                         command = "";
  316.                     } else if (command.equals("w")) {
  317.                         System.out.println("You cannot go that way.");
  318.                         command = "";
  319.                     } else if (command.equals("e")) {
  320.                         System.out.println("You cannot go that way.");
  321.                         command = "";
  322.                     } else if (command.equals("quit")) {
  323.                         command = "quit";
  324.                         break;
  325.                     } else {
  326.                         System.out.println("Unrecognised command. Try again.");
  327.                         command = input.nextLine();
  328.                     }
  329.                 }
  330.                 //######################################################################
  331.                 } else if (x == 8 && y == 3) {
  332.                     System.out.println(x + ", " + y + "\nYou are on Cherry Street.\nYou may go north, or south into the Market.");
  333.                     System.out.println("Command?");
  334.                     command = input.nextLine();
  335.                     while (!command.equals("")) {
  336.                         if (command.equals("n")) {
  337.                             --y;
  338.                             command = "";
  339.                         } else if (command.equals("s")) {
  340.                             ++y;
  341.                             command = "";
  342.                         } else if (command.equals("w")) {
  343.                             System.out.println("You cannot go that way.");
  344.                             command = "";
  345.                         } else if (command.equals("e")) {
  346.                             System.out.println("You cannot go that way.");
  347.                             command = "";
  348.                         } else if (command.equals("quit")) {
  349.                             command = "quit";
  350.                             break;
  351.                         } else {
  352.                             System.out.println("Unrecognised command. Try again.");
  353.                             command = input.nextLine();
  354.                         }
  355.                     }
  356.                     //######################################################################
  357.                 } else if (x == 8 && y == 4) {
  358.                     System.out.println(x + ", " + y + "\nYou are on Cherry Street.\nYou may go north, or south into the Market.");
  359.                     System.out.println("Command?");
  360.                     command = input.nextLine();
  361.                     while (!command.equals("")) {
  362.                         if (command.equals("n")) {
  363.                             --y;
  364.                             command = "";
  365.                         } else if (command.equals("s")) {
  366.                             ++y;
  367.                             command = "";
  368.                         } else if (command.equals("w")) {
  369.                             System.out.println("You cannot go that way.");
  370.                             command = "";
  371.                         } else if (command.equals("e")) {
  372.                             System.out.println("You cannot go that way.");
  373.                             command = "";
  374.                         } else if (command.equals("quit")) {
  375.                             command = "quit";
  376.                             break;
  377.                         } else {
  378.                             System.out.println("Unrecognised command. Try again.");
  379.                             command = input.nextLine();
  380.                         }
  381.                     }
  382.                     //######################################################################
  383.                 } else if (x == 8 && y == 5) {
  384.                     System.out.println(x + ", " + y + "\nYou are in the Market.\nYou may go north, east, south, or west.");
  385.                     System.out.println("Command?");
  386.                     command = input.nextLine();
  387.                     while (!command.equals("")) {
  388.                         if (command.equals("n")) {
  389.                             --y;
  390.                             command = "";
  391.                         } else if (command.equals("s")) {
  392.                             ++y;
  393.                             command = "";
  394.                         } else if (command.equals("w")) {
  395.                             --x;
  396.                             command = "";
  397.                         } else if (command.equals("e")) {
  398.                             ++x;
  399.                             command = "";
  400.                         } else if (command.equals("quit")) {
  401.                             command = "quit";
  402.                             break;
  403.                         } else {
  404.                             System.out.println("Unrecognised command. Try again.");
  405.                             command = input.nextLine();
  406.                         }
  407.                     }
  408.                     //######################################################################
  409.                 } else if (x == 9 && y == 5) {
  410.                     System.out.println(x + ", " + y + "\nYou are in the Market.\nYou may go east, south, or west.");
  411.                     System.out.println("Command?");
  412.                     command = input.nextLine();
  413.                     while (!command.equals("")) {
  414.                         if (command.equals("n")) {
  415.                             System.out.println("You cannot go that way.");
  416.                             command = "";
  417.                         } else if (command.equals("s")) {
  418.                             ++y;
  419.                             command = "";
  420.                         } else if (command.equals("w")) {
  421.                             --x;
  422.                             command = "";
  423.                         } else if (command.equals("e")) {
  424.                             ++x;
  425.                             command = "";
  426.                         } else if (command.equals("quit")) {
  427.                             command = "quit";
  428.                             break;
  429.                         } else {
  430.                             System.out.println("Unrecognised command. Try again.");
  431.                             command = input.nextLine();
  432.                         }
  433.                     }
  434.                     //######################################################################
  435.                 } else if (x == 9 && y == 9) {
  436.                 command = "";
  437.                 System.out.println("Welcome to the General Store!");
  438.                 System.out.println("Would you like to buy or sell?");
  439.                 System.out.println("--Buy");
  440.                 System.out.println("--Sell");
  441.                 System.out.println("--Leave");
  442.                 command = input.nextLine();
  443.                 while (!command.equals("")) {
  444.                     if (command.equals("buy")) {
  445.                     } else if (command.equals("sell")) {
  446.                     } else if (command.equals("leave")) {
  447.                         command = "";
  448.                     } else {
  449.                         System.out.println("Unrecognised command. Try again.");
  450.                         command = input.nextLine();
  451.                     }
  452.                 }
  453.             ++x;
  454.                 //#####################################################################
  455.             } else if (x == 10 && y == 1) {
  456.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go south, or north into the Castle.");
  457.                 System.out.println("Command?");
  458.                 command = input.nextLine();
  459.                 while (!command.equals("")) {
  460.                     if (command.equals("n")) {
  461.                         System.out.println("CASTLE:CASTLE:NOT YET IMPLEMENTED");
  462.                         command = "";
  463.                     } else if (command.equals("s")) {
  464.                         ++y;
  465.                         command = "";
  466.                     } else if (command.equals("w")) {
  467.                         System.out.println("You cannot go that way.");
  468.                         command = "";
  469.                     } else if (command.equals("e")) {
  470.                         System.out.println("You cannot go that way.");
  471.                         command = "";
  472.                     } else if (command.equals("quit")) {
  473.                         command = "quit";
  474.                         break;
  475.                     } else {
  476.                         System.out.println("Unrecognised command. Try again.");
  477.                         command = input.nextLine();
  478.                     }
  479.                 }
  480.                 //######################################################################
  481.            
  482.            
  483.            
  484.             } else if (x == 10 && y == 2) {
  485.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  486.                 System.out.println("Command?");
  487.                 command = input.nextLine();
  488.                 while (!command.equals("")) {
  489.                     if (command.equals("n")) {
  490.                         --y;
  491.                         command = "";
  492.                     } else if (command.equals("s")) {
  493.                         ++y;
  494.                         command = "";
  495.                     } else if (command.equals("w")) {
  496.                         System.out.println("You cannot go that way.");
  497.                         command = "";
  498.                     } else if (command.equals("e")) {
  499.                         System.out.println("You cannot go that way.");
  500.                         command = "";
  501.                     } else if (command.equals("quit")) {
  502.                         command = "quit";
  503.                         break;
  504.                     } else {
  505.                         System.out.println("Unrecognised command. Try again.");
  506.                         command = input.nextLine();
  507.                     }
  508.                 }
  509.  
  510.                 //######################################################################
  511.             } else if (x == 10 && y == 3) {
  512.                 System.out.println(x + ", " + y + "\nYou are at the intersection of White street and North Avenue.\nYou may go north, east, or south.");
  513.                 System.out.println("Command?");
  514.                 command = input.nextLine();
  515.                 while (!command.equals("")) {
  516.                     if (command.equals("n")) {
  517.                         --y;
  518.                         command = "";
  519.                     } else if (command.equals("s")) {
  520.                         ++y;
  521.                         command = "";
  522.                     } else if (command.equals("w")) {
  523.                         System.out.println("You cannot go that way.");
  524.                         command = "";
  525.                     } else if (command.equals("e")) {
  526.                         ++x;
  527.                         command = "";
  528.                     } else if (command.equals("quit")) {
  529.                         command = "quit";
  530.                         break;
  531.                     } else {
  532.                         System.out.println("Unrecognised command. Try again.");
  533.                         command = input.nextLine();
  534.                     }
  535.                 }
  536.                 //######################################################################
  537.             } else if (x == 10 && y == 4) {
  538.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  539.                 System.out.println("Command?");
  540.                 command = input.nextLine();
  541.                 while (!command.equals("")) {
  542.                     if (command.equals("n")) {
  543.                         --y;
  544.                         command = "";
  545.                     } else if (command.equals("s")) {
  546.                         ++y;
  547.                         command = "";
  548.                     } else if (command.equals("w")) {
  549.                         System.out.println("You cannot go that way.");
  550.                         command = "";
  551.                     } else if (command.equals("e")) {
  552.                         System.out.println("You cannot go that way.");
  553.                         command = "";
  554.                     } else if (command.equals("quit")) {
  555.                         command = "quit";
  556.                         break;
  557.                     } else {
  558.                         System.out.println("Unrecognised command. Try again.");
  559.                         command = input.nextLine();
  560.                     }
  561.                 }
  562.                 //######################################################################   
  563.             } else if (x == 10 && y == 5) {
  564.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north, south, or west into the Market.");
  565.                 System.out.println("Command?");
  566.                 command = input.nextLine();
  567.                 while (!command.equals("")) {
  568.                     if (command.equals("n")) {
  569.                         --y;
  570.                         command = "";
  571.                     } else if (command.equals("s")) {
  572.                         ++y;
  573.                         command = "";
  574.                     } else if (command.equals("w")) {
  575.                         --x;
  576.                         command = "";
  577.                     } else if (command.equals("e")) {
  578.                         System.out.println("You cannot go that way.");
  579.                         command = "";
  580.                     } else if (command.equals("quit")) {
  581.                         command = "quit";
  582.                         break;
  583.                     } else {
  584.                         System.out.println("Unrecognised command. Try again.");
  585.                         command = input.nextLine();
  586.                     }
  587.                 }
  588.                 //######################################################################   
  589.             } else if (x == 10 && y == 6) {
  590.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north, south, or west into the Market.");
  591.                 System.out.println("Command?");
  592.                 command = input.nextLine();
  593.                 while (!command.equals("")) {
  594.                     if (command.equals("n")) {
  595.                         --y;
  596.                         command = "";
  597.                     } else if (command.equals("s")) {
  598.                         ++y;
  599.                         command = "";
  600.                     } else if (command.equals("w")) {
  601.                         --x;
  602.                         command = "";
  603.                     } else if (command.equals("e")) {
  604.                         System.out.println("You cannot go that way.");
  605.                         command = "";
  606.                     } else if (command.equals("quit")) {
  607.                         command = "quit";
  608.                         break;
  609.                     } else {
  610.                         System.out.println("Unrecognised command. Try again.");
  611.                         command = input.nextLine();
  612.                     }
  613.                 }
  614.                 //######################################################################
  615.             } else if (x == 10 && y == 7) {
  616.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  617.                 System.out.println("Command?");
  618.                 command = input.nextLine();
  619.                 while (!command.equals("")) {
  620.                     if (command.equals("n")) {
  621.                         --y;
  622.                         command = "";
  623.                     } else if (command.equals("s")) {
  624.                         ++y;
  625.                         command = "";
  626.                     } else if (command.equals("w")) {
  627.                         System.out.println("You cannot go that way.");
  628.                         command = "";
  629.                     } else if (command.equals("e")) {
  630.                         System.out.println("You cannot go that way.");
  631.                         command = "";
  632.                     } else if (command.equals("quit")) {
  633.                         command = "quit";
  634.                         break;
  635.                     } else {
  636.                         System.out.println("Unrecognised command. Try again.");
  637.                         command = input.nextLine();
  638.                     }
  639.                 }
  640.                 //######################################################################   
  641.             } else if (x == 10 && y == 8) {
  642.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  643.                 System.out.println("Command?");
  644.                 command = input.nextLine();
  645.                 while (!command.equals("")) {
  646.                     if (command.equals("n")) {
  647.                         --y;
  648.                         command = "";
  649.                     } else if (command.equals("s")) {
  650.                         ++y;
  651.                         command = "";
  652.                     } else if (command.equals("w")) {
  653.                         System.out.println("You cannot go that way.");
  654.                         command = "";
  655.                     } else if (command.equals("e")) {
  656.                         System.out.println("You cannot go that way.");
  657.                         command = "";
  658.                     } else if (command.equals("quit")) {
  659.                         command = "quit";
  660.                         break;
  661.                     } else {
  662.                         System.out.println("Unrecognised command. Try again.");
  663.                         command = input.nextLine();
  664.                     }
  665.                 }
  666.                 //######################################################################
  667.             } else if (x == 10 && y == 9) {
  668.                 System.out.println(x + ", " + y + "\nYou are on North Avenue, north of the town centre.\nYou may go north or south.\nThere is a General Store to your west.");
  669.                 System.out.println("Command?");
  670.                 command = input.nextLine();
  671.                 while (!command.equals("")) {
  672.                     if (command.equals("n")) {
  673.                         --y;
  674.                         command = "";
  675.                     } else if (command.equals("s")) {
  676.                         ++y;
  677.                         command = "";
  678.                     } else if (command.equals("w")) {
  679.                         System.out.println("Not yet implemented.");//--x;
  680.                         command = "";
  681.                     } else if (command.equals("e")) {
  682.                         System.out.println("You cannot go that way.");
  683.                         command = "";
  684.                     } else if (command.equals("quit")) {
  685.                         command = "quit";
  686.                         break;
  687.                     } else {
  688.                         System.out.println("Unrecognised command. Try again.");
  689.                         command = input.nextLine();
  690.                     }
  691.                 }              
  692.                 //#######################################################################
  693.             } else if (x == 10 && y == 10) {
  694.                 System.out.println(x + ", " + y + "\nYou are in the town centre.\nYou may go north, east, south, or west.");
  695.                 System.out.println("Command?");
  696.                 command = input.nextLine();
  697.                 while (!command.equals("")) {
  698.                     if (command.equals("n")) {
  699.                         --y;
  700.                         command = "";
  701.                     } else if (command.equals("s")) {
  702.                         System.out.println("You cannot go that way.");
  703.                         command = "";
  704.                     } else if (command.equals("w")) {
  705.                         System.out.println("You cannot go that way.");
  706.                         command = "";
  707.                     } else if (command.equals("e")) {
  708.                         System.out.println("You cannot go that way.");
  709.                         command = "";
  710.                     } else if (command.equals("quit")) {
  711.                         command = "quit";
  712.                         break;
  713.                     } else {
  714.                         System.out.println("Unrecognised command. Try again.");
  715.                         command = input.nextLine();
  716.                     }
  717.                 }
  718.             } else {
  719.                 System.out.println("TERMINATING: ERROR: 404.1: Coordinates Not Found");
  720.                 System.exit(0);
  721.             }  
  722.         }
  723.         if (area == 0) {
  724.             System.out.println("TERMINATING: QUIT");
  725.             System.exit(0);
  726.         }
  727.         while ((area != 0) || (area != 1) || (area != 2)) {
  728.             ////TEMPORARY STATEMENT CONCERNING INVALID AREAS
  729.             System.out.println("TERMINATING: ERROR: 404.0: Area Not Found");
  730.             System.exit(0);
  731.         }
  732.         System.out.println("TERMINATING: ERROR: 1: Improper lead to escape primary while loop");
  733.         System.exit(0);
  734.     }
  735. }
Add Comment
Please, Sign In to add comment