Skip to content

Commit

Permalink
Fixed checkStyle error "if construct must use {}'s"
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharybonagura committed Mar 30, 2024
1 parent 27f0d91 commit 6d43ce0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {

if(cell.getType() == BinaryType.ONE || cell.getType() == BinaryType.ZERO) {
for (int x = cell.getLocation().x - 2; x < cell.getLocation().x && x < width - 2; x++){
if (x < 0)
if (x < 0) {
continue;
}
if(binaryBoard.getCell(x, cellY).getType() == binaryBoard.getCell(x + 1, cellY).getType() &&
binaryBoard.getCell(x + 1, cellY).getType() == binaryBoard.getCell(x + 2, cellY).getType()) {
System.out.println("Contradiction Found because of " + binaryBoard.getCell(x, cellY).getLocation().x + " " + binaryBoard.getCell(x, cellY).getLocation().y + " " + + binaryBoard.getCell(x+1, cellY).getLocation().x + " " + binaryBoard.getCell(x+1, cellY).getLocation().y + " " + + binaryBoard.getCell(x+2, cellY).getLocation().x + " " + binaryBoard.getCell(x+2, cellY).getLocation().y);
Expand All @@ -40,8 +41,9 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
}

for (int y = cell.getLocation().y - 2; y < cell.getLocation().y && y < height - 2; y++){
if (y < 0)
if (y < 0) {
continue;
}
if(binaryBoard.getCell(cellX, y).getType() == binaryBoard.getCell(cellX, y + 1).getType() &&
binaryBoard.getCell(cellX, y + 1).getType() == binaryBoard.getCell(cellX, y + 2).getType()) {
System.out.println("Contradiction Found because of " + binaryBoard.getCell(cellX, y+2).getLocation().x + " " + binaryBoard.getCell(cellX, y).getLocation().y + " " + + binaryBoard.getCell(cellX, y+1).getLocation().x + " " + binaryBoard.getCell(cellX, y+1).getLocation().y + " " + + binaryBoard.getCell(cellX, y+2).getLocation().x + " " + binaryBoard.getCell(cellX, y+2).getLocation().y);
Expand Down

0 comments on commit 6d43ce0

Please sign in to comment.