Ejemplo n.º 1
0
 // Writes the Y coord based on user input
 // This method needs to be made so that it won't overwrite an Y coord that is already entered
 public void writeY() throws IOException {
   System.out.println("Type y coord, it can only be 3 numbers long.");
   Scanner userInputXLoc = new Scanner(System.in);
   yLoc = userInputXLoc.next();
   while (yLoc.length() != 3) {
     System.out.println("Please re-enter y coord.");
     yLoc = userInputXLoc.next();
   }
   writeFile(1, 1, yLoc);
   fout.close();
 }
Ejemplo n.º 2
0
 // Writes the X coord based on user input
 // This method needs to be made so that it won't overwrite an X coord that is already entered
 public void writeX() throws IOException {
   System.out.println("Type x coord, it can only be 3 numbers long.");
   Scanner userInputXLoc = new Scanner(System.in);
   xLoc = userInputXLoc.next();
   while (xLoc.length() != 3) {
     System.out.println("Please re-enter x coord.");
     xLoc = userInputXLoc.next();
   }
   System.out.println(xLoc);
   writeFile(0, 0, xLoc);
 }