Page 890 - 2
P. 890
try {
for (int i = y + 1, z = x - 1; i > y - 4; i--, z++) {
if (map[y][x] != map[i][z])
return false;
}
} catch (ArrayIndexOutOfBoundsException e) {
return false;
}
return true;
}
public boolean winCheckOneLU(int x, int y) { // 한칸 왼쪽 위 대각선
try {
for (int i = y + 1, z = x + 1; i > y - 4; i--, z--) {
if (map[y][x] != map[i][z])
return false;
}
} catch (ArrayIndexOutOfBoundsException e) {
return false;
}
return true;
}
public boolean winCheckOneR(int x, int y) { // 한칸 오른쪽
try {
for (int z = x - 1; z < x + 4; z++) {
if (map[y][x] != map[y][z])
return false;
}
} catch (ArrayIndexOutOfBoundsException e) {
return false;
}
return true;
}
public boolean winCheckOneL(int x, int y) { // 한칸 왼쪽
try {
for (int z = x + 1; z > x - 4; z--) {
if (map[y][x] != map[y][z])
return false;
}
} catch (ArrayIndexOutOfBoundsException e) {
return false;
}
return true;
- 890 -