我正在构建一个数独检查器,并且我已经制作了一个行检查器和一个列检查器。我目前正在尝试制作一个块检查器(3x3 块)。对此的任何见解都会很棒。
public boolean checkBlock (int col0to2, int row0to2)
{
int [] tempArray = new int [3];
for (int x=0; x<3; x++)
{
for (int y=0; y<3;y++)
{
if ((board [col0to2+x][row0to2+y]) > 0 && (board [col0to2+x][row0to2+y]) < 10)
{
int tempVal = board [col0to2+x][row0to2+y];
tempArray [tempVal - 1] = tempVal; // i think this line is giving me the run
// error
}
}
}
return true;
}