Created
February 18, 2016 14:58
-
-
Save alexejVasko/3c1f536606808e73a8bc 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
package tanks; | |
public class printQuadrant { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
printCoordinates("a", "2"); | |
} | |
static String getQuadrant(String v, String h) { | |
String vert = "abcdefghi"; | |
String hor = "123456789"; | |
int quadrantSize = 64; | |
int x = hor.indexOf(h) * quadrantSize; | |
int y = vert.indexOf(v) * quadrantSize; | |
return y + ";" + x; | |
} | |
static void printCoordinates(String v, String h) { | |
System.out.println( v + h + ":(" + getQuadrant(v, h) + "px)"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Вы не должны были переделывать метод getQuadrant().
Вывод не соответствует заданию