Created
March 8, 2016 11:19
-
-
Save Lokutus/d9bcd17586e60c04b001 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 static void printPosition(double cell) { | |
int row = (int) ((cell / 9) + 1); | |
int col = (int) ((cell % 9) + 1); | |
int group = (((int) Math.ceil(row / 3.0)) * 3) - (3 - ((int) Math.ceil(col / 3.0))); | |
System.out.println(cell + " : " + row + " : " + col + " : " + group); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment