Advertisement
Guest User

Boatloc.java

a guest
Apr 30th, 2011
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /**
  2. *
  3. * @author Damien Bell <SkyeShatter@gmail.com>
  4. */
  5. public class Boatloc {
  6. public static int[] BoatLoc (String location){
  7. int g = location.length();
  8. int z;
  9. int y = Character.toLowerCase(location.charAt(0))-97;
  10. if (g == 3){
  11. z = 9;
  12. }
  13. else{
  14. z= Character.toLowerCase(location.charAt(1))-49;
  15. }
  16. int[] x= {y,z};
  17. return x;
  18. }// End Boatloc method
  19.  
  20. public static String ReverseBoatLoc(int x , int y){
  21. x=x+97;
  22. y=y+49;
  23. char a= (char)x;
  24. char b= (char)y;
  25. String Reverse = Character.toString(a) + Character.toString(b);
  26.  
  27. return Reverse;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement