Created
January 5, 2016 17:01
-
-
Save Yur-ok/9f489ba0de913cf4bb9f 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 Lesson3.KeyPoint4; | |
/** | |
* Created by Юрий on 05.01.2016. | |
*/ | |
public class StringGetQuadrant { | |
public static void main(String[] args) { | |
System.out.println(getQuadrant(0, 60)); | |
System.out.println(getQuadrant(0, 64)); | |
System.out.println(getQuadrant(68, 96)); | |
} | |
static String getQuadrant(int x, int y) { | |
double step = 64; | |
double xx = x / step; | |
double yy = y / step; | |
return ((int) yy) + "_" + ((int) xx); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment