Created
October 23, 2015 19:37
-
-
Save edinak1/4b42ef0107900e849157 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 metod; | |
| public class Coordinats { | |
| public static void main(String[] args) { | |
| printCoordinats("a","1"); | |
| printCoordinats("c","2"); | |
| printCoordinats("i","9"); | |
| printCoordinats("e","5"); | |
| printCoordinats("g","3"); | |
| } | |
| static void printCoordinats(String v,String g) | |
| { | |
| String str=getQuadrant(v,g); | |
| String coordinats=v+g+":("+str.substring(0,str.indexOf("_"))+"px; "+str.substring(str.indexOf("_")+1)+"px)"; | |
| System.out.println(coordinats); | |
| } | |
| static String getQuadrant(String v,String g) | |
| { | |
| String vertical="abcdefghi"; | |
| String gorizont="123456789"; | |
| String quadrant=String.valueOf(64*vertical.indexOf(v))+"_"+String.valueOf(64*gorizont.indexOf(g)); | |
| return quadrant; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment