Skip to content

Commit

Permalink
I made another puzzle and test case to check what would happen if the…
Browse files Browse the repository at this point in the history
… cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases.
  • Loading branch information
pitbull51067 committed Nov 7, 2023
1 parent 07422af commit fc08c8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public void CannotLightMiddleTest() throws InvalidFileFormatException {

@Test
public void CanLightTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/FullLightTest", lightUp);
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CanLightTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is a contradiction somewhere on the board
Assert.assertNull(RULE.checkContradiction(board));
Assert.assertNotNull(RULE.checkContradiction(board));

//confirm these are not required to be lit because they are already lit or unable to be
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 3)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<cell value="-1" x="1" y="1"/>
<cell value="-1" x="1" y="2"/>
<cell value="-1" x="2" y="3"/>
<cell value="-2" x="1" y="3"/>
<cell value="-3" x="1" y="3"/>
<cell value="-3" x="3" y="2"/>
<cell value="-3" x="3" y="3"/>
</cells>
Expand Down

0 comments on commit fc08c8a

Please sign in to comment.