fix : MultiDoku.getCells
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package sudoku.constraint;
|
||||
|
||||
import sudoku.structure.Cell;
|
||||
import sudoku.structure.Sudoku;
|
||||
|
||||
public class ColumnConstraint implements IConstraint {
|
||||
@@ -7,10 +8,12 @@ public class ColumnConstraint implements IConstraint {
|
||||
@Override
|
||||
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
|
||||
for (int i = 0; i < s.getSize(); i++) {
|
||||
if (s.getCell(x, i).getSymbolIndex() == newSymbolIndex)
|
||||
Cell cell = s.getCell(x, i);
|
||||
int symbol = cell.getSymbolIndex();
|
||||
if (symbol == newSymbolIndex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user