Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public static void main(String[]args){
  2. Scanner k = new Scanner(System.in);
  3. String abc = "ABCDEFGHIJ";
  4. String ab = "abcdefghij";
  5. abc.equals(ab);
  6. System.out.println("Please enter the attack location:");
  7.  
  8. while (!k.hasNext("[A-J a-j]+[0-9]")) {
  9. System.out.println("Wrong");
  10. k.next();
  11. }
  12.  
  13. String location = k.next();
  14. char row = location.charAt(0);
  15. int num = (int) location.charAt(1);
  16. System.out.println(abc.charAt(row));
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement