数独回溯法
int xx = (pos.getX() / 3) * 3;
int yy = (pos.getY() / 3) * 3;
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
if ((xx + x != pos.getX()) && (yy + y != pos.getY())) {
possible[work[xx + x][yy + y]] = false;
其中 x 和 y =
private byte x;
private byte y;
有人可以解释为什么我们除以三并乘以三吗?
(pos.getY() / 3) * 3;
(pos.getX() / 3) * 3;