This commit is contained in:
@@ -7,7 +7,7 @@ public class ColumnConstraint implements IConstraint {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
|
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
|
||||||
for (int i = 0; i < s.getSize(); i++) {
|
for (int i = 0; i < s.getSize(); i++) {
|
||||||
if (s.getCell(x, newSymbolIndex).getSymbolIndex() == newSymbolIndex)
|
if (s.getCell(x, i).getSymbolIndex() == newSymbolIndex)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class LineConstraint implements IConstraint {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
|
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
|
||||||
for (int i = 0; i < s.getSize(); i++) {
|
for (int i = 0; i < s.getSize(); i++) {
|
||||||
if (s.getCell(newSymbolIndex, y).getSymbolIndex() == newSymbolIndex)
|
if (s.getCell(i, y).getSymbolIndex() == newSymbolIndex)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user