Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[]args){
- Scanner k = new Scanner(System.in);
- String abc = "ABCDEFGHIJ";
- String ab = "abcdefghij";
- abc.equals(ab);
- System.out.println("Please enter the attack location:");
- while (!k.hasNext("[A-J a-j]+[0-9]")) {
- System.out.println("Wrong");
- k.next();
- }
- String location = k.next();
- char row = location.charAt(0);
- int num = (int) location.charAt(1);
- System.out.println(abc.charAt(row));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement