zopiac

Game Alpha 7/10/10

Oct 7th, 2010
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 24.34 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 == 1) {
  67.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.");
  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.                         --x;
  79.                         command = "";
  80.                     } else if (command.equals("e")) {
  81.                         ++x;
  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 == 3 && y == 1) {
  93.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.\nThere is a Potions shop to your south.");
  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("Not yet implemented.");
  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 == 4 && y == 1) {
  119.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.");
  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("You cannot go that way.");
  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 == 5 && y == 1) {
  145.                 System.out.println(x + ", " + y + "\nYou are at the intersection of Plum Alley and Orchid Lane.\nYou may go east, south, 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.                         ++y;
  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.                 //################################ FAIL ################################//
  171.                 //######################################################################//
  172.                 //################################ FAIL ################################//
  173.                 //######################################################################//
  174.             } else if (x == 5 && y == 2) {
  175.                 System.out.println(x + ", " + y + "\nFILLER");
  176.                 System.out.println("Command?");
  177.                 command = input.nextLine();
  178.                 while (!command.equals("")) {
  179.                     if (command.equals("n")) {
  180.                         --y;
  181.                     }
  182.                 }
  183. //          } else if (x == 5 && y == 2) {
  184. //              System.out.println(x + ", " + y + "\nYou are on Orchid Lane.\nYou may go north or south.");
  185. //              System.out.println("Command?");
  186. //              command = input.nextLine();
  187. //              while (!command.equals("")) {
  188. //                  if (command.equals("n")) {
  189. //                      --y;
  190. //                  } else if (command.equals("s")) {
  191. //                      ++y;
  192. //                      command = "";
  193. //                  } else if (command.equals("w")) {
  194. //                      System.out.println("You cannot go that way.");
  195. //                      command = "";
  196. //                  } else if (command.equals("e")) {
  197. //                      System.out.println("You cannot go that way.");
  198. //                      command = "";
  199. //                  } else if (command.equals("quit")) {
  200. //                      command = "quit";
  201. //                      break;
  202. //                  } else {
  203. //                      System.out.println("Unrecognised command. Try again.");
  204. //                      command = input.nextLine();
  205. //                  }
  206. //              }
  207.                 //######################################################################
  208.             } else if (x == 6 && y == 1) {
  209.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east or west.");
  210.                 System.out.println("Command?");
  211.                 command = input.nextLine();
  212.                 while (!command.equals("")) {
  213.                     if (command.equals("n")) {
  214.                         System.out.println("You cannot go that way.");
  215.                         command = "";
  216.                     } else if (command.equals("s")) {
  217.                         System.out.println("You cannot go that way.");
  218.                         command = "";
  219.                     } else if (command.equals("w")) {
  220.                         --x;
  221.                         command = "";
  222.                     } else if (command.equals("e")) {
  223.                         ++x;
  224.                         command = "";
  225.                     } else if (command.equals("quit")) {
  226.                         command = "quit";
  227.                         break;
  228.                     } else {
  229.                         System.out.println("Unrecognised command. Try again.");
  230.                         command = input.nextLine();
  231.                     }
  232.                 }
  233.                 //######################################################################
  234.             } else if (x == 7 && y == 1) {
  235.                 System.out.println(x + ", " + y + "\nYou are on Plum Alley.\nYou may go east, or west.\nThere is a Magic shop to your south.");
  236.                 System.out.println("Command?");
  237.                 command = input.nextLine();
  238.                 while (!command.equals("")) {
  239.                     if (command.equals("n")) {
  240.                         System.out.println("You cannot go that way.");
  241.                         command = "";
  242.                     } else if (command.equals("s")) {
  243.                         System.out.println("Not yet implemented.");
  244.                         command = "";
  245.                     } else if (command.equals("w")) {
  246.                         --x;
  247.                         command = "";
  248.                     } else if (command.equals("e")) {
  249.                         ++x;
  250.                         command = "";
  251.                     } else if (command.equals("quit")) {
  252.                         command = "quit";
  253.                         break;
  254.                     } else {
  255.                         System.out.println("Unrecognised command. Try again.");
  256.                         command = input.nextLine();
  257.                     }
  258.                 }
  259.                 //######################################################################
  260.             } else if (x == 8 && y == 1) {
  261.                 System.out.println(x + ", " + y + "\nYou are at the intersection of Plum Alley and Cherry Street.\nYou may go south or west.");
  262.                 System.out.println("Command?");
  263.                 command = input.nextLine();
  264.                 while (!command.equals("")) {
  265.                     if (command.equals("n")) {
  266.                         System.out.println("You cannot go that way.");
  267.                         command = "";
  268.                     } else if (command.equals("s")) {
  269.                         ++y;
  270.                         command = "";
  271.                     } else if (command.equals("w")) {
  272.                         --x;
  273.                         command = "";
  274.                     } else if (command.equals("e")) {
  275.                         System.out.println("You cannot go that way.");
  276.                         command = "";
  277.                     } else if (command.equals("quit")) {
  278.                         command = "quit";
  279.                         break;
  280.                     } else {
  281.                         System.out.println("Unrecognised command. Try again.");
  282.                         command = input.nextLine();
  283.                     }
  284.                 }
  285.                 //######################################################################
  286.                 } else if (x == 8 && y == 2) {
  287.                 System.out.println(x + ", " + y + "\nYou are on Cherry Street.\nYou may go north or south.");
  288.                 System.out.println("Command?");
  289.                 command = input.nextLine();
  290.                 while (!command.equals("")) {
  291.                     if (command.equals("n")) {
  292.                         --y;
  293.                         command = "";
  294.                     } else if (command.equals("s")) {
  295.                         ++y;
  296.                         command = "";
  297.                     } else if (command.equals("w")) {
  298.                         System.out.println("You cannot go that way.");
  299.                         command = "";
  300.                     } else if (command.equals("e")) {
  301.                         System.out.println("You cannot go that way.");
  302.                         command = "";
  303.                     } else if (command.equals("quit")) {
  304.                         command = "quit";
  305.                         break;
  306.                     } else {
  307.                         System.out.println("Unrecognised command. Try again.");
  308.                         command = input.nextLine();
  309.                     }
  310.                 }
  311.                 //######################################################################
  312.                 } else if (x == 8 && y == 3) {
  313.                     System.out.println(x + ", " + y + "\nYou are on Cherry Street.\nYou may go north, or south into the Market.");
  314.                     System.out.println("Command?");
  315.                     command = input.nextLine();
  316.                     while (!command.equals("")) {
  317.                         if (command.equals("n")) {
  318.                             --y;
  319.                             command = "";
  320.                         } else if (command.equals("s")) {
  321.                             ++y;
  322.                             command = "";
  323.                         } else if (command.equals("w")) {
  324.                             System.out.println("You cannot go that way.");
  325.                             command = "";
  326.                         } else if (command.equals("e")) {
  327.                             System.out.println("You cannot go that way.");
  328.                             command = "";
  329.                         } else if (command.equals("quit")) {
  330.                             command = "quit";
  331.                             break;
  332.                         } else {
  333.                             System.out.println("Unrecognised command. Try again.");
  334.                             command = input.nextLine();
  335.                         }
  336.                     }
  337.                     //######################################################################
  338.                 } else if (x == 8 && y == 4) {
  339.                     System.out.println(x + ", " + y + "\nYou are on Cherry Street.\nYou may go north, or south into the Market.");
  340.                     System.out.println("Command?");
  341.                     command = input.nextLine();
  342.                     while (!command.equals("")) {
  343.                         if (command.equals("n")) {
  344.                             --y;
  345.                             command = "";
  346.                         } else if (command.equals("s")) {
  347.                             ++y;
  348.                             command = "";
  349.                         } else if (command.equals("w")) {
  350.                             System.out.println("You cannot go that way.");
  351.                             command = "";
  352.                         } else if (command.equals("e")) {
  353.                             System.out.println("You cannot go that way.");
  354.                             command = "";
  355.                         } else if (command.equals("quit")) {
  356.                             command = "quit";
  357.                             break;
  358.                         } else {
  359.                             System.out.println("Unrecognised command. Try again.");
  360.                             command = input.nextLine();
  361.                         }
  362.                     }
  363.                     //######################################################################
  364.                 } else if (x == 8 && y == 5) {
  365.                     System.out.println(x + ", " + y + "\nYou are in the Market.\nYou may go north, east, south, or west.");
  366.                     System.out.println("Command?");
  367.                     command = input.nextLine();
  368.                     while (!command.equals("")) {
  369.                         if (command.equals("n")) {
  370.                             --y;
  371.                             command = "";
  372.                         } else if (command.equals("s")) {
  373.                             ++y;
  374.                             command = "";
  375.                         } else if (command.equals("w")) {
  376.                             --x;
  377.                             command = "";
  378.                         } else if (command.equals("e")) {
  379.                             ++x;
  380.                             command = "";
  381.                         } else if (command.equals("quit")) {
  382.                             command = "quit";
  383.                             break;
  384.                         } else {
  385.                             System.out.println("Unrecognised command. Try again.");
  386.                             command = input.nextLine();
  387.                         }
  388.                     }
  389.                     //######################################################################
  390.                 } else if (x == 9 && y == 5) {
  391.                     System.out.println(x + ", " + y + "\nYou are in the Market.\nYou may go east, south, or west.");
  392.                     System.out.println("Command?");
  393.                     command = input.nextLine();
  394.                     while (!command.equals("")) {
  395.                         if (command.equals("n")) {
  396.                             System.out.println("You cannot go that way.");
  397.                             command = "";
  398.                         } else if (command.equals("s")) {
  399.                             ++y;
  400.                             command = "";
  401.                         } else if (command.equals("w")) {
  402.                             --x;
  403.                             command = "";
  404.                         } else if (command.equals("e")) {
  405.                             ++x;
  406.                             command = "";
  407.                         } else if (command.equals("quit")) {
  408.                             command = "quit";
  409.                             break;
  410.                         } else {
  411.                             System.out.println("Unrecognised command. Try again.");
  412.                             command = input.nextLine();
  413.                         }
  414.                     }
  415.                     //######################################################################
  416.                 } else if (x == 9 && y == 9) {
  417.                 command = "";
  418.                 System.out.println("Welcome to the General Store!");
  419.                 System.out.println("Would you like to buy or sell?");
  420.                 System.out.println("--Buy");
  421.                 System.out.println("--Sell");
  422.                 System.out.println("--Leave");
  423.                 command = input.nextLine();
  424.                 while (!command.equals("")) {
  425.                     if (command.equals("buy")) {
  426.                     } else if (command.equals("sell")) {
  427.                     } else if (command.equals("leave")) {
  428.                         command = "";
  429.                     } else {
  430.                         System.out.println("Unrecognised command. Try again.");
  431.                         command = input.nextLine();
  432.                     }
  433.                 }
  434.             ++x;
  435.                 //#####################################################################
  436.             } else if (x == 10 && y == 1) {
  437.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go south, or north into the Castle.");
  438.                 System.out.println("Command?");
  439.                 command = input.nextLine();
  440.                 while (!command.equals("")) {
  441.                     if (command.equals("n")) {
  442.                         System.out.println("CASTLE:CASTLE:NOT YET IMPLEMENTED");
  443.                         command = "";
  444.                     } else if (command.equals("s")) {
  445.                         ++y;
  446.                         command = "";
  447.                     } else if (command.equals("w")) {
  448.                         System.out.println("You cannot go that way.");
  449.                         command = "";
  450.                     } else if (command.equals("e")) {
  451.                         System.out.println("You cannot go that way.");
  452.                         command = "";
  453.                     } else if (command.equals("quit")) {
  454.                         command = "quit";
  455.                         break;
  456.                     } else {
  457.                         System.out.println("Unrecognised command. Try again.");
  458.                         command = input.nextLine();
  459.                     }
  460.                 }
  461.                 //######################################################################
  462.            
  463.            
  464.            
  465.             } else if (x == 10 && y == 2) {
  466.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  467.                 System.out.println("Command?");
  468.                 command = input.nextLine();
  469.                 while (!command.equals("")) {
  470.                     if (command.equals("n")) {
  471.                         --y;
  472.                         command = "";
  473.                     } else if (command.equals("s")) {
  474.                         ++y;
  475.                         command = "";
  476.                     } else if (command.equals("w")) {
  477.                         System.out.println("You cannot go that way.");
  478.                         command = "";
  479.                     } else if (command.equals("e")) {
  480.                         System.out.println("You cannot go that way.");
  481.                         command = "";
  482.                     } else if (command.equals("quit")) {
  483.                         command = "quit";
  484.                         break;
  485.                     } else {
  486.                         System.out.println("Unrecognised command. Try again.");
  487.                         command = input.nextLine();
  488.                     }
  489.                 }
  490.  
  491.                 //######################################################################
  492.             } else if (x == 10 && y == 3) {
  493.                 System.out.println(x + ", " + y + "\nYou are at the intersection of White street and North Avenue.\nYou may go north, east, or south.");
  494.                 System.out.println("Command?");
  495.                 command = input.nextLine();
  496.                 while (!command.equals("")) {
  497.                     if (command.equals("n")) {
  498.                         --y;
  499.                         command = "";
  500.                     } else if (command.equals("s")) {
  501.                         ++y;
  502.                         command = "";
  503.                     } else if (command.equals("w")) {
  504.                         System.out.println("You cannot go that way.");
  505.                         command = "";
  506.                     } else if (command.equals("e")) {
  507.                         ++x;
  508.                         command = "";
  509.                     } else if (command.equals("quit")) {
  510.                         command = "quit";
  511.                         break;
  512.                     } else {
  513.                         System.out.println("Unrecognised command. Try again.");
  514.                         command = input.nextLine();
  515.                     }
  516.                 }
  517.                 //######################################################################
  518.             } else if (x == 10 && y == 4) {
  519.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  520.                 System.out.println("Command?");
  521.                 command = input.nextLine();
  522.                 while (!command.equals("")) {
  523.                     if (command.equals("n")) {
  524.                         --y;
  525.                         command = "";
  526.                     } else if (command.equals("s")) {
  527.                         ++y;
  528.                         command = "";
  529.                     } else if (command.equals("w")) {
  530.                         System.out.println("You cannot go that way.");
  531.                         command = "";
  532.                     } else if (command.equals("e")) {
  533.                         System.out.println("You cannot go that way.");
  534.                         command = "";
  535.                     } else if (command.equals("quit")) {
  536.                         command = "quit";
  537.                         break;
  538.                     } else {
  539.                         System.out.println("Unrecognised command. Try again.");
  540.                         command = input.nextLine();
  541.                     }
  542.                 }
  543.                 //######################################################################   
  544.             } else if (x == 10 && y == 5) {
  545.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north, south, or west into the Market.");
  546.                 System.out.println("Command?");
  547.                 command = input.nextLine();
  548.                 while (!command.equals("")) {
  549.                     if (command.equals("n")) {
  550.                         --y;
  551.                         command = "";
  552.                     } else if (command.equals("s")) {
  553.                         ++y;
  554.                         command = "";
  555.                     } else if (command.equals("w")) {
  556.                         --x;
  557.                         command = "";
  558.                     } else if (command.equals("e")) {
  559.                         System.out.println("You cannot go that way.");
  560.                         command = "";
  561.                     } else if (command.equals("quit")) {
  562.                         command = "quit";
  563.                         break;
  564.                     } else {
  565.                         System.out.println("Unrecognised command. Try again.");
  566.                         command = input.nextLine();
  567.                     }
  568.                 }
  569.                 //######################################################################   
  570.             } else if (x == 10 && y == 6) {
  571.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north, south, or west into the Market.");
  572.                 System.out.println("Command?");
  573.                 command = input.nextLine();
  574.                 while (!command.equals("")) {
  575.                     if (command.equals("n")) {
  576.                         --y;
  577.                         command = "";
  578.                     } else if (command.equals("s")) {
  579.                         ++y;
  580.                         command = "";
  581.                     } else if (command.equals("w")) {
  582.                         --x;
  583.                         command = "";
  584.                     } else if (command.equals("e")) {
  585.                         System.out.println("You cannot go that way.");
  586.                         command = "";
  587.                     } else if (command.equals("quit")) {
  588.                         command = "quit";
  589.                         break;
  590.                     } else {
  591.                         System.out.println("Unrecognised command. Try again.");
  592.                         command = input.nextLine();
  593.                     }
  594.                 }
  595.                 //######################################################################
  596.             } else if (x == 10 && y == 7) {
  597.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  598.                 System.out.println("Command?");
  599.                 command = input.nextLine();
  600.                 while (!command.equals("")) {
  601.                     if (command.equals("n")) {
  602.                         --y;
  603.                         command = "";
  604.                     } else if (command.equals("s")) {
  605.                         ++y;
  606.                         command = "";
  607.                     } else if (command.equals("w")) {
  608.                         System.out.println("You cannot go that way.");
  609.                         command = "";
  610.                     } else if (command.equals("e")) {
  611.                         System.out.println("You cannot go that way.");
  612.                         command = "";
  613.                     } else if (command.equals("quit")) {
  614.                         command = "quit";
  615.                         break;
  616.                     } else {
  617.                         System.out.println("Unrecognised command. Try again.");
  618.                         command = input.nextLine();
  619.                     }
  620.                 }
  621.                 //######################################################################   
  622.             } else if (x == 10 && y == 8) {
  623.                 System.out.println(x + ", " + y + "\nYou are on North Avenue.\nYou may go north or south.");
  624.                 System.out.println("Command?");
  625.                 command = input.nextLine();
  626.                 while (!command.equals("")) {
  627.                     if (command.equals("n")) {
  628.                         --y;
  629.                         command = "";
  630.                     } else if (command.equals("s")) {
  631.                         ++y;
  632.                         command = "";
  633.                     } else if (command.equals("w")) {
  634.                         System.out.println("You cannot go that way.");
  635.                         command = "";
  636.                     } else if (command.equals("e")) {
  637.                         System.out.println("You cannot go that way.");
  638.                         command = "";
  639.                     } else if (command.equals("quit")) {
  640.                         command = "quit";
  641.                         break;
  642.                     } else {
  643.                         System.out.println("Unrecognised command. Try again.");
  644.                         command = input.nextLine();
  645.                     }
  646.                 }
  647.                 //######################################################################
  648.             } else if (x == 10 && y == 9) {
  649.                 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.");
  650.                 System.out.println("Command?");
  651.                 command = input.nextLine();
  652.                 while (!command.equals("")) {
  653.                     if (command.equals("n")) {
  654.                         --y;
  655.                         command = "";
  656.                     } else if (command.equals("s")) {
  657.                         ++y;
  658.                         command = "";
  659.                     } else if (command.equals("w")) {
  660.                         System.out.println("Not yet implemented.");//--x;
  661.                         command = "";
  662.                     } else if (command.equals("e")) {
  663.                         System.out.println("You cannot go that way.");
  664.                         command = "";
  665.                     } else if (command.equals("quit")) {
  666.                         command = "quit";
  667.                         break;
  668.                     } else {
  669.                         System.out.println("Unrecognised command. Try again.");
  670.                         command = input.nextLine();
  671.                     }
  672.                 }              
  673.                 //#######################################################################
  674.             } else if (x == 10 && y == 10) {
  675.                 System.out.println(x + ", " + y + "\nYou are in the town centre.\nYou may go north, east, south, or west.");
  676.                 System.out.println("Command?");
  677.                 command = input.nextLine();
  678.                 while (!command.equals("")) {
  679.                     if (command.equals("n")) {
  680.                         --y;
  681.                         command = "";
  682.                     } else if (command.equals("s")) {
  683.                         System.out.println("You cannot go that way.");
  684.                         command = "";
  685.                     } else if (command.equals("w")) {
  686.                         System.out.println("You cannot go that way.");
  687.                         command = "";
  688.                     } else if (command.equals("e")) {
  689.                         System.out.println("You cannot go that way.");
  690.                         command = "";
  691.                     } else if (command.equals("quit")) {
  692.                         command = "quit";
  693.                         break;
  694.                     } else {
  695.                         System.out.println("Unrecognised command. Try again.");
  696.                         command = input.nextLine();
  697.                     }
  698.                 }
  699.             } else {
  700.                 System.out.println("TERMINATING: ERROR: 404.1: Coordinates Not Found");
  701.                 System.exit(0);
  702.             }  
  703.         }
  704.         if (area == 0) {
  705.             System.out.println("TERMINATING: QUIT");
  706.             System.exit(0);
  707.         }
  708.         while ((area != 0) || (area != 1) || (area != 2)) {
  709.             ////TEMPORARY STATEMENT CONCERNING INVALID AREAS
  710.             System.out.println("TERMINATING: ERROR: 404.0: Area Not Found");
  711.             System.exit(0);
  712.         }
  713.         System.out.println("TERMINATING: ERROR: 1: Improper lead to escape primary while loop");
  714.         System.exit(0);
  715.     }
  716. }
Add Comment
Please, Sign In to add comment