Skip to content

Instantly share code, notes, and snippets.

@Yur-ok
Created January 5, 2016 17:01
Show Gist options
  • Save Yur-ok/9f489ba0de913cf4bb9f to your computer and use it in GitHub Desktop.
Save Yur-ok/9f489ba0de913cf4bb9f to your computer and use it in GitHub Desktop.
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