Created
November 17, 2015 00:57
-
-
Save e-tverdokhleb/3e4b20fcebd5564f49b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
printCoordinates("b", "3"); | |
} | |
/** | |
* -=TANKS=- | |
*/ | |
static String getQuadrant(String v, String h) { | |
String str_v = "abcdefghi"; | |
return (Integer.valueOf(h) * 64) + "_" + (str_v.indexOf(v) + 1) * 64; | |
} | |
static void printCoordinates(String v, String h) { | |
String coords = getQuadrant(v, h); | |
String a = coords.substring(0, coords.indexOf("_")); | |
String b = coords.substring(coords.indexOf("_") + 1); | |
System.out.println(v + h + ":(" + a + "px; " + b + "px" + ")"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment