Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author Damien Bell <SkyeShatter@gmail.com>
- */
- public class Boatloc {
- public static int[] BoatLoc (String location){
- int g = location.length();
- int z;
- int y = Character.toLowerCase(location.charAt(0))-97;
- if (g == 3){
- z = 9;
- }
- else{
- z= Character.toLowerCase(location.charAt(1))-49;
- }
- int[] x= {y,z};
- return x;
- }// End Boatloc method
- public static String ReverseBoatLoc(int x , int y){
- x=x+97;
- y=y+49;
- char a= (char)x;
- char b= (char)y;
- String Reverse = Character.toString(a) + Character.toString(b);
- return Reverse;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement