Skip to content

Commit

Permalink
Created EliminateTheImpossible direct rule
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharybonagura committed Jun 14, 2024
1 parent 62b7811 commit ee22ec0
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package edu.rpi.legup.puzzle.binary.rules;


import edu.rpi.legup.model.gameboard.Board;
import edu.rpi.legup.model.gameboard.PuzzleElement;
import edu.rpi.legup.model.rules.DirectRule;
import edu.rpi.legup.model.tree.TreeNode;
import edu.rpi.legup.model.tree.TreeTransition;
import edu.rpi.legup.puzzle.binary.BinaryBoard;
import edu.rpi.legup.puzzle.binary.BinaryCell;

public class EliminateTheImpossible extends DirectRule {
private final String INVALID_USE_MESSAGE = "Number at cell is incorrect";

public EliminateTheImpossible() {
super(
"BINA-BASC-0003",
"Eliminate The Impossible",
"If three adjacent empty cells are open, prevents a trio of numbers to exist",
"edu/rpi/legup/images/binary/rules/OneTileGapDirectRule.png");
}

@Override
public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
BinaryBoard origBoard = (BinaryBoard) transition.getParents().get(0).getBoard();
BinaryCell binaryCell = (BinaryCell) puzzleElement;

return "Grouping of Three Ones or Zeros not found";
}

@Override
public Board getDefaultBoard(TreeNode node) {
return null;
}
}

0 comments on commit ee22ec0

Please sign in to comment.