Skip to content

Commit

Permalink
Fixed Nurikabe Rules Printing Duplicate Error Messages (#526)
Browse files Browse the repository at this point in the history
* set test points to make sure the STT files are loaded in correctly

* testing transitions

* added a test case, BlockInVerticalPath for LightUp that tests there isn't a contradiction if there is a block between two bulbs.

* added a test case, CannontFillMiddle for LightUp that tests CannotLightACell Contradiction Rule

* removed unnecessary indent

* Added unit tests tor CannotLightACellContradictionRuleTest and TooFewBulbsContradictionRuleTest.

* Added test LightUp files for testing

* removed an unnecessary comment and spacing

* Added another set of tests for TooManyBulbsContradictionRule

* Added Randomly Generated 7x7 lightup puzzles

* prevented the same error message from being created numerous times when checking for direct rules.
  • Loading branch information
Acewvrs authored Apr 14, 2023
1 parent 83b8c14 commit bed593a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public NurikabeBoard(int size) {

@Override
public NurikabeCell getCell(int x, int y) {
if (y * dimension.width + x >= puzzleElements.size() || x >= dimension.width ||
y >= dimension.height || x < 0 || y < 0) {
return null;
}
return (NurikabeCell) super.getCell(x, y);
}

Expand Down

0 comments on commit bed593a

Please sign in to comment.