From 76660a3528d8ec5dd7072dd0816f28e01c07d021 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:24:26 -0500 Subject: [PATCH 01/36] Refactoring and bug fixes Refactored Case Rules to match wiki description and fixed bug that only checked regions and not all group types. --- .../legup/puzzle/sudoku/PossibleNumberCaseBoard.java | 4 ++-- ...le.java => NoCellForNumberContradictionRule.java} | 6 +++--- ...Rule.java => PossibleCellsForNumberCaseRule.java} | 8 ++++---- ...Rule.java => PossibleNumbersForCellCaseRule.java} | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{NoSolutionContradictionRule.java => NoCellForNumberContradictionRule.java} (91%) rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{PossibleNumberCaseRule.java => PossibleCellsForNumberCaseRule.java} (94%) rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{PossibleCellCaseRule.java => PossibleNumbersForCellCaseRule.java} (90%) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java index 8af2aca2e..871b5392b 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java @@ -2,7 +2,7 @@ import edu.rpi.legup.model.gameboard.CaseBoard; import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.puzzle.sudoku.rules.PossibleNumberCaseRule; +import edu.rpi.legup.puzzle.sudoku.rules.PossibleCellsForNumberCaseRule; import java.awt.event.MouseEvent; import java.util.HashSet; @@ -16,7 +16,7 @@ public class PossibleNumberCaseBoard extends CaseBoard { private Set pickableCols; - public PossibleNumberCaseBoard(SudokuBoard baseBoard, PossibleNumberCaseRule caseRule, SudokuCell cell) { + public PossibleNumberCaseBoard(SudokuBoard baseBoard, PossibleCellsForNumberCaseRule caseRule, SudokuCell cell) { super(baseBoard, caseRule); this.cell = cell; this.pickableRegions = new HashSet<>(); diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoSolutionContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java similarity index 91% rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoSolutionContradictionRule.java rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java index fb87764fe..a308e1dfc 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoSolutionContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java @@ -9,10 +9,10 @@ import java.util.HashSet; import java.util.Set; -public class NoSolutionContradictionRule extends ContradictionRule { +public class NoCellForNumberContradictionRule extends ContradictionRule { - public NoSolutionContradictionRule() { - super("SUDO-CONT-0001", "No Solution for Cell", + public NoCellForNumberContradictionRule() { + super("SUDO-CONT-0001", "No Cell for Number", "Process of elimination yields no valid numbers for an empty cell.", "edu/rpi/legup/images/sudoku/NoSolution.png"); } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumberCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberCaseRule.java similarity index 94% rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumberCaseRule.java rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberCaseRule.java index 27d6b58b7..9fc047ff4 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumberCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberCaseRule.java @@ -14,12 +14,12 @@ import java.util.List; import java.util.Set; -public class PossibleNumberCaseRule extends CaseRule { +public class PossibleCellsForNumberCaseRule extends CaseRule { - public PossibleNumberCaseRule() { - super("SUDO-CASE-0002", "Possible Numbers for Cell", + public PossibleCellsForNumberCaseRule() { + super("SUDO-CASE-0002", "Possible Cells for Number", "An empty cell has a limited set of possible numbers that can fill it.", - "edu/rpi/legup/images/sudoku/PossibleValues.png"); + "edu/rpi/legup/images/sudoku/possible_cells_number.png"); } /** diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java similarity index 90% rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellCaseRule.java rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java index 373b60457..7f00eff55 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java @@ -12,11 +12,11 @@ import java.util.HashSet; import java.util.Set; -public class PossibleCellCaseRule extends CaseRule { - public PossibleCellCaseRule() { - super("SUDO-CASE-0001", "Possible Cells for Number", +public class PossibleNumbersForCellCaseRule extends CaseRule { + public PossibleNumbersForCellCaseRule() { + super("SUDO-CASE-0001", "Possible Numbers for Cell", "A number has a limited set of cells in which it can be placed.", - "edu/rpi/legup/images/sudoku/possible_cells_number.png"); + "edu/rpi/legup/images/sudoku/PossibleValues.png"); } /** @@ -82,14 +82,14 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement) { } int rowNum = cell.getLocation().y; - for (SudokuCell c : sudokuBoard.getRegion(rowNum)) { + for (SudokuCell c : sudokuBoard.getRow(rowNum)) { if (c.getData().equals(c.getData())) { possibleValue.remove(c.getData()); } } int colNum = cell.getLocation().x; - for (SudokuCell c : sudokuBoard.getRegion(colNum)) { + for (SudokuCell c : sudokuBoard.getCol(colNum)) { if (c.getData().equals(c.getData())) { possibleValue.remove(c.getData()); } From 104f4464bdca0616d0b829966deea48705f20163 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:16:42 -0500 Subject: [PATCH 02/36] Refactoring Possible Numbers for Cell Trying again since there was a merge issue last time. --- .../rules/PossibleNumbersForCellCaseRule.java | 59 ++++++++----------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java index 7f00eff55..72a5f5bfe 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java @@ -5,17 +5,20 @@ import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.model.rules.CaseRule; import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.sudoku.GroupType; +import edu.rpi.legup.puzzle.sudoku.PossibleNumberCaseBoard; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; import java.util.ArrayList; -import java.util.HashSet; +import java.util.List; import java.util.Set; public class PossibleNumbersForCellCaseRule extends CaseRule { + public PossibleNumbersForCellCaseRule() { super("SUDO-CASE-0001", "Possible Numbers for Cell", - "A number has a limited set of cells in which it can be placed.", + "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/PossibleValues.png"); } @@ -55,7 +58,6 @@ public CaseBoard getCaseBoard(Board board) { } return caseBoard; } - /** * Gets the possible cases at a specific location based on this case rule * @@ -65,42 +67,29 @@ public CaseBoard getCaseBoard(Board board) { */ @Override public ArrayList getCases(Board board, PuzzleElement puzzleElement) { + return getCases(board, puzzleElement, 1, GroupType.REGION); + } + + /** + * Gets the possible cases at a specific location based on this case rule + * + * @param board the current board state + * @param puzzleElement equivalent puzzleElement + * @param value value that the rule will be applied from + * @param groupType group type + * @return a list of elements the specified could be + */ + public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { ArrayList cases = new ArrayList<>(); SudokuBoard sudokuBoard = (SudokuBoard) board; + List caseCells = new ArrayList<>(); SudokuCell cell = (SudokuCell) puzzleElement; - Set possibleValue = new HashSet<>(); - for (int i = 1; i <= sudokuBoard.getSize(); i++) { - possibleValue.add(i); - } - - int groupNum = cell.getGroupIndex(); - for (SudokuCell c : sudokuBoard.getRegion(groupNum)) { - if (c.getData().equals(c.getData())) { - possibleValue.remove(c.getData()); - } - } - - int rowNum = cell.getLocation().y; - for (SudokuCell c : sudokuBoard.getRow(rowNum)) { - if (c.getData().equals(c.getData())) { - possibleValue.remove(c.getData()); - } - } - - int colNum = cell.getLocation().x; - for (SudokuCell c : sudokuBoard.getCol(colNum)) { - if (c.getData().equals(c.getData())) { - possibleValue.remove(c.getData()); - } - } - - for (Integer i : possibleValue) { - SudokuBoard newCase = sudokuBoard.copy(); - - PuzzleElement newCasePuzzleElement = newCase.getPuzzleElement(puzzleElement); - newCasePuzzleElement.setData(i); - newCase.addModifiedData(newCasePuzzleElement); + for (int i = 0; i < 9; i++) { + Board newCase = sudokuBoard.copy(); + PuzzleElement element = newCase.getPuzzleElement(puzzleElement); + element.setData(value); + newCase.addModifiedData(element); cases.add(newCase); } From d5280c438d33228fda65ec928f9f64037d17e587 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:57:16 -0500 Subject: [PATCH 03/36] PossibleCellsForNumber Region Based Implementation Updated PossibleCellsForNumber to display number values when case board is clicked and generate proper case boards based off number chosen and local region. --- .../legup/puzzle/sudoku/ModelSudokuBoard.java | 17 ++++ .../sudoku/PossibleNumberCaseBoard.java | 4 +- ...PossibleCellsForNumberRegionCaseRule.java} | 78 ++++++------------- .../rules/PossibleNumbersForCellCaseRule.java | 5 +- 4 files changed, 44 insertions(+), 60 deletions(-) create mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/ModelSudokuBoard.java rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{PossibleCellsForNumberCaseRule.java => PossibleCellsForNumberRegionCaseRule.java} (54%) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/ModelSudokuBoard.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/ModelSudokuBoard.java new file mode 100644 index 000000000..f7893ca32 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/ModelSudokuBoard.java @@ -0,0 +1,17 @@ +package edu.rpi.legup.puzzle.sudoku; + +public class ModelSudokuBoard { + public int getModelRegionNumbers(int index) { + int columnMod = index % 3 + 1; + int rowMod = ((index / 9) % 3) * 3; + return columnMod + rowMod; + } + + public int getModelRowNumbers(int index) { + return index % 9 + 1; + } + + public int getModelColumnNumbers(int index) { + return index / 9 + 1; + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java index 871b5392b..8bf3e26bf 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java @@ -2,7 +2,7 @@ import edu.rpi.legup.model.gameboard.CaseBoard; import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.puzzle.sudoku.rules.PossibleCellsForNumberCaseRule; +import edu.rpi.legup.puzzle.sudoku.rules.PossibleCellsForNumberRegionCaseRule; import java.awt.event.MouseEvent; import java.util.HashSet; @@ -16,7 +16,7 @@ public class PossibleNumberCaseBoard extends CaseBoard { private Set pickableCols; - public PossibleNumberCaseBoard(SudokuBoard baseBoard, PossibleCellsForNumberCaseRule caseRule, SudokuCell cell) { + public PossibleNumberCaseBoard(SudokuBoard baseBoard, PossibleCellsForNumberRegionCaseRule caseRule, SudokuCell cell) { super(baseBoard, caseRule); this.cell = cell; this.pickableRegions = new HashSet<>(); diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java similarity index 54% rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberCaseRule.java rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java index 9fc047ff4..3cdb954b7 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java @@ -5,18 +5,19 @@ import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.model.rules.CaseRule; import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.sudoku.GroupType; -import edu.rpi.legup.puzzle.sudoku.PossibleNumberCaseBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import edu.rpi.legup.puzzle.sudoku.*; import java.util.ArrayList; -import java.util.List; import java.util.Set; -public class PossibleCellsForNumberCaseRule extends CaseRule { +public class PossibleCellsForNumberRegionCaseRule extends CaseRule { - public PossibleCellsForNumberCaseRule() { + //Board math for translating indexes to numbers + private ModelSudokuBoard model = new ModelSudokuBoard(); + + //Old board for caseBoard reference + private SudokuBoard lagBoard; + public PossibleCellsForNumberRegionCaseRule() { super("SUDO-CASE-0002", "Possible Cells for Number", "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/possible_cells_number.png"); @@ -49,12 +50,12 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem @Override public CaseBoard getCaseBoard(Board board) { - SudokuBoard sudokuBoard = (SudokuBoard) board; - PossibleNumberCaseBoard caseBoard = new PossibleNumberCaseBoard(sudokuBoard, this, null); - for (int i = 0; i < sudokuBoard.getSize(); i++) { - caseBoard.addPickableRegion(i); - caseBoard.addPickableRow(i); - caseBoard.addPickableCol(i); + SudokuBoard sudokuBoard = (SudokuBoard) board.copy(); + lagBoard = (SudokuBoard) sudokuBoard.copy(); + CaseBoard caseBoard = new CaseBoard(sudokuBoard, this); + for (PuzzleElement puzzleElement : sudokuBoard.getPuzzleElements()) { + puzzleElement.setData(model.getModelRegionNumbers(puzzleElement.getIndex())); + caseBoard.addPickableElement(puzzleElement); } return caseBoard; } @@ -82,50 +83,19 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement) { */ public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { ArrayList cases = new ArrayList<>(); - SudokuBoard sudokuBoard = (SudokuBoard) board; - List caseCells = new ArrayList<>(); - SudokuCell cell = (SudokuCell) puzzleElement; - - Set group; - if (groupType == GroupType.REGION) { - group = sudokuBoard.getRegion(cell.getGroupIndex()); - } - else { - if (groupType == GroupType.ROW) { - group = sudokuBoard.getRow(cell.getLocation().y); - } - else { - group = sudokuBoard.getCol(cell.getLocation().x); - } - } - - for (SudokuCell c : group) { - if (c.getData() == 0) { - Set blockableCells = sudokuBoard.getRegion(c.getGroupIndex()); - blockableCells.addAll(sudokuBoard.getRow(c.getLocation().y)); - blockableCells.addAll(sudokuBoard.getCol(c.getLocation().x)); + SudokuBoard sudokuBoard = lagBoard; + SudokuCell sourceCell = (SudokuCell) puzzleElement; - boolean repeat = false; - for (SudokuCell bc : blockableCells) { - if (bc.getData() == value) { - repeat = true; - break; - } - } - if (!repeat) { - caseCells.add(c); - } + Set group = sudokuBoard.getRegion(sourceCell.getGroupIndex()); + for (SudokuCell cell : group){ + if(cell.getData() == 0){ + Board newCase = sudokuBoard.copy(); + PuzzleElement element = newCase.getPuzzleElement(cell); + element.setData(model.getModelRegionNumbers(sourceCell.getIndex())); + newCase.addModifiedData(element); + cases.add(newCase); } } - - for (SudokuCell c : caseCells) { - Board newCase = sudokuBoard.copy(); - PuzzleElement element = newCase.getPuzzleElement(c); - element.setData(value); - newCase.addModifiedData(element); - cases.add(newCase); - } - return cases; } } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java index 72a5f5bfe..f355695ac 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java @@ -5,10 +5,7 @@ import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.model.rules.CaseRule; import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.sudoku.GroupType; -import edu.rpi.legup.puzzle.sudoku.PossibleNumberCaseBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import edu.rpi.legup.puzzle.sudoku.*; import java.util.ArrayList; import java.util.List; From cb667f893d64c4883e107ef8c659eadb3d3a0c9b Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:22:13 -0400 Subject: [PATCH 04/36] Added two new versions of the Possible Cell For Number case rule Added and bug tested two alternate versions of the region based Possible Cells For Number case rule. --- .../PossibleCellsForNumberColumnCaseRule.java | 104 ++++++++++++++++++ .../PossibleCellsForNumberRegionCaseRule.java | 2 +- .../PossibleCellsForNumberRowCaseRule.java | 104 ++++++++++++++++++ 3 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java create mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java new file mode 100644 index 000000000..22f768313 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java @@ -0,0 +1,104 @@ +package edu.rpi.legup.puzzle.sudoku.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.CaseBoard; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.CaseRule; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.sudoku.GroupType; +import edu.rpi.legup.puzzle.sudoku.ModelSudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; + +import java.util.ArrayList; +import java.util.Set; + +public class PossibleCellsForNumberColumnCaseRule extends CaseRule { + + //Board math for translating indexes to numbers + private ModelSudokuBoard model = new ModelSudokuBoard(); + + //Old board for caseBoard reference + private SudokuBoard lagBoard; + public PossibleCellsForNumberColumnCaseRule() { + super("SUDO-CASE-0004", "Possible Cells for Number - Column", + "An empty cell has a limited set of possible numbers that can fill it.", + "edu/rpi/legup/images/sudoku/possible_cells_number.png"); + } + + /** + * Checks whether the transition logically follows from the parent node using this rule + * + * @param transition transition to check + * @return null if the child node logically follow from the parent node, otherwise error message + */ + @Override + public String checkRuleRaw(TreeTransition transition) { + return null; + } + + /** + * Checks whether the child node logically follows from the parent node + * at the specific puzzleElement index using this rule + * + * @param transition transition to check + * @param puzzleElement equivalent puzzleElement + * @return null if the child node logically follow from the parent node at the specified puzzleElement, + * otherwise error message + */ + @Override + public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { + return null; + } + + @Override + public CaseBoard getCaseBoard(Board board) { + SudokuBoard sudokuBoard = (SudokuBoard) board.copy(); + lagBoard = (SudokuBoard) sudokuBoard.copy(); + CaseBoard caseBoard = new CaseBoard(sudokuBoard, this); + for (PuzzleElement puzzleElement : sudokuBoard.getPuzzleElements()) { + puzzleElement.setData(model.getModelColumnNumbers(puzzleElement.getIndex())); + caseBoard.addPickableElement(puzzleElement); + } + return caseBoard; + } + + /** + * Gets the possible cases at a specific location based on this case rule + * + * @param board the current board state + * @param puzzleElement equivalent puzzleElement + * @return a list of elements the specified could be + */ + @Override + public ArrayList getCases(Board board, PuzzleElement puzzleElement) { + return getCases(board, puzzleElement, 1, GroupType.COLUMN); + } + + /** + * Gets the possible cases at a specific location based on this case rule + * + * @param board the current board state + * @param puzzleElement equivalent puzzleElement + * @param value value that the rule will be applied from + * @param groupType group type + * @return a list of elements the specified could be + */ + public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { + ArrayList cases = new ArrayList<>(); + SudokuBoard sudokuBoard = lagBoard; + SudokuCell sourceCell = (SudokuCell) puzzleElement; + + Set group = sudokuBoard.getCol(sourceCell.getLocation().x); + for (SudokuCell cell : group){ + if(cell.getData() == 0){ + Board newCase = sudokuBoard.copy(); + PuzzleElement element = newCase.getPuzzleElement(cell); + element.setData(model.getModelColumnNumbers(sourceCell.getIndex())); + newCase.addModifiedData(element); + cases.add(newCase); + } + } + return cases; + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java index 3cdb954b7..62bc9a74d 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java @@ -18,7 +18,7 @@ public class PossibleCellsForNumberRegionCaseRule extends CaseRule { //Old board for caseBoard reference private SudokuBoard lagBoard; public PossibleCellsForNumberRegionCaseRule() { - super("SUDO-CASE-0002", "Possible Cells for Number", + super("SUDO-CASE-0002", "Possible Cells for Number - Region", "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/possible_cells_number.png"); } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java new file mode 100644 index 000000000..5da0158a6 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java @@ -0,0 +1,104 @@ +package edu.rpi.legup.puzzle.sudoku.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.CaseBoard; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.CaseRule; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.sudoku.GroupType; +import edu.rpi.legup.puzzle.sudoku.ModelSudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; + +import java.util.ArrayList; +import java.util.Set; + +public class PossibleCellsForNumberRowCaseRule extends CaseRule { + + //Board math for translating indexes to numbers + private ModelSudokuBoard model = new ModelSudokuBoard(); + + //Old board for caseBoard reference + private SudokuBoard lagBoard; + public PossibleCellsForNumberRowCaseRule() { + super("SUDO-CASE-0003", "Possible Cells for Number - Row", + "An empty cell has a limited set of possible numbers that can fill it.", + "edu/rpi/legup/images/sudoku/possible_cells_number.png"); + } + + /** + * Checks whether the transition logically follows from the parent node using this rule + * + * @param transition transition to check + * @return null if the child node logically follow from the parent node, otherwise error message + */ + @Override + public String checkRuleRaw(TreeTransition transition) { + return null; + } + + /** + * Checks whether the child node logically follows from the parent node + * at the specific puzzleElement index using this rule + * + * @param transition transition to check + * @param puzzleElement equivalent puzzleElement + * @return null if the child node logically follow from the parent node at the specified puzzleElement, + * otherwise error message + */ + @Override + public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { + return null; + } + + @Override + public CaseBoard getCaseBoard(Board board) { + SudokuBoard sudokuBoard = (SudokuBoard) board.copy(); + lagBoard = (SudokuBoard) sudokuBoard.copy(); + CaseBoard caseBoard = new CaseBoard(sudokuBoard, this); + for (PuzzleElement puzzleElement : sudokuBoard.getPuzzleElements()) { + puzzleElement.setData(model.getModelRowNumbers(puzzleElement.getIndex())); + caseBoard.addPickableElement(puzzleElement); + } + return caseBoard; + } + + /** + * Gets the possible cases at a specific location based on this case rule + * + * @param board the current board state + * @param puzzleElement equivalent puzzleElement + * @return a list of elements the specified could be + */ + @Override + public ArrayList getCases(Board board, PuzzleElement puzzleElement) { + return getCases(board, puzzleElement, 1, GroupType.ROW); + } + + /** + * Gets the possible cases at a specific location based on this case rule + * + * @param board the current board state + * @param puzzleElement equivalent puzzleElement + * @param value value that the rule will be applied from + * @param groupType group type + * @return a list of elements the specified could be + */ + public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { + ArrayList cases = new ArrayList<>(); + SudokuBoard sudokuBoard = lagBoard; + SudokuCell sourceCell = (SudokuCell) puzzleElement; + + Set group = sudokuBoard.getRow(sourceCell.getLocation().y); + for (SudokuCell cell : group){ + if(cell.getData() == 0){ + Board newCase = sudokuBoard.copy(); + PuzzleElement element = newCase.getPuzzleElement(cell); + element.setData(model.getModelRowNumbers(sourceCell.getIndex())); + newCase.addModifiedData(element); + cases.add(newCase); + } + } + return cases; + } +} From c4c8a506c8a5dc4c34c0d3744532cfab4e38fc19 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:26:30 -0400 Subject: [PATCH 05/36] Added new images to represent case rules Created and applied formatted images to case rules to help better show how case rule functions. --- .../PossibleCellsForNumberColumnCaseRule.java | 2 +- .../PossibleCellsForNumberRegionCaseRule.java | 2 +- .../rules/PossibleCellsForNumberRowCaseRule.java | 2 +- .../sudoku/possible_cells_number_column.png | Bin 0 -> 3336 bytes .../sudoku/possible_cells_number_region.png | Bin 0 -> 3623 bytes .../images/sudoku/possible_cells_number_row.png | Bin 0 -> 803 bytes 6 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_column.png create mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_region.png create mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_row.png diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java index 22f768313..b6ea1be21 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java @@ -23,7 +23,7 @@ public class PossibleCellsForNumberColumnCaseRule extends CaseRule { public PossibleCellsForNumberColumnCaseRule() { super("SUDO-CASE-0004", "Possible Cells for Number - Column", "An empty cell has a limited set of possible numbers that can fill it.", - "edu/rpi/legup/images/sudoku/possible_cells_number.png"); + "edu/rpi/legup/images/sudoku/possible_cells_number_column.png"); } /** diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java index 62bc9a74d..f12a9fb0b 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java @@ -20,7 +20,7 @@ public class PossibleCellsForNumberRegionCaseRule extends CaseRule { public PossibleCellsForNumberRegionCaseRule() { super("SUDO-CASE-0002", "Possible Cells for Number - Region", "An empty cell has a limited set of possible numbers that can fill it.", - "edu/rpi/legup/images/sudoku/possible_cells_number.png"); + "edu/rpi/legup/images/sudoku/possible_cells_number_region.png"); } /** diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java index 5da0158a6..6d434ed5a 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java @@ -23,7 +23,7 @@ public class PossibleCellsForNumberRowCaseRule extends CaseRule { public PossibleCellsForNumberRowCaseRule() { super("SUDO-CASE-0003", "Possible Cells for Number - Row", "An empty cell has a limited set of possible numbers that can fill it.", - "edu/rpi/legup/images/sudoku/possible_cells_number.png"); + "edu/rpi/legup/images/sudoku/possible_cells_number_row.png"); } /** diff --git a/src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_column.png b/src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_column.png new file mode 100644 index 0000000000000000000000000000000000000000..2ebdc582364e4afc93c26d2e41548abf30456ed8 GIT binary patch literal 3336 zcmV+j4fpbiP)uJ@VVD_U zC<6{NG_fI~0ue<-1QkJoA_k0xBC#Thg@9ne9*`iQ#9$OrQF$}6R&?d%y_c8YA7_1Q zpS|}zXYYO1x&V;8{kgn!SPFnNo`4_X z6{c}T{8k*B#$jdxfFg<9uYy1K45IaYvHg`_dOZM)Sy63ve6hvv1)yUy0P^?0*fb9UASvow z`@mQCp^4`uNg&9uGcn1|&Nk+9SjOUl{-OWr@Hh0;_l(8q{wNRKos+;6rV8ldy0Owz z(}jF`W(JeRp&R{qi2rfmU!TJ;gp(Kmm5I1s5m_f-n#TRsj}B0%?E` zvOzxB2#P=n*a3EfYETOrKoe*ICqM@{4K9Go;5xVgZi5G41dM~{UdP z6d+Yd3o?MrAqM0Kc|iV92owdyL5UC#5<>aVCa44|hpM4Es0sQWIt5*Tu0n&*J!lk~ zf_{hI!w5`*sjxDv4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?bBYuZ1HB*=n&^ zY&IKX3=z4%c!0pyhUtGdT~?{yRL~)UR9H-`*o(R+x;6w*u>e#o02K>h=%)_SsUT6* zSpXV2I!%A%NHi5B+PLT|l-#inLx7$FFPaL{$k9|#u>e#o02K>B#RA|gcSKV`V~!lb z&JulB%#bglVe|z%OEeWE+PLH9{SEJfzE2%QcdjHF_fdaZ1^$w+Du~Wjo=nJD{_69^ zipy3(8k~f)vRP(~@t2-?H;l_xL{wE(_db}-GN_kH#3T<*-(+87=hM>|8ux@>vx29B z25X!Ra~O(#^W(G?@x&5J1r5+Rqn9R=m^y?)#R5>V08}gh6$_x}ZYY`x(#X+Nc;c+) t|HTT9Xye1|bR_!EAkRmKA%Kbn@DCNWfTqQ8=qvyL002ovPDHLkV1lHZ0J;DG literal 0 HcmV?d00001 diff --git a/src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_row.png b/src/main/resources/edu/rpi/legup/images/sudoku/possible_cells_number_row.png new file mode 100644 index 0000000000000000000000000000000000000000..80476a42820b213907af74ce76c96424a103b862 GIT binary patch literal 803 zcmeAS@N?(olHy`uVBq!ia0vp^DImV7lw+;uumf z=j~kEJgGntH+%OuhDZmoi4$WaPKH{U2a1`9YM){XaxLQWP7#cBh~o10Yjx^4&V1(k zgF7F~r6xG|Pp|$`SMmATxvRel|E_6xcy}o?$A2M310@!>mIECE5`s+1P6;j?JsgdN zw%=OcEwgr)$?y95xaz~^K*eOs8M+I!;Hlq$@iDW2kKmOj`3V_dO{b+#AWK6n|M}E5P11zN!Ub1 zQDG(7`FFgGmNYpnIXpSWw=E>3!(`r@E~6!foR&OX5l0AR_{`y}D+-{TV;{Rs_-QDFn=lPnv+ACit z!nbeZxLN<9^S7hMx>wh9 zAAtmTB6ZEb%@OrHzlqUu({e(~Cm3Z<`mh=YLWD)Q!J) z)xH;a(o@{Mde_#{sZak*T)QfI`wPiQ>+9C1p2+&De0NLN<;c6cPW~6@toGdMI_KQ0 zYhsGeJ@zH<$P!J@+JAlqIK=yAIqMa&z7<(@>qN^^MF)8F(Ut f1vEJ2J?7VB=2_pOylEaV)iZdy`njxgN@xNAzyM-G literal 0 HcmV?d00001 From 439f7a547bdcab35f386f2a9539ed2bab5c19088 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:27:14 -0400 Subject: [PATCH 06/36] Fixed Last Cell for Number Direct Rule Last Cell for Number Direct Rule was almost completely re-written to improve functionality and minimize playing errors. --- .../rules/LastCellForNumberDirectRule.java | 125 ++++++++++++++---- 1 file changed, 102 insertions(+), 23 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java index 51d963247..ad393ee42 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java @@ -31,52 +31,131 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); SudokuCell cell = (SudokuCell) finalBoard.getPuzzleElement(puzzleElement); + + //Check if empty cell placed if (cell.getData() == 0) { return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; } - int size = initialBoard.getSize(); - + //Get defaults Set region = initialBoard.getRegion(cell.getGroupIndex()); Set row = initialBoard.getRow(cell.getLocation().y); Set col = initialBoard.getCol(cell.getLocation().x); - boolean contains = false; - if (region.size() == size - 1) { - for (SudokuCell c : region) { - if (cell.getData() == c.getData()) { + //Check if new cell conflicts group + for(SudokuCell c : region){ + if(c.getData() == cell.getData()) + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + for(SudokuCell c : row){ + if(c.getData() == cell.getData()) + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + for(SudokuCell c : col){ + if(c.getData() == cell.getData()) + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + + //// + //Loop to see if the number is constrained to the cell + boolean restrained = true; + for(SudokuCell c : region){ + //Test if its not a valid testing cell + if(c.getData() != 0) + continue; + if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) + continue; + //Check if cell is eligible to hold number + Set crow = initialBoard.getRow(c.getLocation().y); + Set ccol = initialBoard.getCol(c.getLocation().x); + boolean contains = false; + for(SudokuCell rc : crow){ + if(rc.getData() == cell.getData()) { + contains = true; + } + } + for(SudokuCell cc : ccol){ + if(cc.getData() == cell.getData()) { contains = true; - break; } } - if (!contains) { - return null; + //Stop if another cell can hold number + if(!contains) { + restrained = false; + break; } } - if (row.size() == size - 1) { - contains = false; - for (SudokuCell c : row) { - if (cell.getData() == c.getData()) { + //Output if success + if(restrained) + return null; + + //// + //Loop to see if the number is constrained to the cell + restrained = true; + for(SudokuCell c : row){ + //Test if its not a valid testing cell + if(c.getData() != 0) + continue; + if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) + continue; + //Check if cell is eligible to hold number + Set cregion = initialBoard.getRegion(c.getGroupIndex()); + Set ccol = initialBoard.getCol(c.getLocation().x); + boolean contains = false; + for(SudokuCell rc : cregion){ + if(rc.getData() == cell.getData()) { contains = true; - break; } } - if (!contains) { - return null; + for(SudokuCell cc : ccol){ + if(cc.getData() == cell.getData()) { + contains = true; + } + } + //Stop if another cell can hold number + if(!contains) { + restrained = false; + break; } } - if (col.size() == size - 1) { - contains = false; - for (SudokuCell c : col) { - if (cell.getData() == c.getData()) { + //Output if success + if(restrained) + return null; + + //// + //Loop to see if the number is constrained to the cell + restrained = true; + for(SudokuCell c : col){ + //Test if its not a valid testing cell + if(c.getData() != 0) + continue; + if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) + continue; + //Check if cell is eligible to hold number + Set cregion = initialBoard.getRegion(c.getGroupIndex()); + Set crow = initialBoard.getRow(c.getLocation().y); + boolean contains = false; + for(SudokuCell rc : cregion){ + if(rc.getData() == cell.getData()) { contains = true; - break; } } - if (!contains) { - return null; + for(SudokuCell cc : crow){ + if(cc.getData() == cell.getData()) { + contains = true; + } + } + //Stop if another cell can hold number + if(!contains) { + restrained = false; + break; } } + //Output if success + if(restrained) + return null; + + //Output fail return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; } From 24bae33a4ae94282cc530350391478a23089fa98 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:35:25 -0400 Subject: [PATCH 07/36] Fixed LastNumberForCell Direct Rule LastNumberForCell allowed any number to go into a cell if the cell only had one option for number. I.e if the last option was 9 you could put any number 1-9 in cell, this patch fixed that error --- .../rules/LastNumberForCellDirectRule.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java index 28e64ce7b..f38543cc9 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java @@ -31,28 +31,37 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem SudokuBoard initialBoard = (SudokuBoard) transition.getParents().get(0).getBoard(); SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); - int index = puzzleElement.getIndex(); + //Assign basics int groupSize = initialBoard.getWidth(); int groupDim = (int) Math.sqrt(groupSize); + + //Get position info + int index = puzzleElement.getIndex(); int rowIndex = index / groupSize; int colIndex = index % groupSize; - int groupNum = rowIndex / groupDim * groupDim + colIndex % groupDim; + int groupNum = (rowIndex / groupDim) * groupDim + (colIndex / groupDim); + + //Create hashset of all numbers HashSet numbers = new HashSet<>(); for (int i = 1; i <= groupSize; i++) { numbers.add(i); } + + //Run through region, row, col to see contradicitng numbers for (int i = 0; i < groupSize; i++) { SudokuCell cell = initialBoard.getCell(groupNum, i % groupDim, i / groupDim); numbers.remove(cell.getData()); } for (int i = 0; i < groupSize; i++) { - SudokuCell cell = initialBoard.getCell(i, colIndex); + SudokuCell cell = initialBoard.getCell(i, rowIndex); numbers.remove(cell.getData()); } for (int i = 0; i < groupSize; i++) { - SudokuCell cell = initialBoard.getCell(rowIndex, i); + SudokuCell cell = initialBoard.getCell(colIndex, i); numbers.remove(cell.getData()); } + + //Check if plausible if (numbers.size() > 1) { return super.getInvalidUseOfRuleMessage() + ": The number at the index is not forced"; } @@ -61,7 +70,9 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem return super.getInvalidUseOfRuleMessage() + ": The number at the index is forced but not correct"; } } - return null; + if(numbers.toArray(new Integer[1])[0] == puzzleElement.getData()) + return null; + return super.getInvalidUseOfRuleMessage() + ": The number at the index is forced but not correct"; } /** From d888a773e56c5309d779f8a3c44c6b3bd93638b2 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:41:37 -0400 Subject: [PATCH 08/36] Fixed Case & Contradiction Rule PossibleCellForNumber Case rule was only generating branches for and as the value 1 and no other values. Repeated Numbers Case rule was always triggering contradiction since it was taking the empty tile value of 0 in to account with other numbers. --- .../rules/PossibleNumbersForCellCaseRule.java | 4 +- .../RepeatedNumberContradictionRule.java | 54 ++++++++++--------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java index f355695ac..e577a4c3b 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java @@ -82,10 +82,10 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement, int v List caseCells = new ArrayList<>(); SudokuCell cell = (SudokuCell) puzzleElement; - for (int i = 0; i < 9; i++) { + for (int i = 1; i <= 9; i++) { Board newCase = sudokuBoard.copy(); PuzzleElement element = newCase.getPuzzleElement(puzzleElement); - element.setData(value); + element.setData(i); newCase.addModifiedData(element); cases.add(newCase); } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java index 4a5cc2074..a0801d5f3 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java @@ -27,39 +27,45 @@ public RepeatedNumberContradictionRule() { */ @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { + //Get board to check SudokuBoard sudokuBoard = (SudokuBoard) board; - SudokuCell cell = (SudokuCell) sudokuBoard.getPuzzleElement(puzzleElement); - if (cell.getData() == 0) { - return super.getNoContradictionMessage(); - } - Set region = sudokuBoard.getRegion(cell.getGroupIndex()); - Set row = sudokuBoard.getRow(cell.getLocation().y); - Set col = sudokuBoard.getCol(cell.getLocation().x); + //Loop all group indexes + for(int i = 0; i < 9; i++) { + //Get regions and sets to check duplicates + Set region = sudokuBoard.getRegion(i); + Set regionDup = new HashSet<>(); + + Set row = sudokuBoard.getRow(i); + Set rowDup = new HashSet<>(); - Set regionDup = new HashSet<>(); - Set rowDup = new HashSet<>(); - Set colDup = new HashSet<>(); + Set col = sudokuBoard.getCol(i); + Set colDup = new HashSet<>(); - for (SudokuCell c : region) { - if (regionDup.contains(c.getData())) { - return null; + //Check for non zero duplicates to trigger contradiction + for (SudokuCell c : region) { + if (c.getData() == 0) + continue; + if (regionDup.contains(c.getData())) + return null; + regionDup.add(c.getData()); } - regionDup.add(c.getData()); - } - for (SudokuCell c : row) { - if (rowDup.contains(c.getData())) { - return null; + for (SudokuCell c : row) { + if (c.getData() == 0) + continue; + if (rowDup.contains(c.getData())) + return null; + rowDup.add(c.getData()); } - rowDup.add(c.getData()); - } - for (SudokuCell c : col) { - if (colDup.contains(c.getData())) { - return null; + for (SudokuCell c : col) { + if (c.getData() == 0) + continue; + if (colDup.contains(c.getData())) + return null; + colDup.add(c.getData()); } - colDup.add(c.getData()); } return super.getNoContradictionMessage(); From 46857372dafe0401d2c66797b05f65f2e520ec68 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:46:37 -0400 Subject: [PATCH 09/36] No cell for number no number for cell Unfinished but pushing --- .../NoCellForNumberContradictionRule.java | 41 ++++++++------ .../NoNumberForCellContradictionRule.java | 56 +++++++++++++++++++ 2 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java index a308e1dfc..11376d1a2 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java @@ -3,6 +3,7 @@ import edu.rpi.legup.model.gameboard.Board; import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.model.rules.ContradictionRule; +import edu.rpi.legup.puzzle.sudoku.Sudoku; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; @@ -12,8 +13,8 @@ public class NoCellForNumberContradictionRule extends ContradictionRule { public NoCellForNumberContradictionRule() { - super("SUDO-CONT-0001", "No Cell for Number", - "Process of elimination yields no valid numbers for an empty cell.", + super("SUDO-CONT-0001", "No Cell for Number (Region)", + "Process of elimination yields no valid numbers for an empty cell in a region.", "edu/rpi/legup/images/sudoku/NoSolution.png"); } @@ -36,27 +37,35 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { int groupSize = sudokuBoard.getSize(); Set region = sudokuBoard.getRegion(cell.getGroupIndex()); - Set row = sudokuBoard.getRow(cell.getLocation().y); - Set col = sudokuBoard.getCol(cell.getLocation().x); - Set solution = new HashSet<>(); + Set numbersNotInRegion = new HashSet<>(); + Set numberNotFit = new HashSet<>(); + Set numberCanFit = new HashSet<>(); + for (int i = 1; i <= groupSize; i++) { - solution.add(i); + numbersNotInRegion.add(i); } - for (SudokuCell c : region) { - solution.remove(c.getData()); - } - for (SudokuCell c : row) { - solution.remove(c.getData()); - } - for (SudokuCell c : col) { - solution.remove(c.getData()); + if(c.getData() != 0) { + numbersNotInRegion.remove(c.getData()); + } } + for (SudokuCell c : region) { + + Set row = sudokuBoard.getRow(c.getLocation().y); + Set col = sudokuBoard.getCol(c.getLocation().x); + for(SudokuCell c1 : row) { + numberNotFit.add(c1.getData()); + } + for(SudokuCell c2 : col) { + numberNotFit.add(c2.getData()); + } - if (solution.isEmpty()) { - return null; + for(int i : numbersNotInRegion) { + numbersNotInRegion.remove(numberNotFit); + } } + return super.getNoContradictionMessage(); } } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java new file mode 100644 index 000000000..158b535d4 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java @@ -0,0 +1,56 @@ +package edu.rpi.legup.puzzle.sudoku.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.ContradictionRule; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; + +import java.util.HashSet; +import java.util.Set; + +public class NoNumberForCellContradictionRule extends ContradictionRule { + + public NoNumberForCellContradictionRule() { + super("SUDO-CONT-0003", "No Number for Cell", + "Process of elimination yields no valid numbers for an empty cell.", + "edu/rpi/legup/images/sudoku/NoSolution.png"); + } + + /** + * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule + * + * @param board board to check contradiction + * @param puzzleElement equivalent puzzleElement + * @return null if the transition contains a contradiction at the specified puzzleElement, + * otherwise error message + */ + @Override + public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { + SudokuBoard sudokuBoard = (SudokuBoard) board; + SudokuCell cell = (SudokuCell) sudokuBoard.getPuzzleElement(puzzleElement); + if (cell.getData() != 0) { + return super.getNoContradictionMessage(); + } + + int groupSize = sudokuBoard.getSize(); + + Set region = sudokuBoard.getRegion(cell.getGroupIndex()); + Set row = sudokuBoard.getRow(cell.getLocation().y); + Set col = sudokuBoard.getCol(cell.getLocation().x); + Set solution = new HashSet<>(); + for (int i = 1; i <= groupSize; i++) { + solution.add(i); + } + + for (SudokuCell c : region) { + solution.remove(c.getData()); + } + + if (solution.isEmpty()) { + return null; + } + + return super.getNoContradictionMessage(); + } +} From 8d765adc5e52af924824479b12bbb0ee47e89ba0 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:14:29 -0400 Subject: [PATCH 10/36] Update NoNumberForCellContradictionRule.java added code that might work --- .../rules/NoNumberForCellContradictionRule.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java index 158b535d4..fb325ef88 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java @@ -39,15 +39,19 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { Set row = sudokuBoard.getRow(cell.getLocation().y); Set col = sudokuBoard.getCol(cell.getLocation().x); Set solution = new HashSet<>(); - for (int i = 1; i <= groupSize; i++) { - solution.add(i); + for(SudokuCell s : region) { + solution.add(s.getData()); + } + for(SudokuCell s : row) { + solution.add(s.getData()); } - for (SudokuCell c : region) { - solution.remove(c.getData()); + for(SudokuCell s : col) { + solution.add(s.getData()); } + solution.remove(0); - if (solution.isEmpty()) { + if(solution.size() == 9) { return null; } From 86d985350b6be2278ed9acc7951ab1ad4b2aa0bd Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:23:30 -0400 Subject: [PATCH 11/36] Update NoCellForNumberContradictionRule.java Reformatted NoCellForNumber to function completely in all tested cases. --- .../NoCellForNumberContradictionRule.java | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java index 11376d1a2..81fbe6821 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java @@ -29,6 +29,12 @@ public NoCellForNumberContradictionRule() { @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { SudokuBoard sudokuBoard = (SudokuBoard) board; + + //Loop through every individual region + //Check if there is a number that cannot exist in region with current board + + + SudokuCell cell = (SudokuCell) sudokuBoard.getPuzzleElement(puzzleElement); if (cell.getData() != 0) { return super.getNoContradictionMessage(); @@ -38,8 +44,6 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { Set region = sudokuBoard.getRegion(cell.getGroupIndex()); Set numbersNotInRegion = new HashSet<>(); - Set numberNotFit = new HashSet<>(); - Set numberCanFit = new HashSet<>(); for (int i = 1; i <= groupSize; i++) { numbersNotInRegion.add(i); @@ -49,23 +53,39 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { numbersNotInRegion.remove(c.getData()); } } - for (SudokuCell c : region) { - Set row = sudokuBoard.getRow(c.getLocation().y); - Set col = sudokuBoard.getCol(c.getLocation().x); - for(SudokuCell c1 : row) { - numberNotFit.add(c1.getData()); - } - for(SudokuCell c2 : col) { - numberNotFit.add(c2.getData()); - } + for (Integer i : numbersNotInRegion) { + //Check if number can be in cell + boolean canFit = false; + for(SudokuCell c : region){ + if(c.getData() != 0) + continue; - for(int i : numbersNotInRegion) { - numbersNotInRegion.remove(numberNotFit); - } - } + //Get row and col groups + Set row = sudokuBoard.getRow(c.getLocation().y); + Set col = sudokuBoard.getCol(c.getLocation().x); + //Check if it alr exists in row or col + boolean duplicate = false; + for(SudokuCell rc : row) { + if(rc.getData() == i) + duplicate = true; + } + for(SudokuCell cc : col) { + if(cc.getData() == i) + duplicate = true; + } + //If there is no duplicate it can exist in the region + if(!duplicate) { + canFit = true; + break; + } + } + //If the number can't fit anywhere in region then contradiction + if(!canFit) + return null; + } return super.getNoContradictionMessage(); } } From fef7499cdbe10e81a803d7681460f2fa16ffeec6 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:18:24 -0400 Subject: [PATCH 12/36] Fix Build Failure Test If statements missing brackets were causing build errors, this should fix that. --- .../rules/LastCellForNumberDirectRule.java | 36 ++++++++++++------- .../rules/LastNumberForCellDirectRule.java | 3 +- .../NoCellForNumberContradictionRule.java | 18 +++++----- .../RepeatedNumberContradictionRule.java | 18 ++++++---- 4 files changed, 46 insertions(+), 29 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java index ad393ee42..af10fdc79 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java @@ -44,16 +44,19 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem //Check if new cell conflicts group for(SudokuCell c : region){ - if(c.getData() == cell.getData()) + if(c.getData() == cell.getData()) { return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } } for(SudokuCell c : row){ - if(c.getData() == cell.getData()) + if(c.getData() == cell.getData()) { return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } } for(SudokuCell c : col){ - if(c.getData() == cell.getData()) + if(c.getData() == cell.getData()) { return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } } //// @@ -61,10 +64,12 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem boolean restrained = true; for(SudokuCell c : region){ //Test if its not a valid testing cell - if(c.getData() != 0) + if(c.getData() != 0) { continue; - if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) + } + if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) { continue; + } //Check if cell is eligible to hold number Set crow = initialBoard.getRow(c.getLocation().y); Set ccol = initialBoard.getCol(c.getLocation().x); @@ -86,18 +91,21 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem } } //Output if success - if(restrained) + if(restrained) { return null; + } //// //Loop to see if the number is constrained to the cell restrained = true; for(SudokuCell c : row){ //Test if its not a valid testing cell - if(c.getData() != 0) + if(c.getData() != 0) { continue; - if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) + } + if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) { continue; + } //Check if cell is eligible to hold number Set cregion = initialBoard.getRegion(c.getGroupIndex()); Set ccol = initialBoard.getCol(c.getLocation().x); @@ -119,18 +127,21 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem } } //Output if success - if(restrained) + if(restrained) { return null; + } //// //Loop to see if the number is constrained to the cell restrained = true; for(SudokuCell c : col){ //Test if its not a valid testing cell - if(c.getData() != 0) + if(c.getData() != 0) { continue; - if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) + } + if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) { continue; + } //Check if cell is eligible to hold number Set cregion = initialBoard.getRegion(c.getGroupIndex()); Set crow = initialBoard.getRow(c.getLocation().y); @@ -152,8 +163,9 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem } } //Output if success - if(restrained) + if(restrained) { return null; + } //Output fail return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java index f38543cc9..888f000ff 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java @@ -70,8 +70,9 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem return super.getInvalidUseOfRuleMessage() + ": The number at the index is forced but not correct"; } } - if(numbers.toArray(new Integer[1])[0] == puzzleElement.getData()) + if(numbers.toArray(new Integer[1])[0] == puzzleElement.getData()) { return null; + } return super.getInvalidUseOfRuleMessage() + ": The number at the index is forced but not correct"; } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java index 81fbe6821..9c53df794 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java @@ -29,12 +29,6 @@ public NoCellForNumberContradictionRule() { @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { SudokuBoard sudokuBoard = (SudokuBoard) board; - - //Loop through every individual region - //Check if there is a number that cannot exist in region with current board - - - SudokuCell cell = (SudokuCell) sudokuBoard.getPuzzleElement(puzzleElement); if (cell.getData() != 0) { return super.getNoContradictionMessage(); @@ -58,8 +52,9 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { //Check if number can be in cell boolean canFit = false; for(SudokuCell c : region){ - if(c.getData() != 0) + if(c.getData() != 0) { continue; + } //Get row and col groups Set row = sudokuBoard.getRow(c.getLocation().y); @@ -68,12 +63,14 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { //Check if it alr exists in row or col boolean duplicate = false; for(SudokuCell rc : row) { - if(rc.getData() == i) + if(rc.getData() == i) { duplicate = true; + } } for(SudokuCell cc : col) { - if(cc.getData() == i) + if(cc.getData() == i) { duplicate = true; + } } //If there is no duplicate it can exist in the region @@ -83,8 +80,9 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { } } //If the number can't fit anywhere in region then contradiction - if(!canFit) + if(!canFit) { return null; + } } return super.getNoContradictionMessage(); } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java index a0801d5f3..51a8bf40b 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java @@ -44,26 +44,32 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { //Check for non zero duplicates to trigger contradiction for (SudokuCell c : region) { - if (c.getData() == 0) + if (c.getData() == 0) { continue; - if (regionDup.contains(c.getData())) + } + if (regionDup.contains(c.getData())) { return null; + } regionDup.add(c.getData()); } for (SudokuCell c : row) { - if (c.getData() == 0) + if (c.getData() == 0) { continue; - if (rowDup.contains(c.getData())) + } + if (rowDup.contains(c.getData())) { return null; + } rowDup.add(c.getData()); } for (SudokuCell c : col) { - if (c.getData() == 0) + if (c.getData() == 0) { continue; - if (colDup.contains(c.getData())) + } + if (colDup.contains(c.getData())) { return null; + } colDup.add(c.getData()); } } From 86e413a754e55369dc866212c64a9910386e68ff Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:37:01 -0400 Subject: [PATCH 13/36] Refactored contradiction rules +2 new contradiction rule Change old contradiction rule numbering to reflect as such --- ...oCellForNumberColumnContradictionRule.java | 88 +++++++++++++++++++ .../NoCellForNumberRowContradictionRule.java | 88 +++++++++++++++++++ .../NoNumberForCellContradictionRule.java | 2 +- 3 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java create mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java new file mode 100644 index 000000000..64db5ff37 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java @@ -0,0 +1,88 @@ +package edu.rpi.legup.puzzle.sudoku.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.ContradictionRule; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; + +import java.util.HashSet; +import java.util.Set; + +public class NoCellForNumberColumnContradictionRule extends ContradictionRule { + + public NoCellForNumberColumnContradictionRule() { + super("SUDO-CONT-0003", "No Cell for Number (Column)", + "Process of elimination yields no valid numbers for an empty cell in a column.", + "edu/rpi/legup/images/sudoku/NoSolution.png"); + } + + /** + * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule + * + * @param board board to check contradiction + * @param puzzleElement equivalent puzzleElement + * @return null if the transition contains a contradiction at the specified puzzleElement, + * otherwise error message + */ + @Override + public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { + SudokuBoard sudokuBoard = (SudokuBoard) board; + SudokuCell cell = (SudokuCell) sudokuBoard.getPuzzleElement(puzzleElement); + if (cell.getData() != 0) { + return super.getNoContradictionMessage(); + } + + int groupSize = sudokuBoard.getSize(); + + Set col = sudokuBoard.getCol(cell.getGroupIndex()); + Set numbersNotInColumn = new HashSet<>(); + + for (int i = 1; i <= groupSize; i++) { + numbersNotInColumn.add(i); + } + for (SudokuCell c : col) { + if(c.getData() != 0) { + numbersNotInColumn.remove(c.getData()); + } + } + + for (Integer i : numbersNotInColumn) { + //Check if number can be in cell + boolean canFit = false; + for(SudokuCell c : col){ + if(c.getData() != 0) { + continue; + } + + //Get row and col groups + Set region = sudokuBoard.getRow(c.getLocation().y); + Set row = sudokuBoard.getCol(c.getLocation().x); + + //Check if it alr exists in row or col + boolean duplicate = false; + for(SudokuCell rc : region) { + if(rc.getData() == i) { + duplicate = true; + } + } + for(SudokuCell cc : row) { + if(cc.getData() == i) { + duplicate = true; + } + } + + //If there is no duplicate it can exist in the region + if(!duplicate) { + canFit = true; + break; + } + } + //If the number can't fit anywhere in region then contradiction + if(!canFit) { + return null; + } + } + return super.getNoContradictionMessage(); + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java new file mode 100644 index 000000000..28fc9a49b --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java @@ -0,0 +1,88 @@ +package edu.rpi.legup.puzzle.sudoku.rules; + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.ContradictionRule; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; + +import java.util.HashSet; +import java.util.Set; + +public class NoCellForNumberRowContradictionRule extends ContradictionRule { + + public NoCellForNumberRowContradictionRule() { + super("SUDO-CONT-0002", "No Cell for Number (Row)", + "Process of elimination yields no valid numbers for an empty cell in a row.", + "edu/rpi/legup/images/sudoku/NoSolution.png"); + } + + /** + * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule + * + * @param board board to check contradiction + * @param puzzleElement equivalent puzzleElement + * @return null if the transition contains a contradiction at the specified puzzleElement, + * otherwise error message + */ + @Override + public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { + SudokuBoard sudokuBoard = (SudokuBoard) board; + SudokuCell cell = (SudokuCell) sudokuBoard.getPuzzleElement(puzzleElement); + if (cell.getData() != 0) { + return super.getNoContradictionMessage(); + } + + int groupSize = sudokuBoard.getSize(); + + Set row = sudokuBoard.getRow(cell.getGroupIndex()); + Set numbersNotInRow = new HashSet<>(); + + for (int i = 1; i <= groupSize; i++) { + numbersNotInRow.add(i); + } + for (SudokuCell c : row) { + if(c.getData() != 0) { + numbersNotInRow.remove(c.getData()); + } + } + + for (Integer i : numbersNotInRow) { + //Check if number can be in cell + boolean canFit = false; + for(SudokuCell c : row){ + if(c.getData() != 0) { + continue; + } + + //Get row and col groups + Set region = sudokuBoard.getRow(c.getLocation().y); + Set col = sudokuBoard.getCol(c.getLocation().x); + + //Check if it alr exists in row or col + boolean duplicate = false; + for(SudokuCell rc : region) { + if(rc.getData() == i) { + duplicate = true; + } + } + for(SudokuCell cc : col) { + if(cc.getData() == i) { + duplicate = true; + } + } + + //If there is no duplicate it can exist in the region + if(!duplicate) { + canFit = true; + break; + } + } + //If the number can't fit anywhere in region then contradiction + if(!canFit) { + return null; + } + } + return super.getNoContradictionMessage(); + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java index fb325ef88..7b2736aba 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java @@ -12,7 +12,7 @@ public class NoNumberForCellContradictionRule extends ContradictionRule { public NoNumberForCellContradictionRule() { - super("SUDO-CONT-0003", "No Number for Cell", + super("SUDO-CONT-0005", "No Number for Cell", "Process of elimination yields no valid numbers for an empty cell.", "edu/rpi/legup/images/sudoku/NoSolution.png"); } From 196ce8f161f40e14081dbfde13fb4c5eba9a0600 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:32:49 -0400 Subject: [PATCH 14/36] number changes for contradictionrules changed the order and reference sheet to reflect that --- .../sudoku/rules/NoNumberForCellContradictionRule.java | 2 +- .../puzzle/sudoku/rules/RepeatedNumberContradictionRule.java | 2 +- .../rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java index 7b2736aba..41650d3ba 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java @@ -12,7 +12,7 @@ public class NoNumberForCellContradictionRule extends ContradictionRule { public NoNumberForCellContradictionRule() { - super("SUDO-CONT-0005", "No Number for Cell", + super("SUDO-CONT-0004", "No Number for Cell", "Process of elimination yields no valid numbers for an empty cell.", "edu/rpi/legup/images/sudoku/NoSolution.png"); } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java index 51a8bf40b..2f131f44d 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java @@ -12,7 +12,7 @@ public class RepeatedNumberContradictionRule extends ContradictionRule { public RepeatedNumberContradictionRule() { - super("SUDO-CONT-0002", "Repeated Numbers", + super("SUDO-CONT-0005", "Repeated Numbers", "Two identical numbers are placed in the same group.", "edu/rpi/legup/images/sudoku/RepeatedNumber.png"); } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt index a8635330d..b36fc5e02 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt @@ -2,7 +2,10 @@ SUDO-BASC-0001 : AdvancedDeductionDirectRule SUDO-BASC-0002 : LastCellForNumberDirectRule SUDO-BASC-0003 : LastNumberForCellDirectRule -SUDO-CONT-0001 : NoSolutionContradictionRule +SUDO-CONT-0001 : NoCellForNumberContradictionRule +SUDO-CONT-0002 : NoCellForNumberRowContradictionRule +SUDO-CONT-0003 : NoCellForNumberColumnContradictionRule +SUDO-CONT-0004 : NoNumberForCellContradictionRule SUDO-CONT-0002 : RepeatedNumberContradictionRule SUDO-CASE-0001 : PossibleCellCaseRule From bc7d4a53814716631b5567c892d3054702cfed23 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Fri, 29 Mar 2024 16:45:20 -0400 Subject: [PATCH 15/36] Refactor and Image addtions Made and added images for new contradiciton rules. Also refactored NoCellForNumber rule to NoCellForNumberRegion. --- .../NoCellForNumberColumnContradictionRule.java | 2 +- ... NoCellForNumberRegionContradictionRule.java} | 7 +++---- .../NoCellForNumberRowContradictionRule.java | 2 +- .../images/sudoku/NoCellForNumberColumn.png | Bin 0 -> 958 bytes .../images/sudoku/NoCellForNumberRegion.png | Bin 0 -> 1077 bytes .../legup/images/sudoku/NoCellForNumberRow.png | Bin 0 -> 916 bytes 6 files changed, 5 insertions(+), 6 deletions(-) rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{NoCellForNumberContradictionRule.java => NoCellForNumberRegionContradictionRule.java} (92%) create mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberColumn.png create mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberRegion.png create mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberRow.png diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java index 64db5ff37..4cf076892 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java @@ -14,7 +14,7 @@ public class NoCellForNumberColumnContradictionRule extends ContradictionRule { public NoCellForNumberColumnContradictionRule() { super("SUDO-CONT-0003", "No Cell for Number (Column)", "Process of elimination yields no valid numbers for an empty cell in a column.", - "edu/rpi/legup/images/sudoku/NoSolution.png"); + "edu/rpi/legup/images/sudoku/NoCellForNumberColumn.png"); } /** diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java similarity index 92% rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java index 9c53df794..9923bd207 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java @@ -3,19 +3,18 @@ import edu.rpi.legup.model.gameboard.Board; import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.model.rules.ContradictionRule; -import edu.rpi.legup.puzzle.sudoku.Sudoku; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; import java.util.HashSet; import java.util.Set; -public class NoCellForNumberContradictionRule extends ContradictionRule { +public class NoCellForNumberRegionContradictionRule extends ContradictionRule { - public NoCellForNumberContradictionRule() { + public NoCellForNumberRegionContradictionRule() { super("SUDO-CONT-0001", "No Cell for Number (Region)", "Process of elimination yields no valid numbers for an empty cell in a region.", - "edu/rpi/legup/images/sudoku/NoSolution.png"); + "edu/rpi/legup/images/sudoku/NoCellForNumberRegion.png"); } /** diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java index 28fc9a49b..6e8616a9f 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java @@ -14,7 +14,7 @@ public class NoCellForNumberRowContradictionRule extends ContradictionRule { public NoCellForNumberRowContradictionRule() { super("SUDO-CONT-0002", "No Cell for Number (Row)", "Process of elimination yields no valid numbers for an empty cell in a row.", - "edu/rpi/legup/images/sudoku/NoSolution.png"); + "edu/rpi/legup/images/sudoku/NoCellForNumberRow.png"); } /** diff --git a/src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberColumn.png b/src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberColumn.png new file mode 100644 index 0000000000000000000000000000000000000000..9dcade64b2fb79be751848670324692e7b464cce GIT binary patch literal 958 zcmV;v13~Px&cu7P-RCt{2oWE|{Fc62&MF))<`XUzK#XyG|=+Ni!%*l^cAWMOGFu=S>2M--I z6iA0!jigW#?|2fg((eO;1djX%`g}a{MBUEc{42Gn4i)*Er!iuVNjZMYeBeF-CwE>x zat^KzRp)mbNYa5N1Sfrd*h3bW7YH#1gcu{3LqbU#EJIMpD-pdYCGh>BqMgbsZG+&D z^>XvHSBR4Rp;8mO6$W!isuakOF`Cq+QXoUlkuw@xU5kk1@ z42hKf|F_I&QkO3JF#D1-C?vHUGA3o~Q7}eOh*oV1k-{gKLv}<&GoQ$*T(VVyLN1q! z>YF&{R9~;p{~$JYn9jN{3%TSyqH3>IEDGjEFLo{(144`eA;w4&GWYChi-?6l#yp6G zIOnJ=OYP4BC?P`5=d#AJ5s|J6k6Q zYtdl^baHsmEvKFI&$WY26S?GP}eopb)EZTEZ@n&YIIm((M}FAci_e_$FP!n zsA@nh%NU{vX%ADJAuHxC+^w^CCkF@^hb3gHlLJU6T1adshZqng!$b+;c5(o6CWS~l zIZS~l34=}!#u%LTYISlLdkyUxu5a?nJ-WHSNreC_+x(PW1HsiTu@5Q52ZgD#8|W{BrE3 z3A2IHi7_C=7!YC%2r))5sbeae4{UNU28JwSK!`CQ#264_3yOtH2F`>4l2P;C_ gZBv_{_TwO(KSVOPa4)&_O8@`>07*qoM6N<$g6E{9PXGV_ literal 0 HcmV?d00001 diff --git a/src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberRegion.png b/src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberRegion.png new file mode 100644 index 0000000000000000000000000000000000000000..000dc8b68935563c869c695b114190eac7499805 GIT binary patch literal 1077 zcmeAS@N?(olHy`uVBq!ia0vp^DImV1DoE;uumf z=k1)me$tKt$N&2Y6uk`p=oNk>s4K#2;`4rb9xS z7iK=SsK4{>OjTNb-K1^@iM$_o@6}b*3zKK1sW$F0Z5C)l(Hs9l}f z^X*5i;>;_WlV*kS)yv6u_uOaS6dL9gwERxwt;h4ZUT!j1TWNPPqraZ($?pkvo<~&{ z+x|10G;Qzij7e2dzxV#0Iz@H)w;$~Zf=qi&Qf>9PFDPYX7BX0`12JonP$_7uTOJjLr~g}(jhe518xwdlFc%4K$?H*eL33p@`}XsTDGHtIQ#o$WvU9?^ly7T&Zh6Mm?bEUQXXw%DVPic> zk~d;l5Z>R?_#QR`O`wi_4*YwV@p4f8L}zC^ID7 zQOWF=cb+uiXp&>8to(}Cv%V^v5AFN=D|tguP~r>$6trO~V`<=Z)1N_`SLbyV?YtAW zuSjodqmNV4^(V(O_7}SNUgteh7~HzSe$%U6$5MDJ6&= zvfa~o{rI%slb+jXx!XmmmuAiSc{nuBd}p!vrozK&OJ<(9Eo^l>_L`Wp?$dAIbsKDo zf&O3D{ao(TzXQkFlTLn|!KIm%ydsuuK@A^g;nc$wHpgDoxk_!%=0B>bxmsXa>@U`a zx3BlFOr4V~zo@DuBR;S+@QO?jlbVYJ1bMa=9ZT$bJ$>okciL?CiRK zjpD*(@z(+ZuIguVtav>=)Jp4j>Q>JF6PD9XeSTleaNyZ}wi}=1vNpZFa=0$|t$2Hn z8%rtgjX%d_PVZKoR_^_Sz5ipynO&M;clBRCd&YKPcF)`?@g_lO_tS3txx44L)Yodg z+>r05tM1vA*C%_6{IB${aRc&q{j21Cklf0B)#j1>pZ3UUzj@Yo)I~Dv?I~WkD?Uu4 zF+1oxzue~ao9}v;y6=?vyX=tQK~t-+@2l^2OK<(V=^X2KnM0cl-(1euD&>?B+gw<~ zrz&DF)8~eK?r|b literal 0 HcmV?d00001 diff --git a/src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberRow.png b/src/main/resources/edu/rpi/legup/images/sudoku/NoCellForNumberRow.png new file mode 100644 index 0000000000000000000000000000000000000000..f984f836508fbc3d6f0dce4d9b749f5e53de8d87 GIT binary patch literal 916 zcmeAS@N?(olHy`uVBq!ia0vp^DImVD|HLaSW-L z^LFmWyxRsMuJgNjq)flK`#3oBl&omv`zv>T)}Kh$O)MSk%xC&bPOQ+K8F8a2*YnBZ zd#csv=l!sgw+mV%lJ@xgzhDlY`)imdWNWbSa4|MJ9atb>fW(}qV|S(W+@oaihv)A- zDZZ(gFr&odK$eKzpL-(rTv}e zMq{QoAme+oS|aR^Us%MYINiuA&fY~!P)H-T&BN8{*88=kETUcFn|^N;7M$3>U;db9 ziAGe%>p47!6?`v;7{+#r=&5}8_A5=+u~)0*ipxf)L$?B@k8%l4Ty?F_p>TG0W1_?w z<&=dl_*PC#vR<-nrPcvHOiuy*cUk&yRGiO+7Fnh?&-N?3-Y#Uc2Kirkwt(J^!j!iH zCYtMt3uYcGIK_k!B%3%K_g`~Y%Wf|aF0`Dp2^3(9=C>EjJ#kp=Ykk1cu9I8$E#VV+ zU8*1Hk?>A@W7t9OqY>R4D>ymt{8n1SHBYEnNoj$e3(Mz}){PQVVv;w-q_!qa?Amvx zX-c-wG(N?TIW8?u4HdJj7QPL3xi>Yc=CZW(p zor_s6c+mFH+uw12{p{HPJy}0*d)8XTll7O%EFT5A$48j!UFX+zoMp-U@5%qUInU3> zxq3~SP?(q))uCJV=jihZij(Gj7JAEUv3U8KYSzrRnwcBJ{4Q%|XO(339S|vc&Lebd zTj*`cIGvO{Mya5nWvfk#o>hF>k#QQ2@#E!F3`Y22N%uG!+zUgxUM2u-s3x+XM7 z(^B40(kq%sZU$yE22WQ%mvv4F FO#n+HlXCz7 literal 0 HcmV?d00001 From 1174d5148c0c9674300941983917d09624200b26 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:26:55 -0400 Subject: [PATCH 16/36] No more advanced deduction It wasn't doing anything and was always returning true. --- .../rules/AdvancedDeductionDirectRule.java | 96 ------------------ .../legup/images/sudoku/AdvancedDeduction.png | Bin 3351 -> 0 bytes 2 files changed, 96 deletions(-) delete mode 100644 src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java delete mode 100644 src/main/resources/edu/rpi/legup/images/sudoku/AdvancedDeduction.png diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java deleted file mode 100644 index 0be30fa36..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java +++ /dev/null @@ -1,96 +0,0 @@ -package edu.rpi.legup.puzzle.sudoku.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.sudoku.SudokuBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuCell; - -public class AdvancedDeductionDirectRule extends DirectRule { - - public AdvancedDeductionDirectRule() { - super("SUDO-BASC-0001", "Advanced Deduction", - "Use of group logic deduces more answers by means of forced by Location and forced by Deduction", - "edu/rpi/legup/images/sudoku/AdvancedDeduction.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - SudokuBoard initialBoard = (SudokuBoard) transition.getParents().get(0).getBoard(); - SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); - - SudokuCell cell = (SudokuCell) finalBoard.getPuzzleElement(puzzleElement); - int index = cell.getIndex(); - int groupSize = initialBoard.getWidth(); - int groupDim = (int) Math.sqrt(groupSize); - int rowIndex = index / groupSize; - int colIndex = index % groupSize; - int relX = rowIndex / groupDim; - int relY = colIndex % groupDim; - int groupNum = rowIndex / groupDim * groupDim + colIndex / groupDim; - boolean[][] possible = new boolean[groupDim][groupDim]; - for (int y = 0; y < groupDim; y++) { - for (int x = 0; x < groupDim; x++) { - SudokuCell c = initialBoard.getCell(groupNum, x, y); - if (c.getData() == cell.getData() && x != relX && y != relY) { - return super.getRuleName() + ": Duplicate value in sub-region"; - } - possible[y][x] = c.getData() == 0; - } - } - for (int y = 0; y < groupDim; y++) { - for (int x = 0; x < groupSize; x++) { - SudokuCell r = initialBoard.getCell(x, (groupNum / groupDim) * groupDim + y); - SudokuCell c = initialBoard.getCell((groupNum % groupDim) * groupDim + y, x); - if (r.getData() == cell.getData()) { - for (int i = 0; i < groupDim; i++) { - possible[y][i] = false; - } - } - if (c.getData() == cell.getData()) { - for (int i = 0; i < groupDim; i++) { - possible[i][y] = false; - } - } - } - } - boolean isForced = false; - for (int y = 0; y < groupDim; y++) { - for (int x = 0; x < groupDim; x++) { - if (possible[y][x] && !isForced) { - isForced = true; - } - else { - if (possible[y][x]) { - return super.getInvalidUseOfRuleMessage() + ": Not forced"; - } - } - } - } - if (!isForced) { - return super.getInvalidUseOfRuleMessage() + ": Not forced"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - return null; - } -} diff --git a/src/main/resources/edu/rpi/legup/images/sudoku/AdvancedDeduction.png b/src/main/resources/edu/rpi/legup/images/sudoku/AdvancedDeduction.png deleted file mode 100644 index d51538baf164400e6c4cca37fa44f738b2d3c6c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3351 zcmV+y4e0WTP)pPPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*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D#X^3V)7Gycv!OM;fwLjP0KeBF%PL?etYh^yNaAwdfHO&h7R{GJO znTRaGTP63O@x&TwSZ_5fj0x>Ba%deyt)0o?L=3hri5wa>hzp}o6k zj$iT=C;zH^y;*+r$mc7^O2fgQIkI)=P1d}R!ep8ylb*pfOKUakcqUwrUo@*nWEnLQ zh%5kXfphQ~tRd_nznY`js+Yl~?GFZ&=KAGaCpEe(=Kz=_%u+Hl&b- hEMN)P${DSG1^|rCy3LHki8ufN002ovPDHLkV1g;gM;!nF From 7294dac452c73656737ade178bba5e7185bb5394 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:44:44 -0400 Subject: [PATCH 17/36] Updated reference sheet --- .../legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt index b36fc5e02..daf2c5047 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt @@ -2,11 +2,13 @@ SUDO-BASC-0001 : AdvancedDeductionDirectRule SUDO-BASC-0002 : LastCellForNumberDirectRule SUDO-BASC-0003 : LastNumberForCellDirectRule -SUDO-CONT-0001 : NoCellForNumberContradictionRule +SUDO-CONT-0001 : NoCellForNumberRegionContradictionRule SUDO-CONT-0002 : NoCellForNumberRowContradictionRule SUDO-CONT-0003 : NoCellForNumberColumnContradictionRule SUDO-CONT-0004 : NoNumberForCellContradictionRule SUDO-CONT-0002 : RepeatedNumberContradictionRule -SUDO-CASE-0001 : PossibleCellCaseRule -SUDO-CASE-0002 : PossibleNumberCaseRule \ No newline at end of file +SUDO-CASE-0001 : PossibleNumbersForCellCaseRule +SUDO-CASE-0002 : PossibleCellsForNumberRegionCaseRule +SUDO-CASE-0003 : PossibleCellsForNumberRowCaseRule +SUDO-CASE-0004 : PossibleCellsForNumberColumnCaseRule \ No newline at end of file From a87fc7d1ab970200bf0c039f9c200a95f3147ae3 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:50:15 -0400 Subject: [PATCH 18/36] No advanced deduction in list --- .../edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt index daf2c5047..3f9e62cc8 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt @@ -1,4 +1,3 @@ -SUDO-BASC-0001 : AdvancedDeductionDirectRule SUDO-BASC-0002 : LastCellForNumberDirectRule SUDO-BASC-0003 : LastNumberForCellDirectRule From 019649c01b702fb7db78a16baac5b4f6ccc76b95 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:13:31 -0400 Subject: [PATCH 19/36] Added Fake Tests Fake tests added --- .../BottomLeftWhiteBlackSquare | 11 +++++++++++ .../BottomRightWhiteBlackSquare | 11 +++++++++++ .../TopLeftWhiteBlackSquare | 11 +++++++++++ .../TopRightWhiteBlackSquare | 11 +++++++++++ .../sudoku/rules/RepeatedNumberContradictionRule/a | 0 5 files changed, 44 insertions(+) create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/a diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare new file mode 100644 index 000000000..1c789c55c --- /dev/null +++ b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare new file mode 100644 index 000000000..1cf3694d4 --- /dev/null +++ b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare new file mode 100644 index 000000000..e4de84894 --- /dev/null +++ b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare new file mode 100644 index 000000000..52c0ca68f --- /dev/null +++ b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/a b/output_path/test/src/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/a new file mode 100644 index 000000000..e69de29bb From fd90f2da2db741561ae2c3e2ca835d2733af1e0e Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:34:45 -0400 Subject: [PATCH 20/36] Deleted fake tests and added a real test Fake tests was bad --- .../BottomLeftWhiteBlackSquare | 11 ----------- .../BottomRightWhiteBlackSquare | 11 ----------- .../TopLeftWhiteBlackSquare | 11 ----------- .../TopRightWhiteBlackSquare | 11 ----------- .../sudoku/rules/LastCellForNumberDirectRuleTest.java | 10 ++++++++++ 5 files changed, 10 insertions(+), 44 deletions(-) delete mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare delete mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare delete mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare delete mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare create mode 100644 src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare deleted file mode 100644 index 1c789c55c..000000000 --- a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare deleted file mode 100644 index 1cf3694d4..000000000 --- a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare deleted file mode 100644 index e4de84894..000000000 --- a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare b/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare deleted file mode 100644 index 52c0ca68f..000000000 --- a/output_path/test/src/resources/puzzles/sudoku/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java new file mode 100644 index 000000000..7b98ce488 --- /dev/null +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -0,0 +1,10 @@ +package puzzles.sudoku.rules; + +import static org.junit.Assert.*; + +public class LastCellForNumberDirectRuleTest { + @test + public LastCellForNumberDirectRuleTest() { + assertTrue(true); + } +} From 6ec594c0eb0f6d412ff3cf3a496aa761a1438d14 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:35:48 -0400 Subject: [PATCH 21/36] fixed empty test file --- .../sudoku/rules/LastCellForNumberDirectRuleTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java index 7b98ce488..35d39401d 100644 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -1,10 +1,12 @@ package puzzles.sudoku.rules; +import org.junit.Test; + import static org.junit.Assert.*; public class LastCellForNumberDirectRuleTest { - @test - public LastCellForNumberDirectRuleTest() { + @Test + public void LastCellForNumberDirectRuleTest() { assertTrue(true); } } From c5653ca5c6a61f88c5b39e5b8c4b01bbdae4293c Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:47:31 -0400 Subject: [PATCH 22/36] Update LastCellForNumberDirectRuleTest.java --- .../sudoku/rules/LastCellForNumberDirectRuleTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java index 35d39401d..e3ef0183c 100644 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -1,10 +1,18 @@ package puzzles.sudoku.rules; +import edu.rpi.legup.puzzle.nurikabe.Nurikabe; +import legup.MockGameBoardFacade; import org.junit.Test; +import edu.rpi.legup.puzzle.sudoku.Sudoku; import static org.junit.Assert.*; public class LastCellForNumberDirectRuleTest { + private Sudoku sudoku; + public static void setUp() { + MockGameBoardFacade.getInstance(); + sudoku = new Sudoku(); + } @Test public void LastCellForNumberDirectRuleTest() { assertTrue(true); From ceab9056aed9a4f49794fd2aad09bb559f3f9b76 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:42:07 -0400 Subject: [PATCH 23/36] Modified tests, made sample test --- .../rules/LastCellForNumberDirectRule/TestBoard | 16 ++++++++++++++++ .../rules/LastCellForNumberDirectRuleTest.java | 11 +++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard b/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard new file mode 100644 index 000000000..4a66f38fc --- /dev/null +++ b/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java index e3ef0183c..eff4feb93 100644 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -1,20 +1,27 @@ package puzzles.sudoku.rules; import edu.rpi.legup.puzzle.nurikabe.Nurikabe; +import edu.rpi.legup.save.InvalidFileFormatException; import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.BeforeClass; import org.junit.Test; import edu.rpi.legup.puzzle.sudoku.Sudoku; +import edu.rpi.legup.puzzle.sudoku.rules.LastCellForNumberDirectRule; import static org.junit.Assert.*; public class LastCellForNumberDirectRuleTest { - private Sudoku sudoku; + private static Sudoku sudoku; + @BeforeClass public static void setUp() { MockGameBoardFacade.getInstance(); sudoku = new Sudoku(); } @Test - public void LastCellForNumberDirectRuleTest() { + public void LastCellForNumberDirectRuleTest() throws InvalidFileFormatException { + TestUtilities.importTestBoard("puzzles/sudoku/rules/LastCellForNumberRule/TestBoard", sudoku); assertTrue(true); + } } From f764c376b7e2f5cae867bd5c72382dc0cea77957 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:26:27 -0400 Subject: [PATCH 24/36] First Sudoku Test Case Basic Last Number for Cell test case. --- .gitignore | 3 +- .../LastNumberForCellDirectRule/FullRegion | 19 +++++++ src/test/java/legup/TestRunner.java | 5 ++ .../LastCellForNumberDirectRuleTest.java | 20 -------- ...LastNumberForCellDirectRuleRegionTest.java | 49 +++++++++++++++++++ .../LastNumberForCellDirectRule/FullRegion | 18 +++++++ 6 files changed, 93 insertions(+), 21 deletions(-) create mode 100644 output_path/test/src/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion delete mode 100644 src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java create mode 100644 src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java create mode 100644 src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion diff --git a/.gitignore b/.gitignore index baee37e51..bafea84a3 100644 --- a/.gitignore +++ b/.gitignore @@ -92,4 +92,5 @@ gradle-app.setting gradle/wrapper/gradle-wrapper.properties # Visual Studio Code configs -.vscode/* \ No newline at end of file +.vscode/* +src/test/java/legup/TestRunner.java diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion b/output_path/test/src/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion new file mode 100644 index 000000000..49dae4aa6 --- /dev/null +++ b/output_path/test/src/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/legup/TestRunner.java b/src/test/java/legup/TestRunner.java index 3a74c4c61..4e516b55f 100644 --- a/src/test/java/legup/TestRunner.java +++ b/src/test/java/legup/TestRunner.java @@ -7,6 +7,7 @@ import puzzles.battleship.rules.*; import puzzles.lightup.rules.*; import puzzles.nurikabe.rules.*; +import puzzles.sudoku.rules.LastNumberForCellDirectRuleRegionTest; import puzzles.treetent.rules.*; /** @@ -93,6 +94,10 @@ public static void main(String[] args) { printTestResults(result35); Result result36 = JUnitCore.runClasses(TentOrGrassCaseRuleTest.class); printTestResults(result36); + + //Sudoku Tests + Result result37 = JUnitCore.runClasses(LastNumberForCellDirectRuleRegionTest.class); + printTestResults(result37); } private static void printTestResults(Result result) { diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java deleted file mode 100644 index e3ef0183c..000000000 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package puzzles.sudoku.rules; - -import edu.rpi.legup.puzzle.nurikabe.Nurikabe; -import legup.MockGameBoardFacade; -import org.junit.Test; -import edu.rpi.legup.puzzle.sudoku.Sudoku; - -import static org.junit.Assert.*; - -public class LastCellForNumberDirectRuleTest { - private Sudoku sudoku; - public static void setUp() { - MockGameBoardFacade.getInstance(); - sudoku = new Sudoku(); - } - @Test - public void LastCellForNumberDirectRuleTest() { - assertTrue(true); - } -} diff --git a/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java b/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java new file mode 100644 index 000000000..d47ee9a19 --- /dev/null +++ b/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java @@ -0,0 +1,49 @@ +package puzzles.sudoku.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.sudoku.Sudoku; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import edu.rpi.legup.puzzle.sudoku.rules.LastNumberForCellDirectRule; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class LastNumberForCellDirectRuleRegionTest { + private static final LastNumberForCellDirectRule RULE = new LastNumberForCellDirectRule(); + private static Sudoku sudoku; + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + sudoku = new Sudoku(); + } + @Test + public void LastNumberForCellDirectRule_FullRegionTest() throws InvalidFileFormatException { + //Import board and create transition + TestUtilities.importTestBoard("puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion", sudoku); + TreeNode rootNode = sudoku.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + for(int i = 1; i < 10; i++){ + //Reset board + SudokuBoard board = (SudokuBoard) transition.getBoard(); + //Set cell + SudokuCell cell1 = board.getCell(2, 5); + cell1.setData(i); + board.addModifiedData(cell1); + + //Test the case + if(i == 9) { + Assert.assertNull(RULE.checkRuleAt(transition, cell1)); + } else { + Assert.assertNotNull(RULE.checkRuleAt(transition, cell1)); + } + } + + } +} diff --git a/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion b/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion new file mode 100644 index 000000000..58fd02162 --- /dev/null +++ b/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + From 7e673c228cb1495a8635d8b3b249377e8f66734b Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:34:01 -0400 Subject: [PATCH 25/36] Create CorneredRegion --- .../LastCellForNumberDirectRule/CorneredRegion | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/CorneredRegion diff --git a/src/test/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/CorneredRegion b/src/test/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/CorneredRegion new file mode 100644 index 000000000..4d3c57225 --- /dev/null +++ b/src/test/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/CorneredRegion @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From 3ea0ab323d611c2c01f6651470bdfa8a75bdd45c Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:00:53 -0400 Subject: [PATCH 26/36] More Test Cases and Test Classes Implemented 2 new test cases for LastNumberForCell and made Class and Test Case for RepeatedNumber contradiction rule --- ...LastNumberForCellDirectRuleRegionTest.java | 46 ++++++++++++++++ .../RepeatedNumberContradictionRuleTest.java | 55 +++++++++++++++++++ .../LastNumberForCellDirectRule/FullMixed | 18 ++++++ .../rules/LastNumberForCellDirectRule/FullRow | 18 ++++++ .../BlankBoard | 11 ++++ 5 files changed, 148 insertions(+) create mode 100644 src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java create mode 100644 src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed create mode 100644 src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow create mode 100644 src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard diff --git a/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java b/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java index d47ee9a19..28406c1ab 100644 --- a/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java @@ -29,6 +29,7 @@ public void LastNumberForCellDirectRule_FullRegionTest() throws InvalidFileForma TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); + //Loop all numbers at point for(int i = 1; i < 10; i++){ //Reset board SudokuBoard board = (SudokuBoard) transition.getBoard(); @@ -45,5 +46,50 @@ public void LastNumberForCellDirectRule_FullRegionTest() throws InvalidFileForma } } + //Import Board and create transition + TestUtilities.importTestBoard("puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow", sudoku); + rootNode = sudoku.getTree().getRootNode(); + transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + //Loop all numbers at point + for(int i = 1; i < 10; i++){ + //Reset board + SudokuBoard board = (SudokuBoard) transition.getBoard(); + //Set cell + SudokuCell cell = board.getCell(4, 4); + cell.setData(i); + board.addModifiedData(cell); + + //Test the case + if(i == 5) { + Assert.assertNull(RULE.checkRuleAt(transition, cell)); + } else { + Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); + } + } + + //Import Board and create transition + TestUtilities.importTestBoard("puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed", sudoku); + rootNode = sudoku.getTree().getRootNode(); + transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + //Loop all numbers at point + for(int i = 1; i < 10; i++){ + //Reset board + SudokuBoard board = (SudokuBoard) transition.getBoard(); + //Set cell + SudokuCell cell = board.getCell(5, 3); + cell.setData(i); + board.addModifiedData(cell); + + //Test the case + if(i == 2) { + Assert.assertNull(RULE.checkRuleAt(transition, cell)); + } else { + Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); + } + } } } diff --git a/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java b/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java new file mode 100644 index 000000000..524509b26 --- /dev/null +++ b/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java @@ -0,0 +1,55 @@ +package puzzles.sudoku.rules; + +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.sudoku.Sudoku; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import edu.rpi.legup.puzzle.sudoku.rules.LastNumberForCellDirectRule; +import edu.rpi.legup.puzzle.sudoku.rules.RepeatedNumberContradictionRule; +import edu.rpi.legup.save.InvalidFileFormatException; +import legup.MockGameBoardFacade; +import legup.TestUtilities; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RepeatedNumberContradictionRuleTest { + private static final RepeatedNumberContradictionRule RULE = new RepeatedNumberContradictionRule(); + private static Sudoku sudoku; + @BeforeClass + public static void setUp() { + MockGameBoardFacade.getInstance(); + sudoku = new Sudoku(); + } + @Test + public void RepeatedNumberContradictionRule_GlobalTest() throws InvalidFileFormatException { + //Import board and create transition + TestUtilities.importTestBoard("puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard", sudoku); + TreeNode rootNode = sudoku.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + //Loop through every cell + for(int i = 0; i < 81; i++){ + //Reset board + SudokuBoard board = (SudokuBoard) transition.getBoard(); + //Set cell + int x = i / 9; + int y = i % 9; + if(x == 0 && y == 0) + continue; + SudokuCell cell = board.getCell(x, y); + cell.setData(7); + + //Test the case + if(x == 0 || y == 0 || (x < 3 && y < 3)){ + Assert.assertNull(RULE.checkRuleAt(transition, cell)); + } else { + Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); + } + cell.setData(0); + } + + } +} diff --git a/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed b/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed new file mode 100644 index 000000000..55b501fec --- /dev/null +++ b/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow b/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow new file mode 100644 index 000000000..07e502ed9 --- /dev/null +++ b/src/test/resources/puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard b/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard new file mode 100644 index 000000000..5692dea64 --- /dev/null +++ b/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard @@ -0,0 +1,11 @@ + + + + + + + + + + + From 077505de2660fc532e451452cb54c44b65863493 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:09:17 -0400 Subject: [PATCH 27/36] Added lastcellfornumber test --- .../LastCellForNumberDirectRule/TestBoard | 29 +++++++------- .../LastCellForNumberDirectRuleTest.java | 39 +++++++++++++++---- 2 files changed, 47 insertions(+), 21 deletions(-) diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard b/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard index 4a66f38fc..81a88d8f6 100644 --- a/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard +++ b/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard @@ -1,16 +1,19 @@ - - - + + + + - - - - - - - - + + + + + + + + + - - \ No newline at end of file + + + diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java index eff4feb93..f4531a893 100644 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -1,17 +1,20 @@ package puzzles.sudoku.rules; -import edu.rpi.legup.puzzle.nurikabe.Nurikabe; +import edu.rpi.legup.model.tree.TreeNode; +import edu.rpi.legup.model.tree.TreeTransition; +import edu.rpi.legup.puzzle.sudoku.Sudoku; +import edu.rpi.legup.puzzle.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import edu.rpi.legup.puzzle.sudoku.rules.LastNumberForCellDirectRule; import edu.rpi.legup.save.InvalidFileFormatException; import legup.MockGameBoardFacade; import legup.TestUtilities; +import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import edu.rpi.legup.puzzle.sudoku.Sudoku; -import edu.rpi.legup.puzzle.sudoku.rules.LastCellForNumberDirectRule; - -import static org.junit.Assert.*; public class LastCellForNumberDirectRuleTest { + private static final LastNumberForCellDirectRule RULE = new LastNumberForCellDirectRule(); private static Sudoku sudoku; @BeforeClass public static void setUp() { @@ -19,9 +22,29 @@ public static void setUp() { sudoku = new Sudoku(); } @Test - public void LastCellForNumberDirectRuleTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard("puzzles/sudoku/rules/LastCellForNumberRule/TestBoard", sudoku); - assertTrue(true); + public void LastNumberForCellDirectRuleTest() throws InvalidFileFormatException { + //Import board and create transition + + TestUtilities.importTestBoard("puzzles/sudoku/rules/LasCellForNumberDirectRule/TestBoard", sudoku); + TreeNode rootNode = sudoku.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + for(int i = 1; i < 10; i++){ + //Reset board + SudokuBoard board = (SudokuBoard) transition.getBoard(); + //Set cell + SudokuCell cell1 = board.getCell(2, 2); + cell1.setData(i); + board.addModifiedData(cell1); + + //Test the case + if(i == 9) { + Assert.assertNotNull(RULE.checkRuleAt(transition, cell1)); + } else { + Assert.assertNull(RULE.checkRuleAt(transition, cell1)); + } + } } } From 70de0d76fb8867c41655a537622e155bb74cb2a1 Mon Sep 17 00:00:00 2001 From: EggyMath <55564321+EggyMath@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:15:23 -0400 Subject: [PATCH 28/36] More Tests for RepeatedNumbers Added another test for RepeatedNumbers contradiction rule and fixed previous error. --- .../RepeatedNumberContradictionRuleTest.java | 33 +++++++++++++++++-- .../BlankBoard4 | 12 +++++++ .../{BlankBoard => BlankBoard7} | 0 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4 rename src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/{BlankBoard => BlankBoard7} (100%) diff --git a/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java b/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java index 524509b26..3a65fbd47 100644 --- a/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java @@ -5,7 +5,6 @@ import edu.rpi.legup.puzzle.sudoku.Sudoku; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; -import edu.rpi.legup.puzzle.sudoku.rules.LastNumberForCellDirectRule; import edu.rpi.legup.puzzle.sudoku.rules.RepeatedNumberContradictionRule; import edu.rpi.legup.save.InvalidFileFormatException; import legup.MockGameBoardFacade; @@ -25,7 +24,7 @@ public static void setUp() { @Test public void RepeatedNumberContradictionRule_GlobalTest() throws InvalidFileFormatException { //Import board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard", sudoku); + TestUtilities.importTestBoard("puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard7", sudoku); TreeNode rootNode = sudoku.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -37,8 +36,9 @@ public void RepeatedNumberContradictionRule_GlobalTest() throws InvalidFileForma //Set cell int x = i / 9; int y = i % 9; - if(x == 0 && y == 0) + if(x == 0 && y == 0) { continue; + } SudokuCell cell = board.getCell(x, y); cell.setData(7); @@ -50,6 +50,33 @@ public void RepeatedNumberContradictionRule_GlobalTest() throws InvalidFileForma } cell.setData(0); } + //Import board and create transition + TestUtilities.importTestBoard("puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4", sudoku); + rootNode = sudoku.getTree().getRootNode(); + transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + //Loop through every cell + for(int i = 0; i < 81; i++){ + //Reset board + SudokuBoard board = (SudokuBoard) transition.getBoard(); + //Set cell + int x = i / 9; + int y = i % 9; + if((x == 3 && y == 0) || (x == 6 && y == 8)) { + continue; + } + SudokuCell cell = board.getCell(x, y); + cell.setData(4); + + //Test the case + if((x == 3 || y == 0 || x == 6 || y == 8) || (x > 2 && x < 6 && y < 3) || (x > 5 && y > 5)){ + Assert.assertNull(RULE.checkRuleAt(transition, cell)); + } else { + Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); + } + cell.setData(0); + } } } diff --git a/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4 b/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4 new file mode 100644 index 000000000..abaa0ba6b --- /dev/null +++ b/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard b/src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard7 similarity index 100% rename from src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard rename to src/test/resources/puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard7 From 90e273accda5124d7b6f644ddef7aa0296e56805 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:21:34 -0400 Subject: [PATCH 29/36] fixed test file, LastCellForNumberDirectRuleTest --- .../rules/LastCellForNumberDirectRule/TestBoard | 16 ++++++++-------- .../rules/LastCellForNumberDirectRuleTest.java | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard b/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard index 81a88d8f6..a41ad749c 100644 --- a/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard +++ b/output_path/test/src/resources/puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard @@ -3,14 +3,14 @@ - - - - - - - - + + + + + + + + diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java index f4531a893..8b3e96a79 100644 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -5,7 +5,7 @@ import edu.rpi.legup.puzzle.sudoku.Sudoku; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; -import edu.rpi.legup.puzzle.sudoku.rules.LastNumberForCellDirectRule; +import edu.rpi.legup.puzzle.sudoku.rules.LastCellForNumberDirectRule; import edu.rpi.legup.save.InvalidFileFormatException; import legup.MockGameBoardFacade; import legup.TestUtilities; @@ -14,7 +14,7 @@ import org.junit.Test; public class LastCellForNumberDirectRuleTest { - private static final LastNumberForCellDirectRule RULE = new LastNumberForCellDirectRule(); + private static final LastCellForNumberDirectRule RULE = new LastCellForNumberDirectRule(); private static Sudoku sudoku; @BeforeClass public static void setUp() { @@ -22,10 +22,10 @@ public static void setUp() { sudoku = new Sudoku(); } @Test - public void LastNumberForCellDirectRuleTest() throws InvalidFileFormatException { + public void LastCellForNumberDirectRuleTest() throws InvalidFileFormatException { //Import board and create transition - - TestUtilities.importTestBoard("puzzles/sudoku/rules/LasCellForNumberDirectRule/TestBoard", sudoku); + //puzzles\sudoku\rules\LastCellForNumberDirectRule\TestBoard + TestUtilities.importTestBoard("puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard", sudoku); TreeNode rootNode = sudoku.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); From 4d78d84fd6de263242a6bf63f4c3ee98d4c55bb2 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:27:07 -0400 Subject: [PATCH 30/36] this does nothing its forcing me to do this --- .../puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java index 8b3e96a79..a2c3ba63f 100644 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java @@ -24,7 +24,6 @@ public static void setUp() { @Test public void LastCellForNumberDirectRuleTest() throws InvalidFileFormatException { //Import board and create transition - //puzzles\sudoku\rules\LastCellForNumberDirectRule\TestBoard TestUtilities.importTestBoard("puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard", sudoku); TreeNode rootNode = sudoku.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); From d0ae7e54ca09f6d507b0fbab9aa3a22bfa5fb45f Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:40:23 -0400 Subject: [PATCH 31/36] Delete LastCellForNumberDirectRuleTest.java --- .../LastCellForNumberDirectRuleTest.java | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java diff --git a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java b/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java deleted file mode 100644 index a2c3ba63f..000000000 --- a/src/test/java/puzzles/sudoku/rules/LastCellForNumberDirectRuleTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package puzzles.sudoku.rules; - -import edu.rpi.legup.model.tree.TreeNode; -import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.sudoku.Sudoku; -import edu.rpi.legup.puzzle.sudoku.SudokuBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuCell; -import edu.rpi.legup.puzzle.sudoku.rules.LastCellForNumberDirectRule; -import edu.rpi.legup.save.InvalidFileFormatException; -import legup.MockGameBoardFacade; -import legup.TestUtilities; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class LastCellForNumberDirectRuleTest { - private static final LastCellForNumberDirectRule RULE = new LastCellForNumberDirectRule(); - private static Sudoku sudoku; - @BeforeClass - public static void setUp() { - MockGameBoardFacade.getInstance(); - sudoku = new Sudoku(); - } - @Test - public void LastCellForNumberDirectRuleTest() throws InvalidFileFormatException { - //Import board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/LastCellForNumberDirectRule/TestBoard", sudoku); - TreeNode rootNode = sudoku.getTree().getRootNode(); - TreeTransition transition = rootNode.getChildren().get(0); - transition.setRule(RULE); - - for(int i = 1; i < 10; i++){ - //Reset board - SudokuBoard board = (SudokuBoard) transition.getBoard(); - //Set cell - SudokuCell cell1 = board.getCell(2, 2); - cell1.setData(i); - board.addModifiedData(cell1); - - //Test the case - if(i == 9) { - Assert.assertNotNull(RULE.checkRuleAt(transition, cell1)); - } else { - Assert.assertNull(RULE.checkRuleAt(transition, cell1)); - } - } - - } -} From 9c80334ac5243e6e12d4cf8299de764b1fb8e625 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:53:50 -0400 Subject: [PATCH 32/36] funny number change --- .../rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt index 3f9e62cc8..ceffa168c 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt @@ -5,7 +5,7 @@ SUDO-CONT-0001 : NoCellForNumberRegionContradictionRule SUDO-CONT-0002 : NoCellForNumberRowContradictionRule SUDO-CONT-0003 : NoCellForNumberColumnContradictionRule SUDO-CONT-0004 : NoNumberForCellContradictionRule -SUDO-CONT-0002 : RepeatedNumberContradictionRule +SUDO-CONT-0005 : RepeatedNumberContradictionRule SUDO-CASE-0001 : PossibleNumbersForCellCaseRule SUDO-CASE-0002 : PossibleCellsForNumberRegionCaseRule From 31c3ead782ad72634e4dca03724aa46e5e51262c Mon Sep 17 00:00:00 2001 From: Bram van Heuveln Date: Tue, 16 Apr 2024 20:55:38 +0000 Subject: [PATCH 33/36] Automated Java code formatting changes --- .../sudoku/PossibleNumberCaseBoard.java | 4 +- .../rules/LastCellForNumberDirectRule.java | 374 +++++++++--------- .../rules/LastNumberForCellDirectRule.java | 183 ++++----- ...oCellForNumberColumnContradictionRule.java | 40 +- ...oCellForNumberRegionContradictionRule.java | 40 +- .../NoCellForNumberRowContradictionRule.java | 40 +- .../NoNumberForCellContradictionRule.java | 14 +- .../PossibleCellsForNumberColumnCaseRule.java | 35 +- .../PossibleCellsForNumberRegionCaseRule.java | 35 +- .../PossibleCellsForNumberRowCaseRule.java | 22 +- .../rules/PossibleNumbersForCellCaseRule.java | 6 +- .../RepeatedNumberContradictionRule.java | 14 +- src/test/java/legup/TestRunner.java | 1 - ...LastNumberForCellDirectRuleRegionTest.java | 53 +-- .../RepeatedNumberContradictionRuleTest.java | 46 ++- 15 files changed, 474 insertions(+), 433 deletions(-) diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java index 5c94e3e0b..c5f9eec2a 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/PossibleNumberCaseBoard.java @@ -3,7 +3,6 @@ import edu.rpi.legup.model.gameboard.CaseBoard; import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.puzzle.sudoku.rules.PossibleCellsForNumberRegionCaseRule; - import java.awt.event.MouseEvent; import java.util.HashSet; import java.util.Set; @@ -15,7 +14,8 @@ public class PossibleNumberCaseBoard extends CaseBoard { private Set pickableRows; private Set pickableCols; - public PossibleNumberCaseBoard(SudokuBoard baseBoard, PossibleCellsForNumberRegionCaseRule caseRule, SudokuCell cell) { + public PossibleNumberCaseBoard( + SudokuBoard baseBoard, PossibleCellsForNumberRegionCaseRule caseRule, SudokuCell cell) { super(baseBoard, caseRule); this.cell = cell; this.pickableRegions = new HashSet<>(); diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java index f9b1e2e28..f5646a3c0 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java @@ -1,185 +1,189 @@ - -package edu.rpi.legup.puzzle.sudoku.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.sudoku.SudokuBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuCell; - -import java.util.Set; - -public class LastCellForNumberDirectRule extends DirectRule { - public LastCellForNumberDirectRule() { - super("SUDO-BASC-0002", "Last Cell for Number", - "This is the only cell open in its group for some number.", - "edu/rpi/legup/images/sudoku/forcedByElimination.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - SudokuBoard initialBoard = (SudokuBoard) transition.getParents().get(0).getBoard(); - SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); - - SudokuCell cell = (SudokuCell) finalBoard.getPuzzleElement(puzzleElement); - - //Check if empty cell placed - if (cell.getData() == 0) { - return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; - } - - //Get defaults - Set region = initialBoard.getRegion(cell.getGroupIndex()); - Set row = initialBoard.getRow(cell.getLocation().y); - Set col = initialBoard.getCol(cell.getLocation().x); - - //Check if new cell conflicts group - for(SudokuCell c : region){ - if(c.getData() == cell.getData()) { - return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; - } - } - for(SudokuCell c : row){ - if(c.getData() == cell.getData()) { - return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; - } - } - for(SudokuCell c : col){ - if(c.getData() == cell.getData()) { - return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; - } - } - - //// - //Loop to see if the number is constrained to the cell - boolean restrained = true; - for(SudokuCell c : region){ - //Test if its not a valid testing cell - if(c.getData() != 0) { - continue; - } - if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) { - continue; - } - //Check if cell is eligible to hold number - Set crow = initialBoard.getRow(c.getLocation().y); - Set ccol = initialBoard.getCol(c.getLocation().x); - boolean contains = false; - for(SudokuCell rc : crow){ - if(rc.getData() == cell.getData()) { - contains = true; - } - } - for(SudokuCell cc : ccol){ - if(cc.getData() == cell.getData()) { - contains = true; - } - } - //Stop if another cell can hold number - if(!contains) { - restrained = false; - break; - } - } - //Output if success - if(restrained) { - return null; - } - - //// - //Loop to see if the number is constrained to the cell - restrained = true; - for(SudokuCell c : row){ - //Test if its not a valid testing cell - if(c.getData() != 0) { - continue; - } - if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) { - continue; - } - //Check if cell is eligible to hold number - Set cregion = initialBoard.getRegion(c.getGroupIndex()); - Set ccol = initialBoard.getCol(c.getLocation().x); - boolean contains = false; - for(SudokuCell rc : cregion){ - if(rc.getData() == cell.getData()) { - contains = true; - } - } - for(SudokuCell cc : ccol){ - if(cc.getData() == cell.getData()) { - contains = true; - } - } - //Stop if another cell can hold number - if(!contains) { - restrained = false; - break; - } - } - //Output if success - if(restrained) { - return null; - } - - //// - //Loop to see if the number is constrained to the cell - restrained = true; - for(SudokuCell c : col){ - //Test if its not a valid testing cell - if(c.getData() != 0) { - continue; - } - if(c.getLocation().y == cell.getLocation().y && c.getLocation().x == cell.getLocation().x) { - continue; - } - //Check if cell is eligible to hold number - Set cregion = initialBoard.getRegion(c.getGroupIndex()); - Set crow = initialBoard.getRow(c.getLocation().y); - boolean contains = false; - for(SudokuCell rc : cregion){ - if(rc.getData() == cell.getData()) { - contains = true; - } - } - for(SudokuCell cc : crow){ - if(cc.getData() == cell.getData()) { - contains = true; - } - } - //Stop if another cell can hold number - if(!contains) { - restrained = false; - break; - } - } - //Output if success - if(restrained) { - return null; - } - - //Output fail - return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - return null; - } -} \ No newline at end of file +package edu.rpi.legup.puzzle.sudoku.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.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import java.util.Set; + +public class LastCellForNumberDirectRule extends DirectRule { + public LastCellForNumberDirectRule() { + super( + "SUDO-BASC-0002", + "Last Cell for Number", + "This is the only cell open in its group for some number.", + "edu/rpi/legup/images/sudoku/forcedByElimination.png"); + } + + /** + * Checks whether the child node logically follows from the parent node at the specific + * puzzleElement index using this rule + * + * @param transition transition to check + * @param puzzleElement equivalent puzzleElement + * @return null if the child node logically follow from the parent node at the specified + * puzzleElement, otherwise error message + */ + public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { + SudokuBoard initialBoard = (SudokuBoard) transition.getParents().get(0).getBoard(); + SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); + + SudokuCell cell = (SudokuCell) finalBoard.getPuzzleElement(puzzleElement); + + // Check if empty cell placed + if (cell.getData() == 0) { + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + + // Get defaults + Set region = initialBoard.getRegion(cell.getGroupIndex()); + Set row = initialBoard.getRow(cell.getLocation().y); + Set col = initialBoard.getCol(cell.getLocation().x); + + // Check if new cell conflicts group + for (SudokuCell c : region) { + if (c.getData() == cell.getData()) { + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + } + for (SudokuCell c : row) { + if (c.getData() == cell.getData()) { + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + } + for (SudokuCell c : col) { + if (c.getData() == cell.getData()) { + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + } + + // // + // Loop to see if the number is constrained to the cell + boolean restrained = true; + for (SudokuCell c : region) { + // Test if its not a valid testing cell + if (c.getData() != 0) { + continue; + } + if (c.getLocation().y == cell.getLocation().y + && c.getLocation().x == cell.getLocation().x) { + continue; + } + // Check if cell is eligible to hold number + Set crow = initialBoard.getRow(c.getLocation().y); + Set ccol = initialBoard.getCol(c.getLocation().x); + boolean contains = false; + for (SudokuCell rc : crow) { + if (rc.getData() == cell.getData()) { + contains = true; + } + } + for (SudokuCell cc : ccol) { + if (cc.getData() == cell.getData()) { + contains = true; + } + } + // Stop if another cell can hold number + if (!contains) { + restrained = false; + break; + } + } + // Output if success + if (restrained) { + return null; + } + + // // + // Loop to see if the number is constrained to the cell + restrained = true; + for (SudokuCell c : row) { + // Test if its not a valid testing cell + if (c.getData() != 0) { + continue; + } + if (c.getLocation().y == cell.getLocation().y + && c.getLocation().x == cell.getLocation().x) { + continue; + } + // Check if cell is eligible to hold number + Set cregion = initialBoard.getRegion(c.getGroupIndex()); + Set ccol = initialBoard.getCol(c.getLocation().x); + boolean contains = false; + for (SudokuCell rc : cregion) { + if (rc.getData() == cell.getData()) { + contains = true; + } + } + for (SudokuCell cc : ccol) { + if (cc.getData() == cell.getData()) { + contains = true; + } + } + // Stop if another cell can hold number + if (!contains) { + restrained = false; + break; + } + } + // Output if success + if (restrained) { + return null; + } + + // // + // Loop to see if the number is constrained to the cell + restrained = true; + for (SudokuCell c : col) { + // Test if its not a valid testing cell + if (c.getData() != 0) { + continue; + } + if (c.getLocation().y == cell.getLocation().y + && c.getLocation().x == cell.getLocation().x) { + continue; + } + // Check if cell is eligible to hold number + Set cregion = initialBoard.getRegion(c.getGroupIndex()); + Set crow = initialBoard.getRow(c.getLocation().y); + boolean contains = false; + for (SudokuCell rc : cregion) { + if (rc.getData() == cell.getData()) { + contains = true; + } + } + for (SudokuCell cc : crow) { + if (cc.getData() == cell.getData()) { + contains = true; + } + } + // Stop if another cell can hold number + if (!contains) { + restrained = false; + break; + } + } + // Output if success + if (restrained) { + return null; + } + + // Output fail + return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index"; + } + + /** + * Creates a transition {@link Board} that has this rule applied to it using the {@link + * TreeNode}. + * + * @param node tree node used to create default transition board + * @return default board or null if this rule cannot be applied to this tree node + */ + @Override + public Board getDefaultBoard(TreeNode node) { + return null; + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java index 888f000ff..9f6f465dd 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java @@ -1,89 +1,94 @@ -package edu.rpi.legup.puzzle.sudoku.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.sudoku.SudokuBoard; -import edu.rpi.legup.puzzle.sudoku.SudokuCell; - -import java.util.HashSet; - -public class LastNumberForCellDirectRule extends DirectRule { - - public LastNumberForCellDirectRule() { - super("SUDO-BASC-0003", "Last Number for Cell", - "This is the only number left that can fit in the cell of a group.", - "edu/rpi/legup/images/sudoku/forcedByDeduction.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - SudokuBoard initialBoard = (SudokuBoard) transition.getParents().get(0).getBoard(); - SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); - - //Assign basics - int groupSize = initialBoard.getWidth(); - int groupDim = (int) Math.sqrt(groupSize); - - //Get position info - int index = puzzleElement.getIndex(); - int rowIndex = index / groupSize; - int colIndex = index % groupSize; - int groupNum = (rowIndex / groupDim) * groupDim + (colIndex / groupDim); - - //Create hashset of all numbers - HashSet numbers = new HashSet<>(); - for (int i = 1; i <= groupSize; i++) { - numbers.add(i); - } - - //Run through region, row, col to see contradicitng numbers - for (int i = 0; i < groupSize; i++) { - SudokuCell cell = initialBoard.getCell(groupNum, i % groupDim, i / groupDim); - numbers.remove(cell.getData()); - } - for (int i = 0; i < groupSize; i++) { - SudokuCell cell = initialBoard.getCell(i, rowIndex); - numbers.remove(cell.getData()); - } - for (int i = 0; i < groupSize; i++) { - SudokuCell cell = initialBoard.getCell(colIndex, i); - numbers.remove(cell.getData()); - } - - //Check if plausible - if (numbers.size() > 1) { - return super.getInvalidUseOfRuleMessage() + ": The number at the index is not forced"; - } - else { - if (numbers.size() == 1 && numbers.iterator().next() != finalBoard.getPuzzleElement(puzzleElement).getData()) { - return super.getInvalidUseOfRuleMessage() + ": The number at the index is forced but not correct"; - } - } - if(numbers.toArray(new Integer[1])[0] == puzzleElement.getData()) { - return null; - } - return super.getInvalidUseOfRuleMessage() + ": The number at the index is forced but not correct"; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - return null; - } -} +package edu.rpi.legup.puzzle.sudoku.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.sudoku.SudokuBoard; +import edu.rpi.legup.puzzle.sudoku.SudokuCell; +import java.util.HashSet; + +public class LastNumberForCellDirectRule extends DirectRule { + + public LastNumberForCellDirectRule() { + super( + "SUDO-BASC-0003", + "Last Number for Cell", + "This is the only number left that can fit in the cell of a group.", + "edu/rpi/legup/images/sudoku/forcedByDeduction.png"); + } + + /** + * Checks whether the child node logically follows from the parent node at the specific + * puzzleElement index using this rule + * + * @param transition transition to check + * @param puzzleElement equivalent puzzleElement + * @return null if the child node logically follow from the parent node at the specified + * puzzleElement, otherwise error message + */ + public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { + SudokuBoard initialBoard = (SudokuBoard) transition.getParents().get(0).getBoard(); + SudokuBoard finalBoard = (SudokuBoard) transition.getBoard(); + + // Assign basics + int groupSize = initialBoard.getWidth(); + int groupDim = (int) Math.sqrt(groupSize); + + // Get position info + int index = puzzleElement.getIndex(); + int rowIndex = index / groupSize; + int colIndex = index % groupSize; + int groupNum = (rowIndex / groupDim) * groupDim + (colIndex / groupDim); + + // Create hashset of all numbers + HashSet numbers = new HashSet<>(); + for (int i = 1; i <= groupSize; i++) { + numbers.add(i); + } + + // Run through region, row, col to see contradicitng numbers + for (int i = 0; i < groupSize; i++) { + SudokuCell cell = initialBoard.getCell(groupNum, i % groupDim, i / groupDim); + numbers.remove(cell.getData()); + } + for (int i = 0; i < groupSize; i++) { + SudokuCell cell = initialBoard.getCell(i, rowIndex); + numbers.remove(cell.getData()); + } + for (int i = 0; i < groupSize; i++) { + SudokuCell cell = initialBoard.getCell(colIndex, i); + numbers.remove(cell.getData()); + } + + // Check if plausible + if (numbers.size() > 1) { + return super.getInvalidUseOfRuleMessage() + ": The number at the index is not forced"; + } else { + if (numbers.size() == 1 + && numbers.iterator().next() + != finalBoard.getPuzzleElement(puzzleElement).getData()) { + return super.getInvalidUseOfRuleMessage() + + ": The number at the index is forced but not correct"; + } + } + if (numbers.toArray(new Integer[1])[0] == puzzleElement.getData()) { + return null; + } + return super.getInvalidUseOfRuleMessage() + + ": The number at the index is forced but not correct"; + } + + /** + * Creates a transition {@link Board} that has this rule applied to it using the {@link + * TreeNode}. + * + * @param node tree node used to create default transition board + * @return default board or null if this rule cannot be applied to this tree node + */ + @Override + public Board getDefaultBoard(TreeNode node) { + return null; + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java index 4cf076892..86d2c8dac 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberColumnContradictionRule.java @@ -5,25 +5,27 @@ import edu.rpi.legup.model.rules.ContradictionRule; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; - import java.util.HashSet; import java.util.Set; public class NoCellForNumberColumnContradictionRule extends ContradictionRule { public NoCellForNumberColumnContradictionRule() { - super("SUDO-CONT-0003", "No Cell for Number (Column)", + super( + "SUDO-CONT-0003", + "No Cell for Number (Column)", "Process of elimination yields no valid numbers for an empty cell in a column.", "edu/rpi/legup/images/sudoku/NoCellForNumberColumn.png"); } /** - * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule + * Checks whether the transition has a contradiction at the specific puzzleElement index using + * this rule * - * @param board board to check contradiction + * @param board board to check contradiction * @param puzzleElement equivalent puzzleElement * @return null if the transition contains a contradiction at the specified puzzleElement, - * otherwise error message + * otherwise error message */ @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { @@ -42,44 +44,44 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { numbersNotInColumn.add(i); } for (SudokuCell c : col) { - if(c.getData() != 0) { + if (c.getData() != 0) { numbersNotInColumn.remove(c.getData()); } } for (Integer i : numbersNotInColumn) { - //Check if number can be in cell + // Check if number can be in cell boolean canFit = false; - for(SudokuCell c : col){ - if(c.getData() != 0) { + for (SudokuCell c : col) { + if (c.getData() != 0) { continue; } - //Get row and col groups + // Get row and col groups Set region = sudokuBoard.getRow(c.getLocation().y); Set row = sudokuBoard.getCol(c.getLocation().x); - //Check if it alr exists in row or col + // Check if it alr exists in row or col boolean duplicate = false; - for(SudokuCell rc : region) { - if(rc.getData() == i) { + for (SudokuCell rc : region) { + if (rc.getData() == i) { duplicate = true; } } - for(SudokuCell cc : row) { - if(cc.getData() == i) { + for (SudokuCell cc : row) { + if (cc.getData() == i) { duplicate = true; } } - //If there is no duplicate it can exist in the region - if(!duplicate) { + // If there is no duplicate it can exist in the region + if (!duplicate) { canFit = true; break; } } - //If the number can't fit anywhere in region then contradiction - if(!canFit) { + // If the number can't fit anywhere in region then contradiction + if (!canFit) { return null; } } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java index 9923bd207..714395cab 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRegionContradictionRule.java @@ -5,25 +5,27 @@ import edu.rpi.legup.model.rules.ContradictionRule; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; - import java.util.HashSet; import java.util.Set; public class NoCellForNumberRegionContradictionRule extends ContradictionRule { public NoCellForNumberRegionContradictionRule() { - super("SUDO-CONT-0001", "No Cell for Number (Region)", + super( + "SUDO-CONT-0001", + "No Cell for Number (Region)", "Process of elimination yields no valid numbers for an empty cell in a region.", "edu/rpi/legup/images/sudoku/NoCellForNumberRegion.png"); } /** - * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule + * Checks whether the transition has a contradiction at the specific puzzleElement index using + * this rule * - * @param board board to check contradiction + * @param board board to check contradiction * @param puzzleElement equivalent puzzleElement * @return null if the transition contains a contradiction at the specified puzzleElement, - * otherwise error message + * otherwise error message */ @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { @@ -42,44 +44,44 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { numbersNotInRegion.add(i); } for (SudokuCell c : region) { - if(c.getData() != 0) { + if (c.getData() != 0) { numbersNotInRegion.remove(c.getData()); } } for (Integer i : numbersNotInRegion) { - //Check if number can be in cell + // Check if number can be in cell boolean canFit = false; - for(SudokuCell c : region){ - if(c.getData() != 0) { + for (SudokuCell c : region) { + if (c.getData() != 0) { continue; } - //Get row and col groups + // Get row and col groups Set row = sudokuBoard.getRow(c.getLocation().y); Set col = sudokuBoard.getCol(c.getLocation().x); - //Check if it alr exists in row or col + // Check if it alr exists in row or col boolean duplicate = false; - for(SudokuCell rc : row) { - if(rc.getData() == i) { + for (SudokuCell rc : row) { + if (rc.getData() == i) { duplicate = true; } } - for(SudokuCell cc : col) { - if(cc.getData() == i) { + for (SudokuCell cc : col) { + if (cc.getData() == i) { duplicate = true; } } - //If there is no duplicate it can exist in the region - if(!duplicate) { + // If there is no duplicate it can exist in the region + if (!duplicate) { canFit = true; break; } } - //If the number can't fit anywhere in region then contradiction - if(!canFit) { + // If the number can't fit anywhere in region then contradiction + if (!canFit) { return null; } } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java index 6e8616a9f..e768405fd 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoCellForNumberRowContradictionRule.java @@ -5,25 +5,27 @@ import edu.rpi.legup.model.rules.ContradictionRule; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; - import java.util.HashSet; import java.util.Set; public class NoCellForNumberRowContradictionRule extends ContradictionRule { public NoCellForNumberRowContradictionRule() { - super("SUDO-CONT-0002", "No Cell for Number (Row)", + super( + "SUDO-CONT-0002", + "No Cell for Number (Row)", "Process of elimination yields no valid numbers for an empty cell in a row.", "edu/rpi/legup/images/sudoku/NoCellForNumberRow.png"); } /** - * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule + * Checks whether the transition has a contradiction at the specific puzzleElement index using + * this rule * - * @param board board to check contradiction + * @param board board to check contradiction * @param puzzleElement equivalent puzzleElement * @return null if the transition contains a contradiction at the specified puzzleElement, - * otherwise error message + * otherwise error message */ @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { @@ -42,44 +44,44 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { numbersNotInRow.add(i); } for (SudokuCell c : row) { - if(c.getData() != 0) { + if (c.getData() != 0) { numbersNotInRow.remove(c.getData()); } } for (Integer i : numbersNotInRow) { - //Check if number can be in cell + // Check if number can be in cell boolean canFit = false; - for(SudokuCell c : row){ - if(c.getData() != 0) { + for (SudokuCell c : row) { + if (c.getData() != 0) { continue; } - //Get row and col groups + // Get row and col groups Set region = sudokuBoard.getRow(c.getLocation().y); Set col = sudokuBoard.getCol(c.getLocation().x); - //Check if it alr exists in row or col + // Check if it alr exists in row or col boolean duplicate = false; - for(SudokuCell rc : region) { - if(rc.getData() == i) { + for (SudokuCell rc : region) { + if (rc.getData() == i) { duplicate = true; } } - for(SudokuCell cc : col) { - if(cc.getData() == i) { + for (SudokuCell cc : col) { + if (cc.getData() == i) { duplicate = true; } } - //If there is no duplicate it can exist in the region - if(!duplicate) { + // If there is no duplicate it can exist in the region + if (!duplicate) { canFit = true; break; } } - //If the number can't fit anywhere in region then contradiction - if(!canFit) { + // If the number can't fit anywhere in region then contradiction + if (!canFit) { return null; } } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java index b4e4e7a5f..a4646c45e 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/NoNumberForCellContradictionRule.java @@ -11,8 +11,10 @@ public class NoNumberForCellContradictionRule extends ContradictionRule { public NoNumberForCellContradictionRule() { - super("SUDO-CONT-0004", "No Number for Cell", - "Process of elimination yields no valid numbers for an empty cell.", + super( + "SUDO-CONT-0004", + "No Number for Cell", + "Process of elimination yields no valid numbers for an empty cell.", "edu/rpi/legup/images/sudoku/NoSolution.png"); } @@ -39,19 +41,19 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { Set row = sudokuBoard.getRow(cell.getLocation().y); Set col = sudokuBoard.getCol(cell.getLocation().x); Set solution = new HashSet<>(); - for(SudokuCell s : region) { + for (SudokuCell s : region) { solution.add(s.getData()); } - for(SudokuCell s : row) { + for (SudokuCell s : row) { solution.add(s.getData()); } - for(SudokuCell s : col) { + for (SudokuCell s : col) { solution.add(s.getData()); } solution.remove(0); - if(solution.size() == 9) { + if (solution.size() == 9) { return null; } diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java index b6ea1be21..9c4045fbb 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberColumnCaseRule.java @@ -9,19 +9,21 @@ import edu.rpi.legup.puzzle.sudoku.ModelSudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuBoard; import edu.rpi.legup.puzzle.sudoku.SudokuCell; - import java.util.ArrayList; import java.util.Set; public class PossibleCellsForNumberColumnCaseRule extends CaseRule { - //Board math for translating indexes to numbers + // Board math for translating indexes to numbers private ModelSudokuBoard model = new ModelSudokuBoard(); - //Old board for caseBoard reference + // Old board for caseBoard reference private SudokuBoard lagBoard; + public PossibleCellsForNumberColumnCaseRule() { - super("SUDO-CASE-0004", "Possible Cells for Number - Column", + super( + "SUDO-CASE-0004", + "Possible Cells for Number - Column", "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/possible_cells_number_column.png"); } @@ -38,13 +40,13 @@ public String checkRuleRaw(TreeTransition transition) { } /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule + * Checks whether the child node logically follows from the parent node at the specific + * puzzleElement index using this rule * - * @param transition transition to check + * @param transition transition to check * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message + * @return null if the child node logically follow from the parent node at the specified + * puzzleElement, otherwise error message */ @Override public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { @@ -66,7 +68,7 @@ public CaseBoard getCaseBoard(Board board) { /** * Gets the possible cases at a specific location based on this case rule * - * @param board the current board state + * @param board the current board state * @param puzzleElement equivalent puzzleElement * @return a list of elements the specified could be */ @@ -78,20 +80,21 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement) { /** * Gets the possible cases at a specific location based on this case rule * - * @param board the current board state + * @param board the current board state * @param puzzleElement equivalent puzzleElement - * @param value value that the rule will be applied from - * @param groupType group type + * @param value value that the rule will be applied from + * @param groupType group type * @return a list of elements the specified could be */ - public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { + public ArrayList getCases( + Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { ArrayList cases = new ArrayList<>(); SudokuBoard sudokuBoard = lagBoard; SudokuCell sourceCell = (SudokuCell) puzzleElement; Set group = sudokuBoard.getCol(sourceCell.getLocation().x); - for (SudokuCell cell : group){ - if(cell.getData() == 0){ + for (SudokuCell cell : group) { + if (cell.getData() == 0) { Board newCase = sudokuBoard.copy(); PuzzleElement element = newCase.getPuzzleElement(cell); element.setData(model.getModelColumnNumbers(sourceCell.getIndex())); diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java index f12a9fb0b..43f27e888 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRegionCaseRule.java @@ -6,19 +6,21 @@ import edu.rpi.legup.model.rules.CaseRule; import edu.rpi.legup.model.tree.TreeTransition; import edu.rpi.legup.puzzle.sudoku.*; - import java.util.ArrayList; import java.util.Set; public class PossibleCellsForNumberRegionCaseRule extends CaseRule { - //Board math for translating indexes to numbers + // Board math for translating indexes to numbers private ModelSudokuBoard model = new ModelSudokuBoard(); - //Old board for caseBoard reference + // Old board for caseBoard reference private SudokuBoard lagBoard; + public PossibleCellsForNumberRegionCaseRule() { - super("SUDO-CASE-0002", "Possible Cells for Number - Region", + super( + "SUDO-CASE-0002", + "Possible Cells for Number - Region", "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/possible_cells_number_region.png"); } @@ -35,13 +37,13 @@ public String checkRuleRaw(TreeTransition transition) { } /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule + * Checks whether the child node logically follows from the parent node at the specific + * puzzleElement index using this rule * - * @param transition transition to check + * @param transition transition to check * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message + * @return null if the child node logically follow from the parent node at the specified + * puzzleElement, otherwise error message */ @Override public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { @@ -63,7 +65,7 @@ public CaseBoard getCaseBoard(Board board) { /** * Gets the possible cases at a specific location based on this case rule * - * @param board the current board state + * @param board the current board state * @param puzzleElement equivalent puzzleElement * @return a list of elements the specified could be */ @@ -75,20 +77,21 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement) { /** * Gets the possible cases at a specific location based on this case rule * - * @param board the current board state + * @param board the current board state * @param puzzleElement equivalent puzzleElement - * @param value value that the rule will be applied from - * @param groupType group type + * @param value value that the rule will be applied from + * @param groupType group type * @return a list of elements the specified could be */ - public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { + public ArrayList getCases( + Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { ArrayList cases = new ArrayList<>(); SudokuBoard sudokuBoard = lagBoard; SudokuCell sourceCell = (SudokuCell) puzzleElement; Set group = sudokuBoard.getRegion(sourceCell.getGroupIndex()); - for (SudokuCell cell : group){ - if(cell.getData() == 0){ + for (SudokuCell cell : group) { + if (cell.getData() == 0) { Board newCase = sudokuBoard.copy(); PuzzleElement element = newCase.getPuzzleElement(cell); element.setData(model.getModelRegionNumbers(sourceCell.getIndex())); diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java index 60e866523..5308b84fa 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleCellsForNumberRowCaseRule.java @@ -14,13 +14,16 @@ public class PossibleCellsForNumberRowCaseRule extends CaseRule { - //Board math for translating indexes to numbers + // Board math for translating indexes to numbers private ModelSudokuBoard model = new ModelSudokuBoard(); - //Old board for caseBoard reference + // Old board for caseBoard reference private SudokuBoard lagBoard; + public PossibleCellsForNumberRowCaseRule() { - super("SUDO-CASE-0003", "Possible Cells for Number - Row", + super( + "SUDO-CASE-0003", + "Possible Cells for Number - Row", "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/possible_cells_number_row.png"); } @@ -77,20 +80,21 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement) { /** * Gets the possible cases at a specific location based on this case rule * - * @param board the current board state + * @param board the current board state * @param puzzleElement equivalent puzzleElement - * @param value value that the rule will be applied from - * @param groupType group type + * @param value value that the rule will be applied from + * @param groupType group type * @return a list of elements the specified could be */ - public ArrayList getCases(Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { + public ArrayList getCases( + Board board, PuzzleElement puzzleElement, int value, GroupType groupType) { ArrayList cases = new ArrayList<>(); SudokuBoard sudokuBoard = lagBoard; SudokuCell sourceCell = (SudokuCell) puzzleElement; Set group = sudokuBoard.getRow(sourceCell.getLocation().y); - for (SudokuCell cell : group){ - if(cell.getData() == 0){ + for (SudokuCell cell : group) { + if (cell.getData() == 0) { Board newCase = sudokuBoard.copy(); PuzzleElement element = newCase.getPuzzleElement(cell); element.setData(model.getModelRowNumbers(sourceCell.getIndex())); diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java index e5d22f9a6..fbdc23b65 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/PossibleNumbersForCellCaseRule.java @@ -8,12 +8,13 @@ import edu.rpi.legup.puzzle.sudoku.*; import java.util.ArrayList; import java.util.List; -import java.util.Set; public class PossibleNumbersForCellCaseRule extends CaseRule { public PossibleNumbersForCellCaseRule() { - super("SUDO-CASE-0001", "Possible Numbers for Cell", + super( + "SUDO-CASE-0001", + "Possible Numbers for Cell", "An empty cell has a limited set of possible numbers that can fill it.", "edu/rpi/legup/images/sudoku/PossibleValues.png"); } @@ -54,6 +55,7 @@ public CaseBoard getCaseBoard(Board board) { } return caseBoard; } + /** * Gets the possible cases at a specific location based on this case rule * diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java index d613edf59..4dcf95d63 100644 --- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/RepeatedNumberContradictionRule.java @@ -11,7 +11,9 @@ public class RepeatedNumberContradictionRule extends ContradictionRule { public RepeatedNumberContradictionRule() { - super("SUDO-CONT-0005", "Repeated Numbers", + super( + "SUDO-CONT-0005", + "Repeated Numbers", "Two identical numbers are placed in the same group.", "edu/rpi/legup/images/sudoku/RepeatedNumber.png"); } @@ -27,12 +29,12 @@ public RepeatedNumberContradictionRule() { */ @Override public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { - //Get board to check + // Get board to check SudokuBoard sudokuBoard = (SudokuBoard) board; - //Loop all group indexes - for(int i = 0; i < 9; i++) { - //Get regions and sets to check duplicates + // Loop all group indexes + for (int i = 0; i < 9; i++) { + // Get regions and sets to check duplicates Set region = sudokuBoard.getRegion(i); Set regionDup = new HashSet<>(); @@ -42,7 +44,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { Set col = sudokuBoard.getCol(i); Set colDup = new HashSet<>(); - //Check for non zero duplicates to trigger contradiction + // Check for non zero duplicates to trigger contradiction for (SudokuCell c : region) { if (c.getData() == 0) { continue; diff --git a/src/test/java/legup/TestRunner.java b/src/test/java/legup/TestRunner.java index c8725b48d..de674c348 100644 --- a/src/test/java/legup/TestRunner.java +++ b/src/test/java/legup/TestRunner.java @@ -6,7 +6,6 @@ import puzzles.battleship.rules.*; import puzzles.lightup.rules.*; import puzzles.nurikabe.rules.*; -import puzzles.sudoku.rules.LastNumberForCellDirectRuleRegionTest; import puzzles.treetent.rules.*; /** This class runs all of the tests for the project without needing to run build scripts. */ diff --git a/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java b/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java index 28406c1ab..f27f38d8a 100644 --- a/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java +++ b/src/test/java/puzzles/sudoku/rules/LastNumberForCellDirectRuleRegionTest.java @@ -16,76 +16,81 @@ public class LastNumberForCellDirectRuleRegionTest { private static final LastNumberForCellDirectRule RULE = new LastNumberForCellDirectRule(); private static Sudoku sudoku; + @BeforeClass public static void setUp() { MockGameBoardFacade.getInstance(); sudoku = new Sudoku(); } + @Test public void LastNumberForCellDirectRule_FullRegionTest() throws InvalidFileFormatException { - //Import board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion", sudoku); + // Import board and create transition + TestUtilities.importTestBoard( + "puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRegion", sudoku); TreeNode rootNode = sudoku.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); - //Loop all numbers at point - for(int i = 1; i < 10; i++){ - //Reset board + // Loop all numbers at point + for (int i = 1; i < 10; i++) { + // Reset board SudokuBoard board = (SudokuBoard) transition.getBoard(); - //Set cell + // Set cell SudokuCell cell1 = board.getCell(2, 5); cell1.setData(i); board.addModifiedData(cell1); - //Test the case - if(i == 9) { + // Test the case + if (i == 9) { Assert.assertNull(RULE.checkRuleAt(transition, cell1)); } else { Assert.assertNotNull(RULE.checkRuleAt(transition, cell1)); } } - //Import Board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow", sudoku); + // Import Board and create transition + TestUtilities.importTestBoard( + "puzzles/sudoku/rules/LastNumberForCellDirectRule/FullRow", sudoku); rootNode = sudoku.getTree().getRootNode(); transition = rootNode.getChildren().get(0); transition.setRule(RULE); - //Loop all numbers at point - for(int i = 1; i < 10; i++){ - //Reset board + // Loop all numbers at point + for (int i = 1; i < 10; i++) { + // Reset board SudokuBoard board = (SudokuBoard) transition.getBoard(); - //Set cell + // Set cell SudokuCell cell = board.getCell(4, 4); cell.setData(i); board.addModifiedData(cell); - //Test the case - if(i == 5) { + // Test the case + if (i == 5) { Assert.assertNull(RULE.checkRuleAt(transition, cell)); } else { Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); } } - //Import Board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed", sudoku); + // Import Board and create transition + TestUtilities.importTestBoard( + "puzzles/sudoku/rules/LastNumberForCellDirectRule/FullMixed", sudoku); rootNode = sudoku.getTree().getRootNode(); transition = rootNode.getChildren().get(0); transition.setRule(RULE); - //Loop all numbers at point - for(int i = 1; i < 10; i++){ - //Reset board + // Loop all numbers at point + for (int i = 1; i < 10; i++) { + // Reset board SudokuBoard board = (SudokuBoard) transition.getBoard(); - //Set cell + // Set cell SudokuCell cell = board.getCell(5, 3); cell.setData(i); board.addModifiedData(cell); - //Test the case - if(i == 2) { + // Test the case + if (i == 2) { Assert.assertNull(RULE.checkRuleAt(transition, cell)); } else { Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); diff --git a/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java b/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java index 3a65fbd47..704167a29 100644 --- a/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java +++ b/src/test/java/puzzles/sudoku/rules/RepeatedNumberContradictionRuleTest.java @@ -14,69 +14,75 @@ import org.junit.Test; public class RepeatedNumberContradictionRuleTest { - private static final RepeatedNumberContradictionRule RULE = new RepeatedNumberContradictionRule(); + private static final RepeatedNumberContradictionRule RULE = + new RepeatedNumberContradictionRule(); private static Sudoku sudoku; + @BeforeClass public static void setUp() { MockGameBoardFacade.getInstance(); sudoku = new Sudoku(); } + @Test public void RepeatedNumberContradictionRule_GlobalTest() throws InvalidFileFormatException { - //Import board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard7", sudoku); + // Import board and create transition + TestUtilities.importTestBoard( + "puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard7", sudoku); TreeNode rootNode = sudoku.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); - //Loop through every cell - for(int i = 0; i < 81; i++){ - //Reset board + // Loop through every cell + for (int i = 0; i < 81; i++) { + // Reset board SudokuBoard board = (SudokuBoard) transition.getBoard(); - //Set cell + // Set cell int x = i / 9; int y = i % 9; - if(x == 0 && y == 0) { + if (x == 0 && y == 0) { continue; } SudokuCell cell = board.getCell(x, y); cell.setData(7); - //Test the case - if(x == 0 || y == 0 || (x < 3 && y < 3)){ + // Test the case + if (x == 0 || y == 0 || (x < 3 && y < 3)) { Assert.assertNull(RULE.checkRuleAt(transition, cell)); } else { Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); } cell.setData(0); } - //Import board and create transition - TestUtilities.importTestBoard("puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4", sudoku); + // Import board and create transition + TestUtilities.importTestBoard( + "puzzles/sudoku/rules/RepeatedNumberContradictionRule/BlankBoard4", sudoku); rootNode = sudoku.getTree().getRootNode(); transition = rootNode.getChildren().get(0); transition.setRule(RULE); - //Loop through every cell - for(int i = 0; i < 81; i++){ - //Reset board + // Loop through every cell + for (int i = 0; i < 81; i++) { + // Reset board SudokuBoard board = (SudokuBoard) transition.getBoard(); - //Set cell + // Set cell int x = i / 9; int y = i % 9; - if((x == 3 && y == 0) || (x == 6 && y == 8)) { + if ((x == 3 && y == 0) || (x == 6 && y == 8)) { continue; } SudokuCell cell = board.getCell(x, y); cell.setData(4); - //Test the case - if((x == 3 || y == 0 || x == 6 || y == 8) || (x > 2 && x < 6 && y < 3) || (x > 5 && y > 5)){ + // Test the case + if ((x == 3 || y == 0 || x == 6 || y == 8) + || (x > 2 && x < 6 && y < 3) + || (x > 5 && y > 5)) { Assert.assertNull(RULE.checkRuleAt(transition, cell)); } else { Assert.assertNotNull(RULE.checkRuleAt(transition, cell)); } cell.setData(0); } - } } From 7c95d5f7c1a3ee4780be9286f9c7868a27a70ab2 Mon Sep 17 00:00:00 2001 From: kchiu1 <152306707+kchiu1@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:15:29 -0400 Subject: [PATCH 34/36] Revert "Merge branch 'dev' into sudoku" This reverts commit 63de212ff60000632191e1641679a81fedec9c81, reversing changes made to 31c3ead782ad72634e4dca03724aa46e5e51262c. --- bin/main/edu/rpi/legup/legup/config | 6 +- .../5x5 Star Battle 1 star Normal 1.xml | 53 ---- .../6x6 Star Battle 1star Normal1.xml | 68 ----- .../6x6 Star Battle 1star Normal2.xml | 68 ----- .../6x6 StarBattle 1star Normal3.xml | 68 ----- .../7x7 Star Battle 1star Hard1.xml | 85 ------- .../7x7 Star Battle 1star Normal.xml | 85 ------- .../7x7 Star Battle 1star Normal1.xml | 85 ------- .../7x7 Star Battle 1star Normal2.xml | 85 ------- .../8x8 Star Battle 1star Normal1.xml | 105 -------- .../8x8 Star Battle 1star Normal2.xml | 104 -------- .../8x8 Star Battle 1star Normal3.xml | 104 -------- .../rpi/legup/model/gameboard/GridRegion.java | 16 +- .../legup/puzzle/starbattle/StarBattle.java | 35 --- .../puzzle/starbattle/StarBattleBoard.java | 110 -------- .../puzzle/starbattle/StarBattleCell.java | 88 ------- .../starbattle/StarBattleCellFactory.java | 66 ----- .../puzzle/starbattle/StarBattleCellType.java | 12 - .../starbattle/StarBattleController.java | 36 --- .../starbattle/StarBattleElementView.java | 41 --- .../puzzle/starbattle/StarBattleExporter.java | 33 --- .../puzzle/starbattle/StarBattleImporter.java | 103 -------- .../puzzle/starbattle/StarBattleRegion.java | 26 -- .../puzzle/starbattle/StarBattleView.java | 43 ---- .../rpi/legup/puzzle/starbattle/allfiles.txt | 235 ------------------ .../puzzle/starbattle/elements/BlackTile.java | 9 - .../puzzle/starbattle/elements/StarTile.java | 9 - .../starbattle/elements/UnknownTile.java | 9 - .../puzzle/starbattle/elements/WhiteTile.java | 10 - .../starbattle/rules/BlackoutDirectRule.java | 64 ----- .../rules/ClashingOrbitContradictionRule.java | 60 ----- .../rules/ColumnsWithinRegionsDirectRule.java | 94 ------- .../rules/ColumnsWithinRowsDirectRule.java | 97 -------- .../rules/FinishWithStarsDirectRule.java | 63 ----- .../rules/RegionsWithinColumnsDirectRule.java | 43 ---- .../rules/RegionsWithinRowsDirectRule.java | 44 ---- .../rules/RowsWithinColumnsDirectRule.java | 51 ---- .../rules/RowsWithinRegionsDirectRule.java | 94 ------- .../starbattle/rules/StarOrEmptyCaseRule.java | 103 -------- .../rules/SurroundStarDirectRule.java | 63 ----- .../rules/TooFewStarsContradictionRule.java | 64 ----- .../rules/TooManyStarsContradictionRule.java | 114 --------- .../rules/starbattle_reference_sheet.txt | 19 -- .../edu/rpi/legup/utility/LegupUtils.java | 11 +- .../legup/images/starbattle/UnknownTile.png | Bin 9733 -> 0 bytes .../edu/rpi/legup/images/starbattle/black.gif | Bin 856 -> 0 bytes .../starbattle/cases/StarOrEmptyCaseRule.png | Bin 4437 -> 0 bytes .../ClashingOrbitContradictionRule.png | Bin 5135 -> 0 bytes .../TooFewStarsContradictionRule.png | Bin 3218 -> 0 bytes .../TooManyStarsContradictionRule.png | Bin 6199 -> 0 bytes .../edu/rpi/legup/images/starbattle/empty.gif | Bin 857 -> 0 bytes .../starbattle/rules/BlackOutDirectRule.png | Bin 4717 -> 0 bytes .../rules/ColumnsWithinRegionsDirectRule.png | Bin 6456 -> 0 bytes .../rules/ColumnsWithinRowsDirectRule.png | Bin 5331 -> 0 bytes .../rules/FinishWithStarDirectRule.png | Bin 4326 -> 0 bytes .../rules/RegionsWithinColumnsDirectRule.png | Bin 6402 -> 0 bytes .../rules/RegionsWithinRowsDirectRule.png | Bin 6269 -> 0 bytes .../rules/RowsWithinColumnsDirectRule.png | Bin 5117 -> 0 bytes .../rules/RowsWithinRegionsDirectRule.png | Bin 6477 -> 0 bytes .../images/starbattle/rules/SurroundStar.png | Bin 5102 -> 0 bytes .../edu/rpi/legup/images/starbattle/star.gif | Bin 545 -> 0 bytes .../edu/rpi/legup/images/starbattle/white.gif | Bin 9700 -> 0 bytes src/main/resources/edu/rpi/legup/legup/config | 6 +- .../rules/BlackoutDirectRuleTest.java | 69 ----- .../BlackoutDirectRule/ColumnBlackout | 40 --- .../BlackoutDirectRule/RegionBlackout | 36 --- .../BlackoutDirectRule/RowBlackout | 36 --- 67 files changed, 14 insertions(+), 2954 deletions(-) delete mode 100644 puzzles files/starbattle/5x5 Star Battle 1 star Normal/5x5 Star Battle 1 star Normal 1.xml delete mode 100644 puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal1.xml delete mode 100644 puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal2.xml delete mode 100644 puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 StarBattle 1star Normal3.xml delete mode 100644 puzzles files/starbattle/7x7 Star Battle 1 star Hard/7x7 Star Battle 1star Hard1.xml delete mode 100644 puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal.xml delete mode 100644 puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal1.xml delete mode 100644 puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal2.xml delete mode 100644 puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal1.xml delete mode 100644 puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal2.xml delete mode 100644 puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal3.xml delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattle.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleBoard.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCell.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellFactory.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellType.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleController.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleElementView.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleExporter.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleImporter.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleRegion.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleView.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/allfiles.txt delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/elements/BlackTile.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/elements/StarTile.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/elements/UnknownTile.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/elements/WhiteTile.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/BlackoutDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ClashingOrbitContradictionRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRegionsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRowsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/FinishWithStarsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinRegionsDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/StarOrEmptyCaseRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/SurroundStarDirectRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooFewStarsContradictionRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooManyStarsContradictionRule.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/starbattle/rules/starbattle_reference_sheet.txt delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/UnknownTile.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/black.gif delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/cases/StarOrEmptyCaseRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/contradictions/ClashingOrbitContradictionRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/contradictions/TooFewStarsContradictionRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/contradictions/TooManyStarsContradictionRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/empty.gif delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/BlackOutDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/ColumnsWithinRegionsDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/ColumnsWithinRowsDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/FinishWithStarDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/RegionsWithinColumnsDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/RegionsWithinRowsDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/RowsWithinColumnsDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/RowsWithinRegionsDirectRule.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/rules/SurroundStar.png delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/star.gif delete mode 100644 src/main/resources/edu/rpi/legup/images/starbattle/white.gif delete mode 100644 src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java delete mode 100644 src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/ColumnBlackout delete mode 100644 src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RegionBlackout delete mode 100644 src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RowBlackout diff --git a/bin/main/edu/rpi/legup/legup/config b/bin/main/edu/rpi/legup/legup/config index 4aef6de60..ccd4f5be3 100644 --- a/bin/main/edu/rpi/legup/legup/config +++ b/bin/main/edu/rpi/legup/legup/config @@ -31,10 +31,6 @@ - + fileCreationDisabled="false"/> diff --git a/puzzles files/starbattle/5x5 Star Battle 1 star Normal/5x5 Star Battle 1 star Normal 1.xml b/puzzles files/starbattle/5x5 Star Battle 1 star Normal/5x5 Star Battle 1 star Normal 1.xml deleted file mode 100644 index b86e16ff2..000000000 --- a/puzzles files/starbattle/5x5 Star Battle 1 star Normal/5x5 Star Battle 1 star Normal 1.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal1.xml b/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal1.xml deleted file mode 100644 index 110dd9abe..000000000 --- a/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal1.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal2.xml b/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal2.xml deleted file mode 100644 index 49efeba59..000000000 --- a/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 Star Battle 1star Normal2.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 StarBattle 1star Normal3.xml b/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 StarBattle 1star Normal3.xml deleted file mode 100644 index 855943612..000000000 --- a/puzzles files/starbattle/6x6 Star Battle 1 star Normal/6x6 StarBattle 1star Normal3.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/7x7 Star Battle 1 star Hard/7x7 Star Battle 1star Hard1.xml b/puzzles files/starbattle/7x7 Star Battle 1 star Hard/7x7 Star Battle 1star Hard1.xml deleted file mode 100644 index c1d7770f6..000000000 --- a/puzzles files/starbattle/7x7 Star Battle 1 star Hard/7x7 Star Battle 1star Hard1.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal.xml b/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal.xml deleted file mode 100644 index cab0a0a5e..000000000 --- a/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal1.xml b/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal1.xml deleted file mode 100644 index 70b81e376..000000000 --- a/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal1.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal2.xml b/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal2.xml deleted file mode 100644 index c541ece06..000000000 --- a/puzzles files/starbattle/7x7 Star Battle 1 star Normal/7x7 Star Battle 1star Normal2.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal1.xml b/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal1.xml deleted file mode 100644 index 02dd5d6c0..000000000 --- a/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal1.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal2.xml b/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal2.xml deleted file mode 100644 index 0df84ef62..000000000 --- a/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal2.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal3.xml b/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal3.xml deleted file mode 100644 index 725c91d7f..000000000 --- a/puzzles files/starbattle/8x8 Star Battle 1 star Normal/8x8 Star Battle 1star Normal3.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java index 6718ab6f4..c41d5e1b2 100644 --- a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java @@ -4,18 +4,17 @@ import java.util.List; public abstract class GridRegion { - + protected List regionCells; - - /** - * Region Constructor - */ + + /** Region Constructor */ public GridRegion() { this.regionCells = new ArrayList<>(); } /** * Adds the cell to the region + * * @param cell cell to be added to the region */ public void addCell(T cell) { @@ -24,6 +23,7 @@ public void addCell(T cell) { /** * Removes the cell from the region + * * @param cell cell to be remove from the region */ public void removeCell(T cell) { @@ -32,6 +32,7 @@ public void removeCell(T cell) { /** * Returns the list of cells in the region + * * @return list of cells in region */ public List getCells() { @@ -40,14 +41,15 @@ public List getCells() { /** * Returns the number of cells in the region + * * @return number of cells in the region */ - public int getSize(){ + public int getSize() { return regionCells.size(); } /* public void colorRegion(){} */ - + } diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattle.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattle.java deleted file mode 100644 index 760fa88b2..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattle.java +++ /dev/null @@ -1,35 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; -import edu.rpi.legup.model.Puzzle; -import edu.rpi.legup.model.gameboard.Board; - -public class StarBattle extends Puzzle { - public StarBattle() { - super(); - this.name = "StarBattle"; - - this.importer = new StarBattleImporter(this); - this.exporter = new StarBattleExporter(this); - - this.factory = new StarBattleCellFactory(); - } - - @Override - public void initializeView() { - boardView = new StarBattleView((StarBattleBoard) currentBoard); - addBoardListener(boardView); - } - - @Override - public Board generatePuzzle(int difficulty) { - return null; - } - - @Override - public boolean isBoardComplete(Board board) { - return true; - } - - @Override - public void onBoardChange(Board board) { - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleBoard.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleBoard.java deleted file mode 100644 index ce04f31a6..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleBoard.java +++ /dev/null @@ -1,110 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import java.util.*; - -import edu.rpi.legup.model.gameboard.GridBoard; -import edu.rpi.legup.model.gameboard.PuzzleElement; - -public class StarBattleBoard extends GridBoard { - - private int size; - private int puzzleNum; - protected List regions; - //private ArrayList groupSizes; - - public StarBattleBoard(int size, int num) { - super(size, size); - this.size = size; - this.puzzleNum = num; - this.regions = new ArrayList<>(); - for (int i = 0; i < size; i++) { - regions.add(new StarBattleRegion()); - } - } - - @Override - public StarBattleCell getCell(int x, int y) { - return (StarBattleCell) super.getCell(x,y); - } - - /* - public StarBattleCell getCell(int groupIndex, int x, int y) { - return getCell(x + (groupIndex % groupSize) * groupSize, y + (groupIndex / groupSize) * groupSize); - }*/ - - public int getSize() { - return size; - } - - public Set getRow(int rowNum) { - Set row = new HashSet<>(); - for (int i = 0; i < size; i++) { - row.add(getCell(i, rowNum)); - } - return row; - } - - public int getPuzzleNumber() { return puzzleNum; } - - public Set getCol(int colNum) { - Set column = new HashSet<>(); - for (int i = 0; i < size; i++) { - column.add(getCell(colNum, i)); - } - return column; - } - - public StarBattleRegion getRegion(int index) { - if (index >= size) { - return null; - } - return regions.get(index); - } - - public StarBattleRegion getRegion(StarBattleCell cell) { - return getRegion(cell.getGroupIndex()); - } - - public void setRegion(int regionNum, StarBattleRegion region) { - regions.set(regionNum, region); - } - - public int columnStars(int columnIndex) { - int stars = 0; - if (columnIndex < size) { - for (StarBattleCell c: this.getCol(columnIndex)) { - if (c.getType() == StarBattleCellType.STAR) - ++stars; - } - } - return stars; - } - - public int rowStars(int rowIndex) { - int stars = 0; - if (rowIndex < size) { - for (StarBattleCell c: this.getRow(rowIndex)) { - if (c.getType() == StarBattleCellType.STAR) - ++stars; - } - } - return stars; - } - - public StarBattleBoard copy() { - StarBattleBoard copy = new StarBattleBoard(size, puzzleNum); - for (int x = 0; x < this.dimension.width; x++) { - for (int y = 0; y < this.dimension.height; y++) { - copy.setCell(x, y, getCell(x, y).copy()); - } - if (x < this.regions.size()) - copy.regions.add(this.getRegion(x).copy()); - } - for (PuzzleElement e : modifiedData) { - copy.getPuzzleElement(e).setModifiable(false); - } - return copy; - } -} - - diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCell.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCell.java deleted file mode 100644 index a316872d9..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCell.java +++ /dev/null @@ -1,88 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.model.elements.Element; -import edu.rpi.legup.model.gameboard.GridCell; - -import java.awt.*; -import java.awt.event.MouseEvent; - -public class StarBattleCell extends GridCell { - private int groupIndex; - private int max; - - /** - * StarBattleCell Constructor - creates a new StarBattle cell to hold the puzzleElement - * - * @param value value of the star battle cell denoting its state - * @param location location of the cell on the board - * @param groupIndex indicates what group # the cell is in. - * @param size size of the star battle cell - */ - public StarBattleCell(int value, Point location, int groupIndex, int size) { - super(value, location); - this.groupIndex = groupIndex; - this.max = size; - } - - public int getGroupIndex() { return groupIndex; } - - @Override - public void setType(Element e, MouseEvent m) { - switch (e.getElementID()) { - case "STBL-PLAC-0001": - this.data = -3; - break; - case "STBL-PLAC-0002": - this.data = -2; - break; - case "STBL-PLAC-0003": - this.data = -1; - break; - - case "STBL-UNPL-0001"://Not sure how button events work - switch (m.getButton()){ - case MouseEvent.BUTTON1: - if (this.data > 0 || this.data < -3) { - this.data = -3; - } - else { - this.data = this.data + 1; - } - break; - case MouseEvent.BUTTON3: - if (this.data > -4) { - this.data = this.data - 1; - } - else { - this.data = -1;//Unsure - } - break; - } - break; - } - } - - public StarBattleCellType getType() { - switch (data) { - case -3: - return StarBattleCellType.UNKNOWN; - case -2: - return StarBattleCellType.STAR; - case -1: - return StarBattleCellType.BLACK; - default: - if (data >= 0) { - return StarBattleCellType.UNKNOWN; - } - } - return null; - } - - public StarBattleCell copy() { - StarBattleCell copy = new StarBattleCell(data, (Point) location.clone(), groupIndex, max); - copy.setIndex(index); - copy.setModifiable(isModifiable); - copy.setGiven(isGiven); - return copy; - } -} \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellFactory.java deleted file mode 100644 index 9f7fd0fee..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellFactory.java +++ /dev/null @@ -1,66 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.ElementFactory; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.save.InvalidFileFormatException; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -import java.awt.*; - -public class StarBattleCellFactory extends ElementFactory { - @Override - public StarBattleCell importCell(Node node, Board board) throws InvalidFileFormatException { - try { - if (!node.getNodeName().equalsIgnoreCase("cell")) { - throw new InvalidFileFormatException("starbattle Factory: unknown puzzleElement puzzleElement"); - } - - StarBattleBoard starbattleBoard = (StarBattleBoard) board; - int size = starbattleBoard.getSize(); - - NamedNodeMap attributeList = node.getAttributes(); - int value = Integer.valueOf(attributeList.getNamedItem("value").getNodeValue()); - int x = Integer.valueOf(attributeList.getNamedItem("x").getNodeValue()); - int y = Integer.valueOf(attributeList.getNamedItem("y").getNodeValue()); - int groupIndex = Integer.valueOf(attributeList.getNamedItem("groupIndex").getNodeValue()); - if (x >= size || y >= size) { - throw new InvalidFileFormatException("starbattle Factory: cell location out of bounds"); - } - if (groupIndex >= size || groupIndex < 0) { - throw new InvalidFileFormatException("starbattle Factory: not in a valid region"); - } - if (value != 0) { //ALL INITIAL PUZZLES ARE BLANK, SUBJECT TO CHANGE - throw new InvalidFileFormatException("starbattle Factory: cell unknown value"); - } - - StarBattleCell cell = new StarBattleCell(value, new Point(x, y), groupIndex, size); - cell.setIndex(y * size + x); - return cell; - } - - catch (NumberFormatException e1) { - e1.printStackTrace(); - throw new InvalidFileFormatException("starbattle Factory: unknown value where integer expected"); - } - - catch (NullPointerException e2) { - e2.printStackTrace(); - throw new InvalidFileFormatException("starbattle Factory: could not find attribute(s)"); - } - } - - public org.w3c.dom.Element exportCell(Document document, PuzzleElement puzzleElement) { - org.w3c.dom.Element cellElement = document.createElement("cell"); - - StarBattleCell cell = (StarBattleCell) puzzleElement; - Point loc = cell.getLocation(); - - cellElement.setAttribute("value", String.valueOf(cell.getData())); - cellElement.setAttribute("x", String.valueOf(loc.x)); - cellElement.setAttribute("y", String.valueOf(loc.y)); - - return cellElement; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellType.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellType.java deleted file mode 100644 index 565f608d7..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleCellType.java +++ /dev/null @@ -1,12 +0,0 @@ -//StarBattleCellType.java -package edu.rpi.legup.puzzle.starbattle; - -public enum StarBattleCellType { - STAR(-2), BLACK(-1), UNKNOWN(0); - - public int value; - - StarBattleCellType(int value) { - this.value = value; - } -} \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleController.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleController.java deleted file mode 100644 index 4ebeb39ba..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleController.java +++ /dev/null @@ -1,36 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.controller.ElementController; -import edu.rpi.legup.model.gameboard.PuzzleElement; - -import java.awt.event.MouseEvent; - -public class StarBattleController extends ElementController { - @Override - public void changeCell(MouseEvent e, PuzzleElement data) { - StarBattleCell cell = (StarBattleCell) data; - if (e.getButton() == MouseEvent.BUTTON1) { - if (e.isControlDown()) { - this.boardView.getSelectionPopupMenu().show(boardView, this.boardView.getCanvas().getX() + e.getX(), this.boardView.getCanvas().getY() + e.getY()); - } - else { - if (cell.getData() >= 0) { - data.setData(-2); - } - else { - data.setData(cell.getData() + 1); - } - } - } - else { - if (e.getButton() == MouseEvent.BUTTON3) { - if (cell.getData() == -2) { - data.setData(0); - } - else { - data.setData(cell.getData() - 1); - } - } - } - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleElementView.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleElementView.java deleted file mode 100644 index ff5d54d1c..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleElementView.java +++ /dev/null @@ -1,41 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.ui.boardview.GridElementView; - -import java.awt.*; - -public class StarBattleElementView extends GridElementView { - - public StarBattleElementView(StarBattleCell cell) { - super(cell); - } - - @Override - public StarBattleCell getPuzzleElement() { - return (StarBattleCell) super.getPuzzleElement(); - } - - @Override - public void drawElement(Graphics2D graphics2D) { - StarBattleCell cell = (StarBattleCell) puzzleElement; - StarBattleCellType type = cell.getType(); - if (type == StarBattleCellType.STAR) { - graphics2D.setColor(Color.LIGHT_GRAY); - graphics2D.fillRect(location.x, location.y, size.width, size.height); - graphics2D.drawImage(StarBattleView.STAR, location.x, location.y, size.width, size.height, Color.WHITE, null); - graphics2D.setColor(Color.BLACK); - graphics2D.drawRect(location.x, location.y, size.width, size.height); - } else if (type == StarBattleCellType.BLACK) { - graphics2D.setStroke(new BasicStroke(1)); - graphics2D.setColor(Color.BLACK); - graphics2D.fillRect(location.x, location.y, size.width, size.height); - } else if (type == StarBattleCellType.UNKNOWN) { - graphics2D.setStroke(new BasicStroke(1)); - graphics2D.setColor(Color.LIGHT_GRAY); - graphics2D.fillRect(location.x, location.y, size.width, size.height); - graphics2D.setColor(Color.BLACK); - graphics2D.drawRect(location.x, location.y, size.width, size.height); - } - - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleExporter.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleExporter.java deleted file mode 100644 index 58fb41e63..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleExporter.java +++ /dev/null @@ -1,33 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.model.PuzzleExporter; - -import org.w3c.dom.Document; - -public class StarBattleExporter extends PuzzleExporter { - public StarBattleExporter(StarBattle starbattle) { - super(starbattle); - } - - @Override - protected org.w3c.dom.Element createBoardElement(Document newDocument) { - StarBattleBoard board = (StarBattleBoard) puzzle.getTree().getRootNode().getBoard(); - org.w3c.dom.Element boardElement = newDocument.createElement("board"); - boardElement.setAttribute("size", String.valueOf(board.getSize())); - boardElement.setAttribute("puzzle_num", String.valueOf(board.getPuzzleNumber())); - for (StarBattleRegion sb_region : board.regions) { - org.w3c.dom.Element regionsElement = newDocument.createElement("region"); - org.w3c.dom.Element cellsElement = newDocument.createElement("cells"); - for (StarBattleCell cell : sb_region.getCells()) { - if (cell.getData() == 0) { - org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, cell); - cellsElement.appendChild(cellElement); - } - regionsElement.appendChild(cellsElement); - } - boardElement.appendChild(regionsElement); - } - - return boardElement; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleImporter.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleImporter.java deleted file mode 100644 index fa0e065ee..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleImporter.java +++ /dev/null @@ -1,103 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.model.PuzzleImporter; -import edu.rpi.legup.save.InvalidFileFormatException; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import java.awt.Point; - - -public class StarBattleImporter extends PuzzleImporter{ - - - public StarBattleImporter(StarBattle starbattle) { - super(starbattle); - } - - /** - * Puzzle setting to support row and column inputs - */ - @Override - public boolean acceptsRowsAndColumnsInput() { - return true; - } - - /** - * Puzzle setting to disable support for text input - */ - @Override - public boolean acceptsTextInput() { - return false; - } - - /** - * Constructs empty StarBattle gameboard as per the provided dimensions - * @param rows number of rows and columns for the gameboard - */ - @Override - public void initializeBoard(int rows, int columns) { - int puzzle_num = 1; - StarBattleBoard StarBattleBoard = new StarBattleBoard(rows, puzzle_num); - puzzle.setCurrentBoard(StarBattleBoard); - } - - /** - * Constructs StarBattle gameboard - * @param node xml document node - * @throws InvalidFileFormatException if file is invalid - */ - @Override - public void initializeBoard(Node node) throws InvalidFileFormatException { - Element puzzleElement = (Element) node; - int puzzle_num = Integer.parseInt(puzzleElement.getAttribute("puzzle_num")); - NodeList regionNodes = puzzleElement.getElementsByTagName("region"); - int size = Integer.parseInt(puzzleElement.getAttribute("size")); - if (regionNodes.getLength() != size) { - throw new InvalidFileFormatException("Not the current amount of regions in the puzzle."); - } - - StarBattleBoard StarBattleBoard = new StarBattleBoard(size, puzzle_num); // Initialize the board with width and height from XML - - for (int i = 0; i < regionNodes.getLength(); i++) { - Element regionElement = (Element) regionNodes.item(i); - NodeList cellNodes = regionElement.getElementsByTagName("cell"); - StarBattleRegion region_i = new StarBattleRegion(); - - for (int j = 0; j < cellNodes.getLength(); j++) { - Element cellElement = (Element) cellNodes.item(j); - int x = Integer.parseInt(cellElement.getAttribute("x")); - int y = Integer.parseInt(cellElement.getAttribute("y")); - int value = Integer.parseInt(cellElement.getAttribute("value")); - - Point cellPoint = new Point(x, y); - - // Create the StarBattleCell with the cell type and value - StarBattleCell cell = new StarBattleCell(value, cellPoint, i, size); - cell.setIndex(y * size + x); // Calculate the index based on size - cell.setModifiable(true); - - // Add the cell to the board - StarBattleBoard.setCell(x, y, cell); - region_i.addCell(cell); - } - StarBattleBoard.setRegion(i, region_i); - } - - puzzle.setCurrentBoard(StarBattleBoard); - } - - - - /** - * Initialize board via string of statements. - * @throws UnsupportedOperationException since StarBattle does not support text input - */ - @Override - public void initializeBoard(String[] statements) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Star Battle does not accept text input"); - } -} - - - diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleRegion.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleRegion.java deleted file mode 100644 index 099cabfcd..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleRegion.java +++ /dev/null @@ -1,26 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.model.gameboard.GridRegion; - -public class StarBattleRegion extends GridRegion{ - public StarBattleRegion() { - super(); - } - - public StarBattleRegion copy() { - StarBattleRegion copy = new StarBattleRegion(); - for (StarBattleCell c: regionCells) { - copy.addCell(c.copy()); - } - return copy; - } - - public int numStars() { - int stars = 0; - for (StarBattleCell c: regionCells) { - if (c.getType() == StarBattleCellType.STAR) - ++stars; - } - return stars; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleView.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleView.java deleted file mode 100644 index ceb0eec19..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleView.java +++ /dev/null @@ -1,43 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle; - -import java.io.IOException; - -import javax.imageio.ImageIO; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import edu.rpi.legup.puzzle.starbattle.StarBattleView; -import edu.rpi.legup.ui.boardview.GridBoardView; - -import edu.rpi.legup.controller.BoardController; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import java.awt.*; - -public class StarBattleView extends GridBoardView { - static Image STAR; - - static { - try { - STAR = ImageIO.read(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/starbattle/star.gif")); - } - catch (IOException e) { - // pass - } - } - - public StarBattleView(StarBattleBoard board) { - super(new BoardController(), new StarBattleController(), board.getDimension()); - - for (PuzzleElement puzzleElement : board.getPuzzleElements()) { - StarBattleCell cell = (StarBattleCell) puzzleElement; - Point loc = cell.getLocation(); - StarBattleElementView elementView = new StarBattleElementView(cell); - elementView.setIndex(cell.getIndex()); - elementView.setSize(elementSize); - elementView.setLocation(new Point(loc.x * elementSize.width, loc.y * elementSize.height)); - elementViews.add(elementView); - } - } - - -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/allfiles.txt b/src/main/java/edu/rpi/legup/puzzle/starbattle/allfiles.txt deleted file mode 100644 index 5a9ec0f0a..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/allfiles.txt +++ /dev/null @@ -1,235 +0,0 @@ -//StarBattle.java - -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.model.Puzzle; -import edu.rpi.legup.model.gameboard.Board; - -public class StarBattle extends Puzzle { - public StarBattle() { - super(); - this.name = "StarBattle"; - - this.importer = new StarBattleImporter(this); - this.exporter = new StarBattleExporter(this); - - this.factory = new StarBattleCellFactory(); - } - - @Override - public void initializeView() { - } - - @Override - public Board generatePuzzle(int difficulty) { - return null; - } - - @Override - public boolean isBoardComplete(Board board) { - return true; - } - - @Override - public void onBoardChange(Board board) { - } -} - -//StarBattleBoard.java - -package edu.rpi.legup.puzzle.lightup; - -import edu.rpi.legup.model.gameboard.GridBoard; -import edu.rpi.legup.model.gameboard.PuzzleElement; - -import java.awt.*; -import java.util.HashSet; -import java.util.Set; - -public class StarBattleBoard extends GridBoard { - - private int size; - private vector group_sizes; - - /** - * StarBattleBoard Constructor - create a new Star Battle board - * - * @param size size of one side of the star battle board - */ - - public StarBattleBoard(int size) { - super(size, size); - group_sizes = vector(size); - } - - @Override - public StarBattleCell getCell(int x, int y) { - return (StarBattleCell) super.getCell(x, y); - } - - -} - -//StarBattleCell.java - -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.model.gameboard.GridCell; - -import java.awt.*; -import java.util.HashSet; -import java.util.Set; - -public class StarBattleCell extends GridCell { - private int groupIndex; - private int max; - - /** - * StarBattleCell Constructor - creates a new StarBattle cell to hold the puzzleElement - * - * @param valueInt value of the star battle cell denoting its state - * @param location location of the cell on the board - * @param size size of the star battle cell - */ - public StarBattleCell(int value, Point location, int groupIndex, int size) { - super(value, location); - this.groupIndex = groupIndex; - this.max = size; - } - - @Override - public void setType(Element e, MouseEvent m) { - switch (e.getElementID()) { - case "SBUP-PLAC-0001": - this.data = -3; - break; - case "SBUP-PLAC-0002": - this.data = -2; - break; - case "SBUP-PLAC-0003": - this.data = -1; - break; - case "SBUP-UNPL-0001"://Not sure how button events work - switch (m.getButton()){ - case MouseEvent.BUTTON1: - if (this.data < 0 || this.data > 3) { - this.data = 0; - } - else { - this.data = this.data + 1; - } - break; - case MouseEvent.BUTTON3: - if (this.data > 0) { - this.data = this.data - 1; - } - else { - this.data = 3;//Unsure - } - break; - } - break; - } - } - - public LightUpCellType getType() { - switch (data) { - case -3: - return LightUpCellType.UNKNOWN; - case -2: - return LightUpCellType.STAR; - case -1: - return LightUpCellType.BLACK; - default: - if (data >= 0) { - return StarBattleCellType.WHITE; - } - } - return null; - } - - /** - * Gets the region index of the cell - * - * @return group index of the cell - */ - public int getGroupIndex() { - return groupIndex; - } - - /** - * Gets the size of the cell - * - * @return size of the cell - */ - - public int getMax() { - return max; - } - -} - -//StarBattleCellController.java - -package edu.rpi.legup.puzzle.starbattle; - -import edu.rpi.legup.controller.ElementController; -import edu.rpi.legup.model.gameboard.PuzzleElement; - -import java.awt.event.MouseEvent; - -public class StarBattleCellController extends ElementController { - @Override - public void changeCell(MouseEvent e, PuzzleElement data) { - StarBattleCell cell = (StarBattleCell) data; - if (e.getButton() == MouseEvent.BUTTON1) { - if (e.isControlDown()) { - this.boardView.getSelectionPopupMenu().show(boardView, this.boardView.getCanvas().getX() + e.getX(), this.boardView.getCanvas().getY() + e.getY()); - } - else { - if (cell.getData() == 0) { - data.setData(-3); - } - else { - data.setData(cell.getData() + 1); - } - } - } - else { - if (e.getButton() == MouseEvent.BUTTON3) { - if (cell.getData() == -3) { - data.setData(0); - } - else { - data.setData(cell.getData() - 1); - } - } - } - } -} - -//StarBattleCellFactory.java - - - -//StarBattleCellType.java -package edu.rpi.legup.puzzle.starbattle; - -public enum StarBattleType { - UNKNOWN(-3), STAR(-2), BLACK(-1), WHITE(0); - - public int value; - - StarBattleCell(int value) { - this.value = value; - } -} - -//StarBattleExporter.java -//StarBattleImporter.java -//StarBattleView.java - -How to run Legup: - -./gradlew build -Java -jar build/libs/Legup.jar \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/BlackTile.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/BlackTile.java deleted file mode 100644 index 2601bd351..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/BlackTile.java +++ /dev/null @@ -1,9 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.elements; - -import edu.rpi.legup.model.elements.NonPlaceableElement; - -public class BlackTile extends NonPlaceableElement { - public BlackTile() { - super("STBL-PLAC-0002", "Black Tile", "The black tile that shows where you cannot place a star", "edu/rpi/legup/images/lightup/black.gif"); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/StarTile.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/StarTile.java deleted file mode 100644 index d42cc0010..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/StarTile.java +++ /dev/null @@ -1,9 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.elements; - -import edu.rpi.legup.model.elements.NonPlaceableElement; - -public class StarTile extends NonPlaceableElement { - public StarTile() { - super("STBL-PLAC-0001", "Star Tile", "The star tile, the token of the game.", "edu/rpi/legup/images/starbattle/star.gif"); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/UnknownTile.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/UnknownTile.java deleted file mode 100644 index c2459f642..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/UnknownTile.java +++ /dev/null @@ -1,9 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.elements; - -import edu.rpi.legup.model.elements.NonPlaceableElement; - -public class UnknownTile extends NonPlaceableElement { - public UnknownTile() { - super("STBL-UNPL-0001", "Unknown Tile", "An empty tile", "edu/rpi/legup/images/starbattle/star.gif"); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/WhiteTile.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/WhiteTile.java deleted file mode 100644 index a064c1fad..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/elements/WhiteTile.java +++ /dev/null @@ -1,10 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.elements; - -import edu.rpi.legup.model.elements.PlaceableElement; - -public class WhiteTile extends PlaceableElement { - public WhiteTile() { - super("STBL-PLAC-0001", "White Tile", "The white tile", "edu/rpi/legup/images/starbattle/white.gif"); - } -} - diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/BlackoutDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/BlackoutDirectRule.java deleted file mode 100644 index 75fbaadb6..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/BlackoutDirectRule.java +++ /dev/null @@ -1,64 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; -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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -public class BlackoutDirectRule extends DirectRule { - - public BlackoutDirectRule() { - super("STBL-BASC-0001", - "Blackout", - "If a row, column, or region has enough stars, its unknown spaces are black.", - "edu/rpi/legup/images/starbattle/rules/BlackOutDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - StarBattleBoard origBoard = (StarBattleBoard) transition.getParents().get(0).getBoard(); - ContradictionRule contraRule = new TooManyStarsContradictionRule(); - - StarBattleCell cell = (StarBattleCell) board.getPuzzleElement(puzzleElement); - - if (cell.getType() != StarBattleCellType.BLACK) { - return "Only black cells are allowed for this rule!"; - } - - StarBattleBoard modified = (StarBattleBoard) origBoard.copy(); - modified.getPuzzleElement(puzzleElement).setData(StarBattleCellType.STAR.value); - if (contraRule.checkContradictionAt(modified, puzzleElement) != null) { - return "Black cells must be placed in a row, region, or column with enough stars!"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - return null; - } -} - - diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ClashingOrbitContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ClashingOrbitContradictionRule.java deleted file mode 100644 index 0ca27ab4a..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ClashingOrbitContradictionRule.java +++ /dev/null @@ -1,60 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; -import edu.rpi.legup.model.tree.TreeNode; -import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -import java.awt.*; - -public class ClashingOrbitContradictionRule extends ContradictionRule { - - public ClashingOrbitContradictionRule() { - super("STBL-CONT-0003", - "Clashing Orbit", - "No two stars can be adjacent to each other.", - "edu/rpi/legup/images/starbattle/contradictions/ClashingOrbitContradictionRule.png"); - } - - /** - * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule - * - * @param board board to check contradiction - * @param puzzleElement equivalent puzzleElement - * @return null if the transition contains a contradiction at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { - StarBattleBoard starbattleBoard = (StarBattleBoard) board; - StarBattleCell cell = (StarBattleCell) starbattleBoard.getPuzzleElement(puzzleElement); - - // Contradiction rule can only be applied to cells with a star in it - if (cell.getType() != StarBattleCellType.STAR) { - return super.getNoContradictionMessage(); - } - - // check neighboring cells for a star - Point location = cell.getLocation(); - - int rowStart = Math.max( location.x - 1, 0 ); - int rowEnd = Math.min( location.x + 1, starbattleBoard.getSize() - 1 ); - int colStart = Math.max( location.y - 1, 0 ); - int colEnd = Math.min( location.y + 1, starbattleBoard.getSize() - 1 ); - - for (int row = rowStart; row <= rowEnd; row++) { - for (int col = colStart; col <= colEnd; col++) { - if (starbattleBoard.getCell(row, col).getType() == StarBattleCellType.STAR - && (row != location.x || col != location.y)) { - return null; - } - } - } - - return super.getNoContradictionMessage(); - } -} \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRegionsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRegionsDirectRule.java deleted file mode 100644 index b42bfd1c0..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRegionsDirectRule.java +++ /dev/null @@ -1,94 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.GridRegion; -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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -import java.util.HashSet; -import java.util.Set; - -public class ColumnsWithinRegionsDirectRule extends DirectRule { - public ColumnsWithinRegionsDirectRule() { - super("STBL-BASC-0002", - "Columns Within Regions", - "If a number of columns is fully contained by a number of regions with an equal number of missing stars, spaces of other columns in those regions must be black.", - "edu/rpi/legup/images/starbattle/rules/ColumnsWithinRegionsDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - //assumption: the rule has been applied to its fullest extent and the rows and regions - //are now mutually encompassing - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - StarBattleCell cell = (StarBattleCell) board.getPuzzleElement(puzzleElement); - if (cell.getType() != StarBattleCellType.BLACK) { - return "Only black cells are allowed for this rule!"; - } - //the columns that are contained - Set columns = new HashSet(); - //the regions that contain them - Set regions = new HashSet(); - //columns and regions to process - Set columnsToCheck = new HashSet(); - Set regionsToCheck = new HashSet(); - int columnStars = 0; - int regionStars = 0; - regions.add(cell.getGroupIndex()); - regionsToCheck.add(cell.getGroupIndex()); - - while (!columnsToCheck.isEmpty() || !regionsToCheck.isEmpty()) { - for (int r: regionsToCheck) { - regionStars += board.getRegion(r).numStars(); - for (PuzzleElement c: board.getRegion(r).getCells()) { - int column = ((StarBattleCell) c).getLocation().x; - if (columns.add(column)) { - columnsToCheck.add(column); - } - } - regionsToCheck.remove(r); - } - for (int c: columnsToCheck) { - columnStars += board.columnStars(c); - for (int i = 0; i < board.getSize(); ++i) { - int region = board.getCell(c,i).getGroupIndex(); - if (regions.add(region)) { - regionsToCheck.add(region); - } - } - columnsToCheck.remove(c); - } - } - // are the columns and regions missing an equal amount of stars - if (board.getPuzzleNumber() * columns.size() - columnStars != board.getPuzzleNumber() * regions.size() - regionStars) { - return "The number of missing stars in the columns and regions must be equal and every extraneous cell must be black!"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRowsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRowsDirectRule.java deleted file mode 100644 index 0a78c8868..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/ColumnsWithinRowsDirectRule.java +++ /dev/null @@ -1,97 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -import java.util.HashSet; -import java.util.Set; - -public class ColumnsWithinRowsDirectRule extends DirectRule { - - public ColumnsWithinRowsDirectRule() { - super("STBL-BASC-0003", - "Columns Within Rows", - "If a number of columns is fully contained by a number of rows with an equal number of missing stars, spaces of other columns in those rows must be black.", - "edu/rpi/legup/images/starbattle/rules/ColumnsWithinRowsDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - - //assumption: the rule has been applied to its fullest extent and the rows and columns - //are now mutually encompassing - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - StarBattleCell cell = (StarBattleCell) board.getPuzzleElement(puzzleElement); - if (cell.getType() != StarBattleCellType.BLACK) { - return "Only black cells are allowed for this rule!"; - } - - //the columns that are contained - Set columns = new HashSet(); - //the rows that contain them - Set rows = new HashSet(); - //columns and rows to process - Set columnsToCheck = new HashSet(); - Set rowsToCheck = new HashSet(); - int columnStars = 0; - int rowStars = 0; - int firstRow = cell.getLocation().y; - rows.add(firstRow); - rowsToCheck.add(firstRow); - - while (!columnsToCheck.isEmpty() || !rowsToCheck.isEmpty()) { - for (int r: rowsToCheck) { - rowStars += board.rowStars(r); - for (PuzzleElement c: board.getRow(r)) { - int column = ((StarBattleCell) c).getLocation().x; - if (columns.add(column)) { - columnsToCheck.add(column); - } - } - rowsToCheck.remove(r); - } - for (int c: columnsToCheck) { - columnStars += board.columnStars(c); - for (PuzzleElement r: board.getCol(c)) { - int row = ((StarBattleCell) r).getLocation().y; - if (rows.add(row)) { - rowsToCheck.add(row); - } - } - columnsToCheck.remove(c); - } - } - // are the columns and regions missing an equal amount of stars - if (board.getPuzzleNumber() * columns.size() - columnStars != board.getPuzzleNumber() * rows.size() - rowStars) { - return "The number of missing stars in the columns and rows must be equal and every extraneous cell must be black!"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/FinishWithStarsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/FinishWithStarsDirectRule.java deleted file mode 100644 index 36e691e74..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/FinishWithStarsDirectRule.java +++ /dev/null @@ -1,63 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; -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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -public class FinishWithStarsDirectRule extends DirectRule { - - public FinishWithStarsDirectRule() { - super("STBL-BASC-0004", - "Finish With Stars", - "Unknown spaces must be stars if there are just enough in a row, column, or region to satisfy the puzzle number.", - "edu/rpi/legup/images/starbattle/rules/FinishWithStarDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - StarBattleBoard origBoard = (StarBattleBoard) transition.getParents().get(0).getBoard(); - ContradictionRule contraRule = new TooFewStarsContradictionRule(); - - StarBattleCell cell = (StarBattleCell) board.getPuzzleElement(puzzleElement); - - if (cell.getType() != StarBattleCellType.STAR) { - return "Only star cells are allowed for this rule!"; - } - - StarBattleBoard modified = (StarBattleBoard) origBoard.copy(); - modified.getPuzzleElement(puzzleElement).setData(StarBattleCellType.BLACK.value); - if (contraRule.checkContradictionAt(modified, puzzleElement) != null) { - return "Star cells must be placed in a row, region, or column without extra spaces!"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java deleted file mode 100644 index 16951fb2a..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinColumnsDirectRule.java +++ /dev/null @@ -1,43 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.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; - -public class RegionsWithinColumnsDirectRule extends DirectRule { - public RegionsWithinColumnsDirectRule() { - super("STBL-BASC-0005", - "Regions Within Columns", - "If a number of regions is fully contained by a number of columns with an equal number of missing stars, spaces of other regions in those columns must be black.", - "edu/rpi/legup/images/starbattle/rules/RegionsWithinColumnsDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - ColumnsWithinRegionsDirectRule correspondingRule = new ColumnsWithinRegionsDirectRule(); - return correspondingRule.checkRuleRawAt(transition, puzzleElement); - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java deleted file mode 100644 index 27dc001a0..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RegionsWithinRowsDirectRule.java +++ /dev/null @@ -1,44 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.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; - -public class RegionsWithinRowsDirectRule extends DirectRule { - public RegionsWithinRowsDirectRule() { - super("STBL-BASC-0006", - "Regions Within Rows", - "If a number of regions is fully contained by a number of rows with an equal number of missing stars, spaces of other regions in those rows must be black.", - "edu/rpi/legup/images/starbattle/rules/RegionsWithinRowsDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - - RowsWithinRegionsDirectRule correspondingRule = new RowsWithinRegionsDirectRule(); - return correspondingRule.checkRuleRawAt(transition, puzzleElement); - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java deleted file mode 100644 index 4054ec017..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinColumnsDirectRule.java +++ /dev/null @@ -1,51 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -import java.util.HashSet; -import java.util.Set; - -public class RowsWithinColumnsDirectRule extends DirectRule { - - public RowsWithinColumnsDirectRule() { - super("STBL-BASC-0007", - "Rows Withing Columns", - "If a number of rows is fully contained by a number of columns with an equal number of missing stars, spaces of other rows in those columns must be black.", - "edu/rpi/legup/images/starbattle/rules/RowsWithinColumnsDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - - ColumnsWithinRowsDirectRule correspondingRule = new ColumnsWithinRowsDirectRule(); - return correspondingRule.checkRuleRawAt(transition, puzzleElement); - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinRegionsDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinRegionsDirectRule.java deleted file mode 100644 index 7af2c79ed..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/RowsWithinRegionsDirectRule.java +++ /dev/null @@ -1,94 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -import java.util.HashSet; -import java.util.Set; - -public class RowsWithinRegionsDirectRule extends DirectRule { - public RowsWithinRegionsDirectRule() { - super("STBL-BASC-0008", - "Rows Within Regions", - "If a number of rows is fully contained by a number of regions with an equal number of missing stars, spaces of other rows in those regions must be black.", - "edu/rpi/legup/images/starbattle/rules/RowsWithinRegionsDirectRule.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - - //assumption: the rule has been applied to its fullest extent and the rows and regions - //are now mutually encompassing - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - StarBattleCell cell = (StarBattleCell) board.getPuzzleElement(puzzleElement); - if (cell.getType() != StarBattleCellType.BLACK) { - return "Only black cells are allowed for this rule!"; - } - //the rows that are contained - Set rows = new HashSet(); - //the regions that contain them - Set regions = new HashSet(); - //rows and regions to process - Set rowsToCheck = new HashSet(); - Set regionsToCheck = new HashSet(); - int rowStars = 0; - int regionStars = 0; - regions.add(cell.getGroupIndex()); - regionsToCheck.add(cell.getGroupIndex()); - - while (!rowsToCheck.isEmpty() || !regionsToCheck.isEmpty()) { - for (int r: regionsToCheck) { - regionStars += board.getRegion(r).numStars(); - for (PuzzleElement ro: board.getRegion(r).getCells()) { - int row = ((StarBattleCell) ro).getLocation().y; - if (rows.add(row)) { - rowsToCheck.add(row); - } - } - regionsToCheck.remove(r); - } - for (int r: rowsToCheck) { - rowStars += board.rowStars(r); - for (int i = 0; i < board.getSize(); ++i) { - int region = board.getCell(i,r).getGroupIndex(); - if (regions.add(region)) { - regionsToCheck.add(region); - } - } - rowsToCheck.remove(r); - } - } - // are the columns and regions missing an equal amount of stars - if (board.getPuzzleNumber() * rows.size() - rowStars != board.getPuzzleNumber() * regions.size() - regionStars) { - return "The number of missing stars in the rows and regions must be equal and every extraneous cell must be black!"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/StarOrEmptyCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/StarOrEmptyCaseRule.java deleted file mode 100644 index 0aa147c6f..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/StarOrEmptyCaseRule.java +++ /dev/null @@ -1,103 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.rules.CaseRule; -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.CaseBoard; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.nurikabe.NurikabeCell; -import edu.rpi.legup.puzzle.nurikabe.NurikabeType; -import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -import java.util.ArrayList; -import java.util.List; - -public class StarOrEmptyCaseRule extends CaseRule { - - public StarOrEmptyCaseRule() { - super("STBL-CASE-0002", - "Star or Empty", - "Each unknown space is either a star or empty.", - "edu/rpi/legup/images/starbattle/cases/StarOrEmptyCaseRule.png"); - } - - /** - * Checks whether the {@link TreeTransition} logically follows from the parent node using this rule. This method is - * the one that should overridden in child classes. - * - * @param transition transition to check - * @return null if the child node logically follow from the parent node, otherwise error message - */ - @Override - public String checkRuleRaw(TreeTransition transition) { - List childTransitions = transition.getParents().get(0).getChildren(); - if (childTransitions.size() != 2) { - return super.getInvalidUseOfRuleMessage() + ": This case rule must have 2 children."; - } - - TreeTransition case1 = childTransitions.get(0); - TreeTransition case2 = childTransitions.get(1); - if (case1.getBoard().getModifiedData().size() != 1 || - case2.getBoard().getModifiedData().size() != 1) { - return super.getInvalidUseOfRuleMessage() + ": This case rule must have 1 modified cell for each case."; - } - - StarBattleCell mod1 = (StarBattleCell) case1.getBoard().getModifiedData().iterator().next(); - StarBattleCell mod2 = (StarBattleCell) case2.getBoard().getModifiedData().iterator().next(); - if (!mod1.getLocation().equals(mod2.getLocation())) { - return super.getInvalidUseOfRuleMessage() + ": This case rule must modify the same cell for each case."; - } - - if (!((mod1.getType() == StarBattleCellType.STAR && mod2.getType() == StarBattleCellType.BLACK) || - (mod2.getType() == StarBattleCellType.STAR && mod1.getType() == StarBattleCellType.BLACK))) { - return super.getInvalidUseOfRuleMessage() + ": This case rule must create a star cell and a black cell."; - } - - return null; - } - - @Override - public CaseBoard getCaseBoard(Board board) { - StarBattleBoard starBattleBoard = (StarBattleBoard) board.copy(); - CaseBoard caseBoard = new CaseBoard(starBattleBoard, this); - starBattleBoard.setModifiable(false); - for (PuzzleElement element : starBattleBoard.getPuzzleElements()) { - if (((StarBattleCell) element).getType() == StarBattleCellType.UNKNOWN) { - caseBoard.addPickableElement(element); - } - } - return caseBoard; - } - - /** - * Gets the possible cases at a specific location based on this case rule - * - * @param board the current board state - * @param puzzleElement equivalent puzzleElement - * @return a list of elements the specified could be - */ - @Override - public ArrayList getCases(Board board, PuzzleElement puzzleElement) { - ArrayList cases = new ArrayList<>(); - Board case1 = board.copy(); - PuzzleElement data1 = case1.getPuzzleElement(puzzleElement); - data1.setData(StarBattleCellType.STAR.value); - case1.addModifiedData(data1); - cases.add(case1); - - Board case2 = board.copy(); - PuzzleElement data2 = case2.getPuzzleElement(puzzleElement); - data2.setData(StarBattleCellType.BLACK.value); - case2.addModifiedData(data2); - cases.add(case2); - - return cases; - } - - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - return checkRuleRaw(transition); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/SurroundStarDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/SurroundStarDirectRule.java deleted file mode 100644 index e1c6f3084..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/SurroundStarDirectRule.java +++ /dev/null @@ -1,63 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; -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.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; - -public class SurroundStarDirectRule extends DirectRule { - - public SurroundStarDirectRule() { - super("STBL-BASC-0009", - "Surround Star", - "Any space adjacent to a star must be black.", - "edu/rpi/legup/images/starbattle/rules/SurroundStar.png"); - } - - /** - * Checks whether the child node logically follows from the parent node - * at the specific puzzleElement index using this rule - * - * @param transition transition to check - * @param puzzleElement equivalent puzzleElement - * @return null if the child node logically follow from the parent node at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - StarBattleBoard origBoard = (StarBattleBoard) transition.getParents().get(0).getBoard(); - ContradictionRule contraRule = new ClashingOrbitContradictionRule(); - - StarBattleCell cell = (StarBattleCell) board.getPuzzleElement(puzzleElement); - - if (cell.getType() != StarBattleCellType.BLACK) { - return "Only black cells are allowed for this rule!"; - } - - StarBattleBoard modified = (StarBattleBoard) origBoard.copy(); - modified.getPuzzleElement(puzzleElement).setData(StarBattleCellType.STAR.value); - if (contraRule.checkContradictionAt(modified, puzzleElement) != null) { - return "Black cells must be placed adjacent to a star!"; - } - return null; - } - - /** - * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}. - * - * @param node tree node used to create default transition board - * @return default board or null if this rule cannot be applied to this tree node - */ - @Override - public Board getDefaultBoard(TreeNode node) { - - return null; - } -} - diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooFewStarsContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooFewStarsContradictionRule.java deleted file mode 100644 index d1ed62107..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooFewStarsContradictionRule.java +++ /dev/null @@ -1,64 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; -import edu.rpi.legup.model.tree.TreeNode; -import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; -import edu.rpi.legup.puzzle.starbattle.StarBattleRegion; - -import java.awt.*; - -public class TooFewStarsContradictionRule extends ContradictionRule { - - public TooFewStarsContradictionRule() { - super("STBL-CONT-0002", - "Too Few Stars", - "There are too few stars in this region/row/column and there are not enough places to put the remaining stars.", - "edu/rpi/legup/images/starbattle/contradictions/TooFewStarsContradictionRule.png"); - } - - /** - * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule - * - * @param board board to check contradiction - * @param puzzleElement equivalent puzzleElement - * @return null if the transition contains a contradiction at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { - StarBattleBoard sbBoard = (StarBattleBoard) board; - StarBattleCell cell = (StarBattleCell) puzzleElement; - Point location = cell.getLocation(); - int column = location.x; - int row = location.y; - int rowCount = 0; - int columnCount = 0; - for (int i = 0; i < sbBoard.getSize(); ++i) { - if (sbBoard.getCell(row, i).getType() != StarBattleCellType.BLACK) { - ++rowCount; - } - if (sbBoard.getCell(i, column).getType() != StarBattleCellType.BLACK) { - ++columnCount; - } - } - if (rowCount < sbBoard.getPuzzleNumber() || columnCount < sbBoard.getPuzzleNumber()) { - return null; - } - StarBattleRegion region = sbBoard.getRegion(cell); - int regionCount = 0; - for (StarBattleCell c: region.getCells()) { - if (c.getType() != StarBattleCellType.BLACK) { - ++regionCount; - } - } - if (regionCount < sbBoard.getPuzzleNumber()) { - return null; - } - return super.getNoContradictionMessage(); - } -} \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooManyStarsContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooManyStarsContradictionRule.java deleted file mode 100644 index 2ae424d45..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/TooManyStarsContradictionRule.java +++ /dev/null @@ -1,114 +0,0 @@ -package edu.rpi.legup.puzzle.starbattle.rules; - -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; -import edu.rpi.legup.model.tree.TreeNode; -import edu.rpi.legup.model.tree.TreeTransition; -import edu.rpi.legup.puzzle.lightup.LightUpCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; -import edu.rpi.legup.puzzle.starbattle.StarBattleRegion; - -import java.awt.*; -import java.util.List; - -public class TooManyStarsContradictionRule extends ContradictionRule { - private final String INVALID_USE_MESSAGE = "Contradiction must be applied to a cell containing a star."; - - public TooManyStarsContradictionRule() { - super("STBL-CONT-0001", - "Too Many Stars", - "There are too many stars in this region/row/column.", - "edu/rpi/legup/images/starbattle/contradictions/TooManyStarsContradictionRule.png"); - } - - /** - * Checks whether the transition has a contradiction at the specific puzzleElement index using this rule - * - * @param board board to check contradiction - * @param puzzleElement equivalent puzzleElement - * @return null if the transition contains a contradiction at the specified puzzleElement, - * otherwise error message - */ - @Override - public String checkContradictionAt(Board board, PuzzleElement puzzleElement) { - StarBattleBoard starbattleBoard = (StarBattleBoard) board; - StarBattleCell cell = (StarBattleCell) starbattleBoard.getPuzzleElement(puzzleElement); - Point location = cell.getLocation(); - int starCount = 0; - int puzzleNum = starbattleBoard.getPuzzleNumber(); - boolean valid = true; - - if (cell.getType() != StarBattleCellType.STAR) { - return this.INVALID_USE_MESSAGE; - } - - // check row - for (int i = location.x - 1; i >= 0; i--) { - StarBattleCell check = starbattleBoard.getCell(i, location.y); - if (check.getType() == StarBattleCellType.STAR) { - starCount++; - if (starCount >= puzzleNum) { - valid = false; - break; - } - } - } - - for (int i = location.x + 1; i < starbattleBoard.getWidth(); i++) { - StarBattleCell check = starbattleBoard.getCell(i, location.y); - if (check.getType() == StarBattleCellType.STAR) { - starCount++; - if (starCount >= puzzleNum) { - valid = false; - break; - } - } - } - - // check column - starCount = 0; - for (int j = location.y - 1; j >= 0; j--) { - StarBattleCell check = starbattleBoard.getCell(location.x, j); - if (check.getType() == StarBattleCellType.STAR) { - starCount++; - if (starCount >= puzzleNum) { - valid = false; - break; - } - } - } - - for (int j = location.y + 1; j < starbattleBoard.getWidth(); j++) { - StarBattleCell check = starbattleBoard.getCell(location.x, j); - if (check.getType() == StarBattleCellType.STAR) { - starCount++; - if (starCount >= puzzleNum) { - valid = false; - break; - } - } - } - - // check region - starCount = 0; - StarBattleRegion reg = starbattleBoard.getRegion(cell); - List cellList = reg.getCells(); // list of cells - for (int k = 0; k < cellList.size(); k++) { - if (cellList.get(k).getType() == StarBattleCellType.STAR) { - starCount++; - if (starCount > puzzleNum) { - valid = false; - break; - } - } - } - - if (valid) { - return super.getNoContradictionMessage(); - } - return null; - } -} \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/starbattle_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/starbattle_reference_sheet.txt deleted file mode 100644 index f18965fd6..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/starbattle/rules/starbattle_reference_sheet.txt +++ /dev/null @@ -1,19 +0,0 @@ -Case Rules: -Add Star: STBL-CASE-0001 -Star or Empty: STBL-CASE-0002 - -Basic Rules: -Blackout: STBL-BASC-0001 -Columns Within Regions: STBL-BASC-0002 -Columns Within Rows: STBL-BASC-0003 -Finish With Stars: STBL-BASC-0004 -Regions Within Columns: STBL-BASC-0005 -Regions Within Rows: STBL-BASC-0006 -Rows Within Columns: STBL-BASC-0007 -Rows Within Regions: STBL-BASC-0008 -Surround Star: STBL-BASC-0009 - -Contradiction Rules: -Too Many Stars: STBL-CONT-0001 -Too Few Stars: STBL-CONT-0002 -Clashing Orbit: STBL-CONT-0003 \ No newline at end of file diff --git a/src/main/java/edu/rpi/legup/utility/LegupUtils.java b/src/main/java/edu/rpi/legup/utility/LegupUtils.java index 770ccc6a2..94f119a5e 100644 --- a/src/main/java/edu/rpi/legup/utility/LegupUtils.java +++ b/src/main/java/edu/rpi/legup/utility/LegupUtils.java @@ -94,14 +94,9 @@ private static List findClassesZip(String path, String packageName) && entry.getName().endsWith(".class") && entry.getName().startsWith(packageName)) { String className = entry.getName().replace('/', '.'); - String substr = className.substring(0, className.length() - ".class".length()); - try { - Class c = Class.forName(substr); - classes.add(c); - } - catch (LinkageError | ClassNotFoundException e) { - System.out.println("Failed on " + substr); - } + classes.add( + Class.forName( + className.substring(0, className.length() - ".class".length()))); } } return classes; diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/UnknownTile.png b/src/main/resources/edu/rpi/legup/images/starbattle/UnknownTile.png deleted file mode 100644 index 850fbf127f04020fe83c6a4f6db75078967916ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9733 zcmeHNc{G&m`yaAXmTak)X=KYg%*HS^C}WMXl|9BR3}%Lz(F{qlgir~QEfj5%rPW@R z5)lchi0qNbR+8UCz3*G+_dVx#-gAE6|ID0c=6SCBx<1!^eeUbJ&)nCU7_0pz8-?VA zKp@aYGgF)m@C{zQ1o(hYW>C;92(%$B$j*UfgJ*;N7<4klmjq@7`jNmS4uuQ?ae8jr zQ%Yu)MZVp#9TYgf8*hX(%{CU^9J!;+j0A#MNvKa$Jt+njdWBUWjaiz zWF)szlOj%Q_{4l}jLmFyB&I)FG~53;!hrZZEkL$Czq;uQtVmlB%SPO$w|oiQdrz=U z#_+W<87!wdPFDT+xnzIQ+X`==boP_4ix-N5?teH9&*aqxo4?%C6pgASKeUZ2+3BwTuCnh&U9y{~cr{+wr+PhiQw1i)A`kRWnMuo}kS3dKUx1Pvs z+jYeNqkUclcRHmgqe-o((th%VCnur6L~?n!<74B5xFnLBFpM}O_lY?g<*0aFgQ5n$ ztU+qL8mTCpI_mp?G0+mPo@09-bSYVx>!ztVlH?tRQzH-YC71JTw$u`85t7w9`&1}$ zLV%cYr}?eqF8h<$VR6%!zwsxBTwlC4f7m!$wgpLj$gQ#E6_0HAgXsu4+5Rftm(M^` zb9ZXQ+BZvr# zz6Mt1Dw9>;B2vV(;j$@!%fGoAce8kh*a27nlBfO(Cj>orwEy|>NlRdub1;7b73%CLB?4~x%*w1=ytE@?bobt?62fI7@wAl3qRUwq+r+~OEB+7 zK4d%^xSRxTJZE|L73rd3=Qid}(~BOl>QxcBO6TqJ(oWsT`6_q4)4}%rNjvYm4~Cty z^PzV;5`5mWUb`+}S(C+A!tcbty!TbOlS8mnwl&n;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u-JC+O&s z(7!;L(U>eejX+w30>CvW01gqaO(1C@&``8C$^(k>KxskoS~^Im4iT;Gfh6ea=)!b= zfjGdR09lFm{dHEWP(%QV;6c!VBVhz6jD$i#Q3RMa)B^_Kp-~93mbR9*E(s4`gCY_z z#&iZ14=g8ziuWXG`q4bs2385j?6ES#LJ%6Te;mi-oLC3cPB$mf+ysKbFOm!UQw|S9AVn*4vW&e?0vt0$|4gaBt8YOuawub>;H`|p?{7$BpUDwhz%TOP=6Tg{XaVG zrZMZC_VrHtdZ&H8)4twmU+=W9ciPuG?dzTP^-lY5opvR*bO6v!=kwTSf&;CrzOyT@ zBmxpaKT}602qe6D_2L4hWyk_TewLY~5&tm1w1f(eU_#WU)keG-ZjYTq?PM2R90U`o zHORBK8rF|IC|nzhtEmnOH7OP@Do>u?vF)j#7}y{b#Kp}c@Z;u1)ri6_TVDOep)ugE QTOg2`(SBUvUiYy70dQO53jhEB diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/black.gif b/src/main/resources/edu/rpi/legup/images/starbattle/black.gif deleted file mode 100644 index 13381a7179c2af7ad23ef064b743d3e479b56070..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 856 zcmZ?wbhEHbRA5kG_|Cv^;=~DtQ7{?;BQ*pRf3kqRt^*=Ld4hq%l;J<8jK_ur2b(#B zwPH?eSa`TyK-p`K$HqlRyCsaX?wr`T_;|m9bC-TP$)=GAEd9Z!$IhTga=X3G@YQ3og4-cz$S+!E(AlylPGv%5MYB7 z?L(weOf)n^06(eCC=@c@=NEfWh%S0_hPtstm*X@DjST^Tb@evP0s!DY@GvuM$cFf1 z6DM5ortm`|;5T<7p~)dQ=Wr6vM8gpmLZp&0xJ`zQML$U_$T&0whehb?=|gn%I6r+j z=-*Tud;DHtMWa|_5zxJQK4>%)tAm9=jCCN!IE;>uA=F352cz$c(f7eXF}UAEKbHKH zX1@=I#Zcc+-^dUOhJcNshI{pX?Yyb{C*GMz#rSWyg80q*du|g82W>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_ zewT-gTcZnF%V~K-u^{N%2@^rbI+^xpbFKDS_3v$XU!P%o(7sRmk%K*Ev zYoYF+b5g%*Z_Ti`Kg8{k+n6QFjDX}8FqXu7i}#|+_t(>v-`^PT5gx)0S`HAz0gI!C zyt!k54~|8v&3m8tC-?Fv-ITe}PR6~y@AG5I-jNnU3fTe`4iMO>XJ4w21MR*M&B~LyHET>O52r7n_v+U66}(4u$^fT+#CXq%OKwM1@fW2TdF*#;ZYh(K zV~t0H^o)2LcFLNCm34@DHq)$ diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/contradictions/ClashingOrbitContradictionRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/contradictions/ClashingOrbitContradictionRule.png deleted file mode 100644 index d25340b407edf02eebfdbc35764b0527ecea59b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5135 zcmbtYc{r5o`=1$OiL6Q4hcL=8W2`f_8Cxj3LM06|n1dN+#=eUzDNEL@sYp3TsK|aS z*^`Dk5<&|l`<5ZUp?-bO`Ci{Ye#>0*zVF=k^SM9IbFbHXO@fuhNp4ONP5=PFZE9j@ z!+hfRE)F*4-DfJpj`=v?W8z2!0C?K>E?|ZNk0<~Djv(4O&>YN9qg~0~N;o{(g`gDZ z?ZZR^0NQ$iJ~&rT0uACqa3_*53A_n393;@&i$p~S>Ol8-(ahg_YB-b$qTt=oHipJOAxudJ>OrIVpyBX< zfB>Zc6(uso9j=T*q2LH49Ent9A{41XBpNPIkwiVlWZ;DCa~Kk+t`wpVjYuXz_Be4a zWIvh?6v_$tNsXn^C`6ZE>?EoZZeQcKXQIS(8jizL;mS&gy<S`!uRb>s7nkM3x!T#bu@pfcCSC2hcbdkSc|I+Pawc&fw^&$=#CTLZlgxNi+%$Pjua@1RFmu0z?s_ z{2%=MNv#e4+phl)FMa-2>wDF>-*S6($XsB$sPfZAri8}&(LBf$U0WOl=K(P%lC<|Q z|E*;z>)lM+VFo@|Hq^JI32Uc zncWWmH4~V^uc<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- zdA~W8ayl*TuC4n1VCr}c;g|qhd317WYHB`1izp|K>r=X3^J^u{G&LhxwzYW-d)s| D%D^dv diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/contradictions/TooManyStarsContradictionRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/contradictions/TooManyStarsContradictionRule.png deleted file mode 100644 index b468ae6f6fb70271fd594e8cb6b5148dbd9153c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6199 zcmbtYc{r49+efzSB>OT#V;jRDjKSFVU8x9z!Ptf|nz5Da$ufmdSwciqvSyc3Swgn5 z@7cFec73CsulIT0&w{7CdN=_w6`?E1?_~C#(Vpc z&}3vVb-XXa*%OHcI3e9oKB~a=x+Wk1<)R9-Q81A)@zp}Qqx6F?NUI=IYv&+OXJr?l zx*8n}4vW= zq;Yc6Xp9?JR#{mYECT^UARrO~0XuZKS_52IY%Ip?v@+oCqg$ z09F+Uqyzj#t%1d2P)>i?ef*^nzeWO1RHR8pgAp$NU|DIIlWhS2u-|y7hKv7+_Bm#?cQG>`pnLqL?BT%43HfD|ssUI57}%PWJF6_lJoiZ06XG7zMTlCqNWAEMtX z|D@4%BC#ky6d)HAlx5{*6-nAMe-wUA{u6JF4sdoqF+~mX2llVAUsxFU#JgUo-%j}@ z{NDkFLjEg6 z8eZ6chKQ7VP%ng!n<@|wazVNx0=%$5HET551mP2Cg(byK3+;o&AY4$+Cy8Jg;DrQ$ z0J8tV%)gjn;J+>UUl{58w^Tn##$Oe8l7^%Sl7(`ASxAzg8Ua{$G)Bz|fkC(fOi(_s z6U_gPlJfso6#ieHCKc!(SN~%Zc!clYYJmiU{>ouAhU7UfH7$hCbp#Cj@5BFbE5CO~ zDsfV=ga5PylJKXgAbm)k1Vd^Wa&h1~GO{xc2HG0d_(!YPXz&+xIG7rYD1-o_6;w8t z000R7lS*k%<3s2wiWIgD!8?ZEaeRF zFm|Fbw7(%3_wgXr#{RLH`cc2fGNIJAnvIsKcB@@d^z#V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6J!1O)2<0Fbp9f}clc>y zW0pcVHo{`13&O*(n!`aWFQevd1Xi@;@(8UY7R~WQGKWADI*g|itlZz3)6=f!EuCgG zHcS;#5!)BYXP*;Nn$%&Y>)Q@L%Tn$|U^xg(;-vA{RmsRnhjPP$CAmmP^m4NDg73MO z3|-o+zHiEY;6XJ@oCS@Tfr~ZtFKkc$i=p=(_=WS7yeZ7n zYTFVwRO6d!cj9VRCb)csB#iTVl{_T+bb*gB-~=v|cKk}&D5 zm!FYONk%WTTgA3fj9de*u`SHLOR;j{s_)T_oaQMyPhk8V4?+aHQvqj5SUSJ?9*vqV zVyujssFH;G7_E0PbI`iBVw&SD;74D8xqkZiYE)m_1yTBqjJma2qw!NeW&7w|;T5Nx zG$x$Z_x}7IU!2#_V2Ai<&BAED%g)nM@4c+nN{xYfSW5Ab_Jbp_JtQ z&jq6Le*i+&Mm!Oqs(>pp($ZH`#_;0eDN*~mAtg_;zh@=fTb!zz+?u}Plfq=1UOjcw zISR5ms+^O4G-^9x?Gw_p{3@i>?rk*zPAw&<)A+6o8ZY+QA&QEsFAYKBR$Knm=wM%+0?_PJsew= z>Xe3zYY63}8aw09FAV39 zUz~^HR{F)i9TU`vOcIFPN9zu@RrzBfH-X(VD(Tmu+WNsNLm+9PThQ|D==$yvjXBRG zgqK%|`_sg=YUgkYZiZk6Qq2IhoxJL2-A4QZVynvJE0Z)95o@yB)%#;(QMQM5zCW2S YEnSqZ8g?u{`D@=m$5i{drepa30M6m=2LJ#7 diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/empty.gif b/src/main/resources/edu/rpi/legup/images/starbattle/empty.gif deleted file mode 100644 index 38b91d0a2b9c6599eb19d14466db047a86d2ea97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 857 zcmZ?wbhEHbRA5kG_|Cxa|Nno6Q7{?;BQ*qcKpqF>1qKc~21X7Uj|~eBHggDT#hlo% z@Nm0;vez7sjf;+UOBiR}IkEBaF$M+Z0v^pz$tNbN+pdZ^xoPR?=?2NC=6GICbzrat E0QgHHq5uE@ diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/rules/BlackOutDirectRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/BlackOutDirectRule.png deleted file mode 100644 index f72fd7d7f82687cfae12872a76855ab94d80fdcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4717 zcmbtYc|4SB-=DGXBw5Nb4jK|;8|P9ZJ! zQI>;FC@E{m8nT9GsJC;@^LhSwpZEQI=AP^RUDx;by{_MS-=F)crTJ-op2Iu<0D#}< z491!{;`c5t4(2~;G~JdtaFfoQr2qf|&3hLxU0L7=0Ki5e+B#Al%}n7qKOa>r-p`ew zO7|f#(EtDfMJHi#UIZ%0mEcbF)dMfoy#RxVcs;NK)J)BcWI*sBo(U!sY=X^galu|V z9XuF?7Y|bUpAsFPwS5Hw^(ZL1ere+!|x}1HzQ_z#dd82@Zh- z1_r7IYO4B?-685aIyw+F4Ty$@3KOA13G$_4=_bOs3KUAvRMB$NaaF;(xj|Jlbkton-JnoB&dv2F(RY=9 z(ipljS)dwF4Q;57x|TXj2YN#7r^5c?Kk>GHG@QqtDM*c>vzQVbO{04Fk&!l7GS&lRM)XDOVg6^9ne_Xv|3A5x zS(QKi`;SA=v82Bh022n^Ph3B;t)HJa(g5olfJH$5efmEh<@@QFbgF(RNEE_hC9qC{Ft%qB-?>UT(%&E)Mx~V8+cqi z9FZFFi{-g=29aAaPXA8aL#{(XY*C9mqLn8xAfY%*HN|nGfaTCs093@wBIOsAi9_M# z%OQ1?z^bSWwTywTXOmX~0zZAo(p|1wezMhh{^sr5yv*KWX>HBY6vNNjDt@o1DB_K$ z!rIfP2x8-6LVUc-;A0;VKTAuY?N+aoFXP3UkmPZ$8yOi*%YUFO{L395Ml1n_2t^WO z$lw*l*`d0O(Yc{In23mo2hlB4DOOPCD1fDH^Xp85>%&yt&356V(vbPF6jWcBh^S~< zT?gID`SKU`8|mo{nd&&j`SEf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o G67esNMHw6b diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/rules/ColumnsWithinRegionsDirectRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/ColumnsWithinRegionsDirectRule.png deleted file mode 100644 index 1a88e9d07c6a0e4a1425d9725be9d1fc130058ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6456 zcmbtZ2{hFG*SBvalx%5Cwn>a(?8DebvMXdSh8c`?n89StuClLVOP0u1WT%jILY8C~ zDQgm*gecxo&)f4n|MR@(yyt!A%x`{k@Aux%_ul)t_xn3@=FU}vE6hwhOcWFp%-UKS zM&vu{_+p?Ve`4RKnviddSS<@21;we(D3YuVyi8cR}NUc4$Y8I~=sp+zJ9>P;ii$jJ||E7J+ucX!&`ejr|Nv?EPHq z6;L1*WhNy8j11t0#v_3QH&=HYi~tAy#D$T+AFClCvXK|c0cND3`KJk4f`gp!cq|M8 z@%8l;_mvX&@N$GmDkvyGB%lx|6il`N<8Ha*kp!?iPJoQS1pJAifyUW;VX%0Nhdb~X z6KUt+jfaCkOu#>()$n*PjNNZ^cbqu#r^fr(MVy>81c|~yB*i6;!vX@8e%Zs+P`G39 z*Cxhj&!56C$rbZ+CoIwnhc>x|MZ-ZxXq<<)mp%F?!m-nzAP6rs5|2hHLnWZnU4_9zLkoP?|$SXy3M9xN{jMS&eqa(4D|vQRr|c58X-7tpfyzK-WfUZ(CFK-k0hB!i?TU6oyW@{ZlKhh-lsycO!MmdW zqDajZ|4)j@y$5qex;w%_1TYHifb@37gOm{-uHJ6$I5Q013FB@=ZfXyAoCd}VZI3td zc0~ihK*@i}^G|3c$lrGTe`JaMTdyB?D-C&8&S-6}EH(J7#n2>-N>|{}@!LmXH#&`vDPu8=t!@mHr{;OY?5P#+U5nZ2!UYAx0(PdcugHAmuu@ zX}S>A+X}d)2MrCxR8e-Op}+U5C~Ls9sr1&nXxt%f1oG=EHae*iJ~=AGeiyHD?aW3pP=0wI#P{qVwO!?Z{r*E)WX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Lt)8M7t#90rbeobMy9jCh4xO2qF;_@$iku2Oa1IJ_U+T~J$60?%Ywcu;3OYQ&Rj~@s&h-d;7$xYR5qb`l3Ghh5!+`%zpG?C9;FK zGv5(42~&D(b9Zj0Z*Tg2w)a%z8p3Jpa^De)qVWa?3wuW4@qZiImkl%?tJ{YD7u6Y@ A-2eap diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/rules/ColumnsWithinRowsDirectRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/ColumnsWithinRowsDirectRule.png deleted file mode 100644 index 24fb0d48a84c46608fc3ab3335ab0df053898bba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5331 zcmbtYcT|(vwueg*kQyDON~i$@LNAdb0i+2Aq$-FZ2{n)q0)%b}A~nAZkGXXdW^$6N2Nl`miR*?a%?+3oDJ5(zUiU}NEBp`oE+Gcwe( zpuUku4-+Hx8#|F=NqsS64efkrXxLvJJ+vw3+4*Q_=!4xXZSl6Immvs@rz{+aaYD%w zJh4=18X6640v3+&K;eN-C>J*`P0&(Z6A0*r)CAcmo64DDby2QvhJiTL)j%^#M4$&k z9SPFbV$mQ#r~sZQJRC^yM0@!_2%4Z{TnP2|(J~lB6~ZB%Ar^X@rv(}iY(P>FdXRvmY0<~+7=L~@k1V>gY-Ef ze;B!n@;)YhP-wSfOISG02W1(6MQMU8P(B!690GNWaHRATL>GsG<55U01vv#J89C}l zT?71YtRowLDd-dMMo2AXHB|*gC3S?1v$C_3j1p4bSq84As4SzVBqxtjc2-wYbyoNV z^h4#JFqfQ;P!yCERFu`_mE={`mDS{aDI7EZDQ}7KMYtZhqV*TjbJ8?mV}4j90IUbR_RSb^ex85ZU!o! zy16nEa0T%|*=$K==7kqZV#2nIytge1YipT>=#^+$fzc-AdW`qcBr(y?U8cg~0lVqd zqF~y8K~#EsFTc;;zf#>U*c344ukODX6aWs8AD-&N&i6lCteYA2Z}jP0%JOMkk{&bv z>UTl<%*nk_ZNIM{Y4y!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@A**Or7?Z8C>>W3N?-LXuod(x$K=DJ>Riq zTA&z;iZ*6aZ(jmw$U_(ZMhP+{B|8Qv+LBOH~SvTsGc(u*%AebO;KT#yQcE`N^##z2e}YXrj)2Yvn%vXPc*mSH-xuTPuGCn zRGRP%mz%Ae3oXm26sLn+w*Vp%^6tP0By;_N(_R#GVD ztq6k3(1TfbtM>B!t)FCOPg~j)+y9xR8MH;q%ayAV&g-Xuo8=J!`n{!es1N2OBgq&1 z$C~3_U${CXrh>OCxk+0b9Kvw>Ce0&fx-oTtYQy#2X}_XK;QK@s-E6F1iy$V1 zNi6N9k;wB;9kUG7`{1>duCh2m?T+ioyx&ffCqVBLtLA{u%UwF1Pu8oB+O>wxKYeVw id9c50H<`P9$nc%LI{9H#w%gI)jz;=sdd1M2cm4;2F`f_r diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/rules/FinishWithStarDirectRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/FinishWithStarDirectRule.png deleted file mode 100644 index 11cfbf89965d94b114cf32be6944f2703f4ee90f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4326 zcmbtYdpy%^|KCiCoJEeaNlmnkIZn*vd`xRXM6-RdjLiVnSp3MEEbE_#h@`5qyT|rMTW9TTx2L~lYl`Cw#s1*u*gg*gH5G}!d5s*{&Wu8 z9Dxvn{iL>Jvzb)?U+keQ6lryYv!a3$7>y=TSZFGkkm}Fp;VMXaDi4_wdu>lGWql+;>>IyDHGxR^ER@V4a z!G_Crpy2fNNf;~;;Ey!I7#Sc9$VOzOzY)d|NudCM5ny0qWTN*c(GQis)7bh8SPU_S z7$ZZho`Ie**3d-v*UGDtf5#K)9CFZ#DLBk8*q>voSTppBcWKlgPFWRxdgYhK510J_ z{v|B`|4>oLzrw`eFlnnPKp~?68V~}6vR8tn_cKTovMHO&rU8G3$dbnXdx!+NXG$Z5 z2AU(dND2@@;?UR#oGmq!$_nzJvV(TBNla@h6Ckq*92x*a!u0-)g+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48c=Ucd zY;dW`bKrZLux0Jqvu9$rzG*Lb{77U6wHIh7Zf^B}_(en#a@B(a-)wb@D&tfiIvPF@ zW4z2cBs*G%eu4RFG2t_`>k{-;z$i=p?$i@;8KHCFdE$>ek!Q|*dF}ZzyDM4PNt@b2 zzvjXrHnqVR`V;=zw$k}-x~Q$&@!@WUTBxdN;o*-@*x9A8J9XC_s;{$-O;&s38mbx( z31vSr2A5tL?|mnp3SCDNr2k44EFFd%Ak= z^+?25nC2{1I5lKDv(@EXxY1YOGtg78%eUxney9exP${Q8IKtp_`Uio&wux57Ro96B E0_Y@20RR91 diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/rules/RowsWithinColumnsDirectRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/RowsWithinColumnsDirectRule.png deleted file mode 100644 index bac64a87c9ae9df53b8be031c17306773ccfba7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5117 zcmbtYXH-+$whmPcRivswL?nPfAV8?0D@8g{Kv0NDkdg#Q0)!|iML{}J6r+er6Tw22 z-jrUXDP55w(nLUdxdDBibMCl5-hFS3-R4@~{MM{%XXmzsnE^ZS2oL}Oup1fbThZ?5 zy_1ERcJ=&{h@jmLdK%gh0RWD-dnaAuDUPE60OK`Rge}R|)I<&Cfs;j|JuYKp$v96M z8UWDHB6}iH?idp2GUkda9uEFqRs{yRqTyg0B~v+5Pd$u_t09Gev8I?IP!xBRDjKY% z3Dh8~(FkxD5)wqlVev#YG90|mt44d?8-{>sAOhN1%}W2wZwO6-gI!1@Pc;a{*Vk9p zS3%Z;a0Mc-s;UZ+gF>KC85%-{=!YjE$ufB22^s?sw9lcBA)*Mbo+MWfJZO&-dD+98 z1P6nGpx@LwBoe{(@*j3QQ5LyB;=QLLOLH26L=z$MvT}Q7fj}C+@M=0};-2_x5o?Us zzVJ)Jy6&&!i6js)2tQ8@9BhRldUz91n0oBv>?kad@J>D*=NdS$ShIAQ_PSe{k|Q zuLk6AOa4D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no{KIFpbroQ9J;}x&G=u6vGWYIocHuMp*t>gPe$(Y zmfii4nVB#2MdIV4E^2{UNA(zggfnMNg$8s1nW8|S+-%@K4pIC5N3@+T=p zbR*Y_R&(MBoB$#(f4f)}m9ND7hLvB|g_09_*x_`6vi%qyQb0GL>wfk1(UJ4olE?lrDUZQ*AhWSUa>dWD08 zc3l{99qCicSw7dZQ|3#)-rM_xDGk_O!EDj$Qasn8Z@f<628*JSWG^-Yy~xhA&$XOmkK9j-_%9ziQLgPi-WX>BOR-AuU#K}Sdxt`6 z(I3%SHje&@O+s1$8tx2zZ0i>WBb7^{gw&IoZiQAyNLtDwA5?ouIaE5@+BQn%*uD;0 zw`QB|BSooQ;35Zm%5Nt~THl+^&X!uy@_FKZ^6p@yjn|lp;P{uq*DeeR?l=W(FjiAP zAt@=(i)UgMx?}NGZw<2*2DC6>{bG5bXlm&M4s7@~ diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/rules/RowsWithinRegionsDirectRule.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/RowsWithinRegionsDirectRule.png deleted file mode 100644 index 8907e047521d5310676821ddb141672f2b5e4d7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6477 zcmbtZcQ~7E+qd_s+B2m@6tNWvYLptKk(L_KAcz%>*t@DqYb$C~qqMb(+Ix?pt=`^PtqBX{nc*Y&%8=XH+jJdgWMn89sLS}G1I0s;csTUzQc{N4KE zq9DV6yL^8E$KNPjwC=kS5YV+f_b6xx|&A%uA6%WU_S=n8fq9pkj?C-JPSP1ySyN>8T zobp@v(<^_i_`_v?0RIt||9Pmat^Nv=iyPMQcM4crfl-bqCzLbpB1jT{2Fcn=0f)vp zqW%ui4M*I+h6tZ~3XVu;TPV;|)EZ@jbaTW3m0%bTS0gme4($xXXEesyRUM5*S>a%A zjwpaAK;l0b`6n*~{127?4-;Mfk?0qx`1`zFBq4qRZ=ckk_TeRk8*Vr|3|7eyiACB0 z^w7?b3(S9y;=y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urroundStar.png b/src/main/resources/edu/rpi/legup/images/starbattle/rules/SurroundStar.png deleted file mode 100644 index 13287f779e74d6c70489f32013ec3675b07dfe4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5102 zcmbtYc{tQ>*SBZM8rhPG82cDm$JW?|5V9qP84SZPGZ;H%-wR1f+1He%ku8##gv!2G zS`cI3m7byAe!t&yJ%7B<`(D?4=bm%!b3SLkulqakW*7CD8Tl9~C@7c>4RkJ%SNP#W zPe=atnaQ*yFAP2gwpa=ZmX5=RGEIKCOM7F5$q0;qBMcn`)&+y~!6DJ!fJ01}GujWQ z4g@j+enUfXI1JMH54ty226n{pJ5-S&2MvP3u^_OF?4er#fZ8v42o#PzB!3yPK=>XJ zzbF*)$dV5XgGE>d`XJPSmk?OAAI1f7gm9?z8$=s}fZ-5u4LMmkd1+blM@|j&Z(D~p z{!-Az;|$>%2!s+?!Bq|}tpaw2Nz1#!;nK=ru$(kZ!IexnyU2qT6#oGIQu!y0o--Lm zK~6zVQ9%VP4^~o9P?r6paJ2bPc}ujPi~C_H8h<(X7wn``2+kb zWxoXfR+j&Lso*Yu%H-pRK^?UK+y#U{A-oXYxWgiWe-{bv0>L41D8yeSf}(K$ED^c) zASjr(n>r9L4M(`b{7^Wch8Bw4&!&Dj9V7(U=|f9(jWt*16wdktqn&59f}?Xjs57Fn53n(p&9N=6|^4rawyk|0%uXsr-}Q ze>j1M`TT7F$YPMA#zkW+(P)&0Hq6@}rUv?V_J4Hcmv`j3CQmr%&pALQ{+uKTZ}Rbh zA)gcYj$^SD6s%_qb)c5`yQF(eKAgIIU2gvCqO7MG&WttVqt2oXZl%#sGn`3V(W|R6 zW2H@ubv6{YikP(u%n%vO%e~PN5vTJ3pPnXCM$C*8lX##)Pepm-y4I?WTF0j!EGw-C zLB&c@|W%(7}y2=C?+|EtVZYE zB%tdbzRjXO#^UrMhMCyY6BT-0V4rnSpR{DRc;Hc=C&Uj=M7hFU+pZ$@ry?PX<1I{2 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=NL>yi;*U%^s@vovFF&EI_v zDG2v=aljk#Tu3l-s-Ku@7RU=_bN-)vS4k@Ef-3x)VW^OT64$+gIud-sBs{FmYrz~7#8_V(=?PMI%RD5YRntoy$V zJ??quU>FXAJaDgC*L!Mly1!rP-XIH#NI1iDN6C^}i@QT)=v;n-?BbOPMEyYVF+85+ zFu+gkMeX2V*ih@2DIij7#C9<2b3mXP&^>YAEdQ#KnN;Yy?zwOWo!0WOxvY1r#rI9d zaS;OvUu)2X#7-5`480*U^z*QR&SJv(&wU0j5M|W>6q=_d%T-uiTp(KaV&8Dz06W#h zF`6x8??}o3h8nx$&mAu{>+4t~pziG|$mla;ZeL zNJvteDHIi|CRCHzFH8%CLPH?eUQe*c^)=@Q8Z6yNBEPomGU?4d1Z_y17AD^!PqqlO zc|6IVOBS+3m+HN2WE_3H7?XfXdw4USBlisM;5#$z!mzW$807HEdGZamMjf5IfTJmI zb*DDZkNEBdYVzELn;jvIaT1Uo+`aV$p?YKh={pTN>4;Oa4hxa%RetK|?%=F>`iL(5abs=w(U+qO@9{wX|sC!YTO3UfmzW@w;>+Jvl diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/star.gif b/src/main/resources/edu/rpi/legup/images/starbattle/star.gif deleted file mode 100644 index e289b287ae12d06741cf5d97a0413691752c4f49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 545 zcmV++0^a?JP)Px$+et)0R7gwB)k~;OQ4|O8-%S#Q6f(WuN(@LbxC6?>z|bQh@)#H)BSjf;3uWXn zP!c6GWTuoTBMJi~86e~tQXYG0-#TsIx!*bRl~udbx7OP0zy9m7zdk*dz8=T--vKPZ zNZe}5ye)&{8DLYd0Dk7cjT39^h^+_)Av2;~qv~I+oyO zH;_68qf-gSS5A~<6}DyFAzZ*gyu-&-wh#DP0#*UeVHPIj6985Df-zYUfr3d@-r_ah z<1to;v1D)nd-JVpIkQjs`y%Q0XIp&7Vq88Gu{7JF`N8ys&8EnBIreozzwXyvjSvlDruB;5x!$Xnyj1X!07h$Pn6jcYf6SBM5q!d&djqZoq_nZLnHO!*stxbz$k z^O6OVs+_<8W@9oUnLlJW2AgrJxN#Uiu)EO55S(udFjW7z7Y*E=w)sI0G84zJJpYbF zwzLI!nx2AqGGew**VH(+^=R_>j2PR-CF)OWzawq%uDa$G`gogyQMoI%|H<=lr(y6R jw|ThRX3<*4@9h2yt8`HryKo;Y00000NkvXXu0mjflb`cS diff --git a/src/main/resources/edu/rpi/legup/images/starbattle/white.gif b/src/main/resources/edu/rpi/legup/images/starbattle/white.gif deleted file mode 100644 index fc2c683eb7860f47d4322fe0e73b0508099a89de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9700 zcmeHLc{G&m`yXUY*@a4DN~m|3jbSpD>_yqiTFlB|W|$df2ni+9B3ZI!iP9olg(zhy zDN6P%@ghW)tVww zXp@<#p*8RiUi}I10as=~zzhh)6C7Y`&$7m`!QKoync_tPv;4hDU=oKy27x%86-TLs ze<}-qYgCyNh~HqkEkeZRK05JFdf0YdrPz)DpXpj#VF86Cn*La;%ZlH;h$t0N87TfDHCCNg0#+}qI&uY?JDbd)8rSCUgNfSlsq3f<6qSd-f&(ymiE zC+hBE%9nX6bNo~jHRU1K^ip2yT~+jpxmk&BKhBr!L2L~U??Gtg!9+U+he>h)RY6ua zKH720cx&)3d8!z*DD!-~j^#q{B4^h(_f!Ekn@1$PsCRt2(nfo<>T?5+WSYdjj(s=u zbfky&8J^9mU(^zNf1*fdKKdAO$5VV4+V_2(mzJiq=uW1iq189;PRzmm1&V4?p~cy% zyxG=}GvcY*>Mxrq*+Xw`+Mas*gD+lFT-6?iYvxGy}p4*1MY=Eo(Uu~1)AB1&L&2FiC&X##1>WZOW?(83e#Wu~Hx7dBy5t(U>l6g~@{S?632e#7 zl5XS`vJ~h7U9K<<*Qg~>%&kn`CGgPwx=bt~rq%ukWl;8} z3MP>{XJn2wYpOoDlX*PM_=vhilEo{he0L9W9ix9&$^8B(v)Jq_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WZ4vy3yZh{FsDP?b2Z-=kWEA_7owG)^6XBH^KAEd&q^NfQCZ zqj3l*PMwU>LZY=akTBv}G(-Z%n9iW$fa#=Aac(3vZ<^bhVwG@=zNHx!f>4G1EwS{% zvB-b}um&hJBAw0rTV+e3l5AMGRX*Vw>YD0sbvPUe*VNL`ME-4bl*C{HwYZ83hp8eo z*EFjWg8|Y3sKu>TDgdx12eQE!Fi1ESoncF-dto7~L4j92*9si0{bO28DNMk^f3@a+ zR=o|$=f~5JMc_qQQ-Q&2g^R%vehk9I`H_CG0Qmh-5!`V!HxjVIf0oo=a>{?0E<8$; zK+w`8LrEwc9*Tk^$WSdJ2?j;s2{?df5|T*xLEJBNCY{V;;}|4;Hy~3W8=!>NvH>gq zBvWNA?O*n6chV|TFkpSd&`<=z7LLLoH8DseMD1s?YO8DduWYr|{udwGYX-k<0)XES z8L+tkdzIR+&FUv#z}WxI&(C@IZw>(luMhIC_+6)Kovweyz`rtHuda2v{uKlN%6PrH z{@>^l`un&;q5*F}Y~V0+!$cwZ|LC-vMy_|-*E{X&o%Z!k`+BE+z0sK-pp6o%KQ2&GiVPs+XPH?T@elD! zi|2uE&vc9GowR>dHY>M{|6I<%h><` diff --git a/src/main/resources/edu/rpi/legup/legup/config b/src/main/resources/edu/rpi/legup/legup/config index 4aef6de60..ccd4f5be3 100644 --- a/src/main/resources/edu/rpi/legup/legup/config +++ b/src/main/resources/edu/rpi/legup/legup/config @@ -31,10 +31,6 @@ - + fileCreationDisabled="false"/> diff --git a/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java b/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java deleted file mode 100644 index d42f40c87..000000000 --- a/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package puzzles.starbattle.rules; - -import edu.rpi.legup.puzzle.nurikabe.Nurikabe; -import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard; -import edu.rpi.legup.puzzle.nurikabe.NurikabeCell; -import edu.rpi.legup.puzzle.nurikabe.NurikabeType; -import legup.MockGameBoardFacade; -import legup.TestUtilities; -import edu.rpi.legup.model.tree.TreeNode; -import edu.rpi.legup.model.tree.TreeTransition; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -import edu.rpi.legup.puzzle.starbattle.StarBattle; -import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; -import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; -import edu.rpi.legup.puzzle.starbattle.rules.BlackoutDirectRule; -import edu.rpi.legup.save.InvalidFileFormatException; - -import java.awt.*; - -public class BlackoutDirectRuleTest { - - private static final BlackoutDirectRule RULE = new BlackoutDirectRule(); - private static StarBattle starbattle; - - @BeforeClass - public static void setUp() { - MockGameBoardFacade.getInstance(); - starbattle = new StarBattle(); - } - - @Test - public void BlackoutDirectRuleTest_ColumnBlackout() throws InvalidFileFormatException { - TestUtilities.importTestBoard("puzzles/starbattle/rules/BlackoutDirectRule/ColumnBlackout", starbattle); - TreeNode rootNode = starbattle.getTree().getRootNode(); - TreeTransition transition = rootNode.getChildren().get(0); - transition.setRule(RULE); - - StarBattleBoard board = (StarBattleBoard) transition.getBoard(); - - StarBattleCell cell1 = board.getCell(1, 1); - cell1.setData(StarBattleCellType.BLACK.value); - StarBattleCell cell2 = board.getCell(1, 2); - cell2.setData(StarBattleCellType.BLACK.value); - StarBattleCell cell3 = board.getCell(1, 3); - cell3.setData(StarBattleCellType.BLACK.value); - - board.addModifiedData(cell1); - board.addModifiedData(cell2); - board.addModifiedData(cell3); - - Assert.assertNull(RULE.checkRule(transition)); - - for (int i = 0; i < board.getHeight(); i++) { - for (int k = 0; k < board.getWidth(); k++) { - Point point = new Point(k, i); - if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || point.equals(cell3.getLocation())) { - Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); - } - else { - Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i))); - } - } - } - } -} diff --git a/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/ColumnBlackout b/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/ColumnBlackout deleted file mode 100644 index ddcc4dc9a..000000000 --- a/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/ColumnBlackout +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RegionBlackout b/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RegionBlackout deleted file mode 100644 index f2a5b42d9..000000000 --- a/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RegionBlackout +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RowBlackout b/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RowBlackout deleted file mode 100644 index f2a5b42d9..000000000 --- a/src/test/resources/puzzles/starbattle.rules/BlackoutDirectRule/RowBlackout +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 9c121cc5114ac538bc8707fbd49b7ebf9f590e8f Mon Sep 17 00:00:00 2001 From: Bram van Heuveln Date: Sun, 5 May 2024 18:04:06 +0000 Subject: [PATCH 35/36] Automated Java code formatting changes --- .../edu/rpi/legup/model/PuzzleImporter.java | 27 ++-- .../legup/puzzle/treetent/TreeTentBoard.java | 2 - .../puzzle/treetent/TreeTentImporter.java | 1 - .../treetent/rules/FillinRowCaseRule.java | 37 +++-- .../edu/rpi/legup/ui/ProofEditorPanel.java | 2 +- .../rules/BlackoutDirectRuleTest.java | 49 +++--- .../rules/EmptyFieldDirectRuleTest.java | 83 +++++----- .../treetent/rules/FillinRowCaseRuleTest.java | 49 +++--- .../rules/FinishWithGrassDirectRuleTest.java | 149 ++++++++--------- .../rules/FinishWithTentsDirectRuleTest.java | 152 ++++++++---------- .../rules/LastCampingSpotDirectRuleTest.java | 80 +++++---- .../treetent/rules/LinkTentCaseRuleTest.java | 33 ++-- .../treetent/rules/LinkTreeCaseRuleTest.java | 46 +++--- .../SurroundTentWithGrassDirectRuleTest.java | 62 ++++--- .../rules/TentForTreeDirectRuleTest.java | 151 ++++++++--------- .../rules/TreeForTentDirectRuleTest.java | 63 ++++---- 16 files changed, 450 insertions(+), 536 deletions(-) diff --git a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java index c22831c8d..0902478db 100644 --- a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java +++ b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java @@ -6,8 +6,6 @@ import edu.rpi.legup.model.rules.Rule; import edu.rpi.legup.model.tree.*; import edu.rpi.legup.save.InvalidFileFormatException; - -import java.lang.reflect.Array; import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -132,18 +130,19 @@ public void initializePuzzle(Node node) throws InvalidFileFormatException { public abstract void initializeBoard(String[] statements) throws UnsupportedOperationException, IllegalArgumentException; - /** - * Used to check that elements in the proof tree are saved properly. - *

Make sure the list elements are lowercase - * - * @return A list of elements that will change when solving the puzzle - * * e.g. {"cell"}, {"cell", "line"} - */ - public List getImporterElements() { - List elements = new ArrayList<>(); - elements.add("cell"); - return elements; - } + /** + * Used to check that elements in the proof tree are saved properly. + * + *

Make sure the list elements are lowercase + * + * @return A list of elements that will change when solving the puzzle * e.g. {"cell"}, {"cell", + * "line"} + */ + public List getImporterElements() { + List elements = new ArrayList<>(); + elements.add("cell"); + return elements; + } /** * Creates the proof for building diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentBoard.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentBoard.java index 6ded23a18..c8962aa03 100644 --- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentBoard.java +++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentBoard.java @@ -3,8 +3,6 @@ import edu.rpi.legup.model.gameboard.Board; import edu.rpi.legup.model.gameboard.GridBoard; import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.tree.Tree; - import java.awt.*; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java index c791617ce..56dcca59f 100644 --- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java +++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java @@ -5,7 +5,6 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; - import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FillinRowCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FillinRowCaseRule.java index a796c992a..aaa1a8fbc 100644 --- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FillinRowCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FillinRowCaseRule.java @@ -1,11 +1,9 @@ package edu.rpi.legup.puzzle.treetent.rules; -import edu.rpi.legup.model.Puzzle; import edu.rpi.legup.model.gameboard.Board; import edu.rpi.legup.model.gameboard.CaseBoard; import edu.rpi.legup.model.gameboard.PuzzleElement; import edu.rpi.legup.model.rules.CaseRule; -import edu.rpi.legup.model.tree.Tree; import edu.rpi.legup.model.tree.TreeTransition; import edu.rpi.legup.puzzle.treetent.TreeTentBoard; import edu.rpi.legup.puzzle.treetent.TreeTentCell; @@ -13,9 +11,7 @@ import edu.rpi.legup.puzzle.treetent.TreeTentType; import java.awt.*; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.ListIterator; public class FillinRowCaseRule extends CaseRule { @@ -95,7 +91,6 @@ public ArrayList getCases(Board board, PuzzleElement puzzleElement) { } /** - * * @param iBoard the board to place tents onto * @param tiles the locations where tents can be placed * @param target the target number of tents to place @@ -111,14 +106,21 @@ private ArrayList genCombinations( boolean isRow) { ArrayList generatedBoards = new ArrayList<>(); genCombRecursive( - iBoard, tiles, target, 0, new ArrayList(), 0, index, generatedBoards, isRow); + iBoard, + tiles, + target, + 0, + new ArrayList(), + 0, + index, + generatedBoards, + isRow); return generatedBoards; } /** - * - * Recursive function to generate all ways of placing the target number of tents - * from the list of tiles to fill. + * Recursive function to generate all ways of placing the target number of tents from the list + * of tiles to fill. * * @param iBoard The board * @param tiles Unknown Tiles to fill @@ -128,10 +130,8 @@ private ArrayList genCombinations( * @param selected the cells which have tents * @param index The index of the clue * @param isRow Used for checking if the board is good - * - * The generated boards are placed into generatedBoards (passed by reference) + *

The generated boards are placed into generatedBoards (passed by reference) */ - private void genCombRecursive( TreeTentBoard iBoard, List tiles, @@ -168,14 +168,23 @@ private void genCombRecursive( // // Backtracking: // Remove the placed tent from the board and selected - for (int i = currentTile; i < tiles.size(); ++i){ + for (int i = currentTile; i < tiles.size(); ++i) { TreeTentCell tile = tiles.get(i); selected.add(tile); PuzzleElement element = iBoard.getPuzzleElement(tile); element.setData(TreeTentType.TENT); iBoard.addModifiedData(element); if (goodBoard(iBoard, index, isRow)) { - genCombRecursive(iBoard, tiles, target, current + 1, selected, i + 1, index, generatedBoards, isRow); + genCombRecursive( + iBoard, + tiles, + target, + current + 1, + selected, + i + 1, + index, + generatedBoards, + isRow); } element.setData(TreeTentType.UNKNOWN); iBoard.addModifiedData(element); diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java index 8401e19f2..645a2c0d7 100644 --- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java +++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java @@ -580,7 +580,7 @@ private void saveProofAs() { if (puzzle == null) { return; } - + LegupPreferences preferences = LegupPreferences.getInstance(); File preferredDirectory = new File(preferences.getUserPref(LegupPreferences.WORK_DIRECTORY)); diff --git a/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java b/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java index 7789b273b..59d5b37af 100644 --- a/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java +++ b/src/test/java/puzzles/starbattle/rules/BlackoutDirectRuleTest.java @@ -2,30 +2,30 @@ // Commenting this out for now, but once Star Battle is fully implemented this should // be uncommented and finished. -//package puzzles.starbattle.rules; +// package puzzles.starbattle.rules; // -//import edu.rpi.legup.puzzle.nurikabe.Nurikabe; -//import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard; -//import edu.rpi.legup.puzzle.nurikabe.NurikabeCell; -//import edu.rpi.legup.puzzle.nurikabe.NurikabeType; -//import legup.MockGameBoardFacade; -//import legup.TestUtilities; -//import edu.rpi.legup.model.tree.TreeNode; -//import edu.rpi.legup.model.tree.TreeTransition; -//import org.junit.Assert; -//import org.junit.BeforeClass; -//import org.junit.Test; +// import edu.rpi.legup.puzzle.nurikabe.Nurikabe; +// import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard; +// import edu.rpi.legup.puzzle.nurikabe.NurikabeCell; +// import edu.rpi.legup.puzzle.nurikabe.NurikabeType; +// import legup.MockGameBoardFacade; +// import legup.TestUtilities; +// import edu.rpi.legup.model.tree.TreeNode; +// import edu.rpi.legup.model.tree.TreeTransition; +// import org.junit.Assert; +// import org.junit.BeforeClass; +// import org.junit.Test; // -//import edu.rpi.legup.puzzle.starbattle.StarBattle; -//import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; -//import edu.rpi.legup.puzzle.starbattle.StarBattleCell; -//import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; -//import edu.rpi.legup.puzzle.starbattle.rules.BlackoutDirectRule; -//import edu.rpi.legup.save.InvalidFileFormatException; +// import edu.rpi.legup.puzzle.starbattle.StarBattle; +// import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; +// import edu.rpi.legup.puzzle.starbattle.StarBattleCell; +// import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; +// import edu.rpi.legup.puzzle.starbattle.rules.BlackoutDirectRule; +// import edu.rpi.legup.save.InvalidFileFormatException; // -//import java.awt.*; +// import java.awt.*; // -//public class BlackoutDirectRuleTest { +// public class BlackoutDirectRuleTest { // // private static final BlackoutDirectRule RULE = new BlackoutDirectRule(); // private static StarBattle starbattle; @@ -38,7 +38,9 @@ // // @Test // public void BlackoutDirectRuleTest_ColumnBlackout() throws InvalidFileFormatException { -// TestUtilities.importTestBoard("puzzles/starbattle/rules/BlackoutDirectRule/ColumnBlackout", starbattle); +// +// TestUtilities.importTestBoard("puzzles/starbattle/rules/BlackoutDirectRule/ColumnBlackout", +// starbattle); // TreeNode rootNode = starbattle.getTree().getRootNode(); // TreeTransition transition = rootNode.getChildren().get(0); // transition.setRule(RULE); @@ -61,7 +63,8 @@ // for (int i = 0; i < board.getHeight(); i++) { // for (int k = 0; k < board.getWidth(); k++) { // Point point = new Point(k, i); -// if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || point.equals(cell3.getLocation())) { +// if (point.equals(cell1.getLocation()) || point.equals(cell2.getLocation()) || +// point.equals(cell3.getLocation())) { // Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i))); // } // else { @@ -70,4 +73,4 @@ // } // } // } -//} +// } diff --git a/src/test/java/puzzles/treetent/rules/EmptyFieldDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/EmptyFieldDirectRuleTest.java index 8ffb2ee4f..c704d59b7 100644 --- a/src/test/java/puzzles/treetent/rules/EmptyFieldDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/EmptyFieldDirectRuleTest.java @@ -26,17 +26,16 @@ public static void setUp() { treetent = new TreeTent(); } - /** - * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule - *

Empty - * XXX - * XGX - * XXX - *

Makes the (1, 1) tile GRASS - * Checks if the rule correctly detects no trees around the grass tile - */ - @Test - public void EmptyFieldTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule + * + *

Empty XXX XGX XXX + * + *

Makes the (1, 1) tile GRASS Checks if the rule correctly detects no trees around the grass + * tile + */ + @Test + public void EmptyFieldTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/EmptyFieldDirectRule/EmptyField", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -70,17 +69,16 @@ public void EmptyFieldTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule - *

Trees are at (0, 0), (2, 0), (0, 2), and (2, 2) - * RXR - * XGX - * RXR - *

Makes the (1, 1) tile GRASS - * Checks if the rule correctly ignores the trees on the diagonals - */ - @Test - public void DiagonalTreeTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule + * + *

Trees are at (0, 0), (2, 0), (0, 2), and (2, 2) RXR XGX RXR + * + *

Makes the (1, 1) tile GRASS Checks if the rule correctly ignores the trees on the + * diagonals + */ + @Test + public void DiagonalTreeTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/EmptyFieldDirectRule/DiagonalTree", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -114,17 +112,15 @@ public void DiagonalTreeTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule - *

Trees are at (0, 1), (1, 0), (1, 2), and (2, 1) - * XRX - * RGR - * XRX - *

Makes the (1, 1) tile GRASS - * Checks if the rule is not valid when there are adjacent trees - */ - @Test - public void EmptyFieldTestFail() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule + * + *

Trees are at (0, 1), (1, 0), (1, 2), and (2, 1) XRX RGR XRX + * + *

Makes the (1, 1) tile GRASS Checks if the rule is not valid when there are adjacent trees + */ + @Test + public void EmptyFieldTestFail() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/EmptyFieldDirectRule/EmptyFieldFail", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -153,17 +149,16 @@ public void EmptyFieldTestFail() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule - *

Tree at (1, 0) - * XRX - * XGX - * XXX - *

Makes the (1, 1) tile GRASS - * Checks if the rule is not valid when there is one adjacent tree - */ - @Test - public void EmptyFieldTestFailTop() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests EmptyFieldDirectRule + * + *

Tree at (1, 0) XRX XGX XXX + * + *

Makes the (1, 1) tile GRASS Checks if the rule is not valid when there is one adjacent + * tree + */ + @Test + public void EmptyFieldTestFailTop() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/EmptyFieldDirectRule/EmptyFieldFailTop", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); diff --git a/src/test/java/puzzles/treetent/rules/FillinRowCaseRuleTest.java b/src/test/java/puzzles/treetent/rules/FillinRowCaseRuleTest.java index 71b478e7a..3b8389407 100644 --- a/src/test/java/puzzles/treetent/rules/FillinRowCaseRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/FillinRowCaseRuleTest.java @@ -6,17 +6,15 @@ import edu.rpi.legup.puzzle.treetent.*; import edu.rpi.legup.puzzle.treetent.rules.FillinRowCaseRule; import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; import legup.MockGameBoardFacade; import legup.TestUtilities; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import java.lang.reflect.Array; -import java.util.ArrayList; - public class FillinRowCaseRuleTest { - private static final FillinRowCaseRule RULE = new FillinRowCaseRule(); + private static final FillinRowCaseRule RULE = new FillinRowCaseRule(); private static TreeTent treetent; @BeforeClass @@ -26,11 +24,11 @@ public static void setUp() { } /** - * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles - * and a clue of 0 tents in the row. + * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles and a clue of 0 + * tents in the row. * - *

checks that 1 case is created and that it is equivalent to FinishWithGrass rule - * May need to change checks due to issue #777 + *

checks that 1 case is created and that it is equivalent to FinishWithGrass rule May need + * to change checks due to issue #777 * * @throws InvalidFileFormatException */ @@ -98,16 +96,12 @@ public void TentOrTreeTestZeroTentClue() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles - * and a clue of 1 tent in the row. The column rules make the board impossible, but - * they are not checked here. + * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles and a clue of 1 + * tent in the row. The column rules make the board impossible, but they are not checked here. * - *

checks 3 cases are created checks; - * first case is TENT tile at x=0, - * second case is TENT tile at x=1, - * and a third case is TENT tile at x=2. - * The cases can be in any order. - * Then, it checks that other cells have not been modified + *

checks 3 cases are created checks; first case is TENT tile at x=0, second case is TENT + * tile at x=1, and a third case is TENT tile at x=2. The cases can be in any order. Then, it + * checks that other cells have not been modified * * @throws InvalidFileFormatException */ @@ -145,7 +139,7 @@ public void FillInRowEmptyOneTentClue() throws InvalidFileFormatException { for (int w = 0; w < board.getWidth(); w++) { for (int h = 0; h < board.getHeight(); h++) { if (h == 1) { - continue; + continue; } original_cell = board.getCell(w, h); @@ -155,7 +149,6 @@ public void FillInRowEmptyOneTentClue() throws InvalidFileFormatException { case_cell = testCase.getCell(w, h); Assert.assertEquals(original_cell.getType(), case_cell.getType()); - } } } @@ -199,13 +192,11 @@ public void FillInRowEmptyOneTentClue() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles - * and a clue of 2 tent in the row. The column rules make the board impossible, but - * they are not checked here. + * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles and a clue of 2 + * tent in the row. The column rules make the board impossible, but they are not checked here. * - *

checks 1 case is created. Checks that the case is when - * there are TENT tiles at x=0 and x=2. - * Then, it checks that other cells have not been modified + *

checks 1 case is created. Checks that the case is when there are TENT tiles at x=0 and + * x=2. Then, it checks that other cells have not been modified * * @throws InvalidFileFormatException */ @@ -287,8 +278,8 @@ public void FillInRowEmptyTwoTentClue() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles - * and a clue of 3 tent in the row. + * empty 3x3 TreeTent puzzle Tests FillinRowCaseRule on row with 3 UNKNOWN tiles and a clue of 3 + * tent in the row. * *

checks that 0 cases are created * @@ -319,8 +310,8 @@ public void FillInRowEmptyThreeTentClue() throws InvalidFileFormatException { } /** - * empty 5x5 TreeTent puzzle Tests FillinRowCaseRule on row with 5 UNKNOWN tiles - * and a clue of 2 tents in the row. + * empty 5x5 TreeTent puzzle Tests FillinRowCaseRule on row with 5 UNKNOWN tiles and a clue of 2 + * tents in the row. * *

checks that 6 cases are created and each case has the right number of tents * diff --git a/src/test/java/puzzles/treetent/rules/FinishWithGrassDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/FinishWithGrassDirectRuleTest.java index f37761e26..c89c96dd1 100644 --- a/src/test/java/puzzles/treetent/rules/FinishWithGrassDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/FinishWithGrassDirectRuleTest.java @@ -28,18 +28,16 @@ public static void setUp() { treetent = new TreeTent(); } - /** - * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Tent at (1, 1) - * XXX x - * GTG 1 - * XXX x - * xxx - *

Makes (0, 1) and (2, 1) GRASS - * Checks if the rule detects the middle row to be filled in correctly - */ - @Test - public void FinishWithGrassHorizontalTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule + * + *

Tent at (1, 1) XXX x GTG 1 XXX x xxx + * + *

Makes (0, 1) and (2, 1) GRASS Checks if the rule detects the middle row to be filled in + * correctly + */ + @Test + public void FinishWithGrassHorizontalTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithGrassDirectRule/CornerTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -78,18 +76,16 @@ public void FinishWithGrassHorizontalTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Tent at (0, 0) - * TXX x - * GXX x - * GXX x - * 1xx - *

Makes (0, 1) and (0, 2) GRASS - * Checks if the rule detects the leftmost column to be filled in correctly - */ - @Test - public void FinishWithGrassVerticalTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule + * + *

Tent at (0, 0) TXX x GXX x GXX x 1xx + * + *

Makes (0, 1) and (0, 2) GRASS Checks if the rule detects the leftmost column to be filled + * in correctly + */ + @Test + public void FinishWithGrassVerticalTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithGrassDirectRule/CornerTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -130,13 +126,11 @@ public void FinishWithGrassVerticalTest() throws InvalidFileFormatException { /** * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Tent at (0, 0) - * TGG 1 - * GXX x - * GXX x - * 1xx - *

Makes (0, 1), (0, 2), (1, 0), and (2, 0) GRASS - * Checks if the rule detects the top row and leftmost column to be filled in correctly + * + *

Tent at (0, 0) TGG 1 GXX x GXX x 1xx + * + *

Makes (0, 1), (0, 2), (1, 0), and (2, 0) GRASS Checks if the rule detects the top row and + * leftmost column to be filled in correctly */ @Test public void FinishWithGrassTest() throws InvalidFileFormatException { @@ -186,18 +180,16 @@ public void FinishWithGrassTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Empty - * GGG 0 - * GGG 0 - * GGG 0 - * 000 - *

Fill Board with GRASS - * Checks if the rule allows all cells to be filled when the clue for all rows and columns is zero. - */ - @Test - public void NoTentTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule + * + *

Empty GGG 0 GGG 0 GGG 0 000 + * + *

Fill Board with GRASS Checks if the rule allows all cells to be filled when the clue for + * all rows and columns is zero. + */ + @Test + public void NoTentTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithGrassDirectRule/NoTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -231,18 +223,16 @@ public void NoTentTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Tent at (1, 1) - * XGX x - * GTG 1 - * XGX x - * x1x - *

Makes (1, 0), (0, 1), (2, 1), and (1, 2) GRASS - * Checks if the rule correctly allows the central row and column to be filled with grass. - */ - @Test - public void MiddleTentTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule + * + *

Tent at (1, 1) XGX x GTG 1 XGX x x1x + * + *

Makes (1, 0), (0, 1), (2, 1), and (1, 2) GRASS Checks if the rule correctly allows the + * central row and column to be filled with grass. + */ + @Test + public void MiddleTentTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithGrassDirectRule/MiddleTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -290,18 +280,16 @@ public void MiddleTentTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Empty - * GGG 1 - * GGG 1 - * GGG 1 - * 111 - *

Fill Board with GRASS - * Checks if the rule is not valid when a row or column does not have the required number of tents but is filled with grass - */ - @Test - public void FailTentTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithGrassDirectRule + * + *

Empty GGG 1 GGG 1 GGG 1 111 + * + *

Fill Board with GRASS Checks if the rule is not valid when a row or column does not have + * the required number of tents but is filled with grass + */ + @Test + public void FailTentTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithGrassDirectRule/FailTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -335,22 +323,17 @@ public void FailTentTest() throws InvalidFileFormatException { } } - /** - * 7x7 TreeTent puzzle Tests FinishWithGrassDirectRule - *

Tents at (1, 3), (3, 3), and (5, 3) - * XXXXXXX x - * XXXXXXX x - * XXXXXXX x - * TGTGTGT 4 - * XXXXXXX x - * XXXXXXX x - * XXXXXXX x - * xxxxxxx - *

Makes (0, 3), (2, 3), (4, 3), and (6, 3) GRASS - * Checks if applying the rule on row 3 is valid - */ - @Test - public void SpacedOutTentTest() throws InvalidFileFormatException { + /** + * 7x7 TreeTent puzzle Tests FinishWithGrassDirectRule + * + *

Tents at (1, 3), (3, 3), and (5, 3) XXXXXXX x XXXXXXX x XXXXXXX x TGTGTGT 4 XXXXXXX x + * XXXXXXX x XXXXXXX x xxxxxxx + * + *

Makes (0, 3), (2, 3), (4, 3), and (6, 3) GRASS Checks if applying the rule on row 3 is + * valid + */ + @Test + public void SpacedOutTentTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithGrassDirectRule/SpacedOutTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); diff --git a/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java index d82be3f87..b72b0f556 100644 --- a/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/FinishWithTentsDirectRuleTest.java @@ -27,18 +27,15 @@ public static void setUp() { treetent = new TreeTent(); } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Grass at (0, 0) - * GTT 2 - * XXX x - * XXX x - * xxx - *

Makes (1, 0) and (2, 0) TENT - * Checks that the rule correctly fills in the first row - */ - @Test - public void FinishWithHorizontalTentsTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Grass at (0, 0) GTT 2 XXX x XXX x xxx + * + *

Makes (1, 0) and (2, 0) TENT Checks that the rule correctly fills in the first row + */ + @Test + public void FinishWithHorizontalTentsTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithHorizontalTents", treetent); @@ -71,18 +68,15 @@ public void FinishWithHorizontalTentsTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Grass at (0, 0) - * GXX x - * TXX x - * TXX x - * 2xx - *

Makes (0, 1) and (0, 2) TENT - * Checks that the rule correctly fills in the first column - */ - @Test - public void FinishWithVerticalTentsTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Grass at (0, 0) GXX x TXX x TXX x 2xx + * + *

Makes (0, 1) and (0, 2) TENT Checks that the rule correctly fills in the first column + */ + @Test + public void FinishWithVerticalTentsTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithVerticalTents", treetent); @@ -115,18 +109,16 @@ public void FinishWithVerticalTentsTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Grass at (0, 0) - * GTT 2 - * TXX x - * TXX x - * 2xx - *

Makes (1, 0), (2, 0), (0, 1) and (0, 2) TENT - * Checks that the rule correctly fills both the first row and first column - */ - @Test - public void FinishWithTentsTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Grass at (0, 0) GTT 2 TXX x TXX x 2xx + * + *

Makes (1, 0), (2, 0), (0, 1) and (0, 2) TENT Checks that the rule correctly fills both the + * first row and first column + */ + @Test + public void FinishWithTentsTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -167,18 +159,16 @@ public void FinishWithTentsTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Tent at (1, 1) - * XTX x - * TTT 3 - * XTX x - * x3x - *

Makes (1, 0), (0, 1), (2, 1), and (1, 2) TENT - * Checks that the rule correctly fills in the middle row and column when a tent starts at (1, 1) - */ - @Test - public void AdditionalTentsTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Tent at (1, 1) XTX x TTT 3 XTX x x3x + * + *

Makes (1, 0), (0, 1), (2, 1), and (1, 2) TENT Checks that the rule correctly fills in the + * middle row and column when a tent starts at (1, 1) + */ + @Test + public void AdditionalTentsTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/AdditionalTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -219,18 +209,16 @@ public void AdditionalTentsTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Empty - * TTT 0 - * TTT 0 - * TTT 0 - * 000 - *

Fills the board with tents - * Checks that the rule does not allow for more tents in any of the rows or columns - */ - @Test - public void FinishWithTentsFailTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Empty TTT 0 TTT 0 TTT 0 000 + * + *

Fills the board with tents Checks that the rule does not allow for more tents in any of + * the rows or columns + */ + @Test + public void FinishWithTentsFailTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/FinishWithTentsFail", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -259,18 +247,16 @@ public void FinishWithTentsFailTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Tent at (1, 1) - * XTX x - * TTT 1 - * XTX x - * x1x - *

Makes (1, 0), (0, 1), (2, 1) and (1, 2) Tent - * Checks that the rule does not allow for more tents in the central row or central column - */ - @Test - public void TooManyTentsTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Tent at (1, 1) XTX x TTT 1 XTX x x1x + * + *

Makes (1, 0), (0, 1), (2, 1) and (1, 2) Tent Checks that the rule does not allow for more + * tents in the central row or central column + */ + @Test + public void TooManyTentsTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/TooManyTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -302,18 +288,16 @@ public void TooManyTentsTest() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule - *

Tent at (1, 1) - * XTX x - * TTT 2 - * XTX x - * x2x - *

Makes (1, 0), (0, 1), (2, 1) and (1, 2) Tent - * Checks that the rule is not satisfied because there are multiple configurations of tents for the central row and central column - */ - @Test - public void AmbiguousTentsTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests FinishWithTentsDirectRule + * + *

Tent at (1, 1) XTX x TTT 2 XTX x x2x + * + *

Makes (1, 0), (0, 1), (2, 1) and (1, 2) Tent Checks that the rule is not satisfied because + * there are multiple configurations of tents for the central row and central column + */ + @Test + public void AmbiguousTentsTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/FinishWithTentsDirectRule/AmbiguousTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); diff --git a/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java index ad4559922..fdd55029f 100644 --- a/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/LastCampingSpotDirectRuleTest.java @@ -26,17 +26,15 @@ public static void setUp() { treetent = new TreeTent(); } - /** - * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule - *

TREE at (1, 1) and (0, 1); GRASS at (1, 2) and (2, 1) - * XTX - * RRG - * XGX - *

Makes (1, 0) TENT - * Checks that a tent must be placed above the central tree - */ - @Test - public void EmptyFieldTest_Up() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule + * + *

TREE at (1, 1) and (0, 1); GRASS at (1, 2) and (2, 1) XTX RRG XGX + * + *

Makes (1, 0) TENT Checks that a tent must be placed above the central tree + */ + @Test + public void EmptyFieldTest_Up() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotUp", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -64,17 +62,15 @@ public void EmptyFieldTest_Up() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule - *

TREE at (1, 1) and (0, 1); GRASS at (1, 0) and (1, 2) - * XGX - * RRG - * XTX - *

Makes (1, 2) TENT - * Checks that a tent must be placed below the central tree - */ - @Test - public void EmptyFieldTest_Down() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule + * + *

TREE at (1, 1) and (0, 1); GRASS at (1, 0) and (1, 2) XGX RRG XTX + * + *

Makes (1, 2) TENT Checks that a tent must be placed below the central tree + */ + @Test + public void EmptyFieldTest_Down() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotDown", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -102,17 +98,15 @@ public void EmptyFieldTest_Down() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule - *

TREE at (1, 1) and (2, 1); GRASS at (1, 0) and (1, 2) - * XGX - * TRR - * XGX - *

Makes (0, 1) TENT - * Checks that a tent must be placed on the left of the central tree - */ - @Test - public void EmptyFieldTest_Left() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule + * + *

TREE at (1, 1) and (2, 1); GRASS at (1, 0) and (1, 2) XGX TRR XGX + * + *

Makes (0, 1) TENT Checks that a tent must be placed on the left of the central tree + */ + @Test + public void EmptyFieldTest_Left() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotLeft", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); @@ -140,17 +134,15 @@ public void EmptyFieldTest_Left() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule - *

TREE at (1, 1) and (1, 2); GRASS at (0, 1) and (1, 0) - * XGX - * GRT - * XRX - *

Makes (2, 1) TENT - * Checks that a tent must be placed to the right of the central tree - */ - @Test - public void EmptyFieldTest_Right() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests LastCampingSpotDirectRule + * + *

TREE at (1, 1) and (1, 2); GRASS at (0, 1) and (1, 0) XGX GRT XRX + * + *

Makes (2, 1) TENT Checks that a tent must be placed to the right of the central tree + */ + @Test + public void EmptyFieldTest_Right() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/LastCampingSpotDirectRule/LastCampingSpotRight", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); diff --git a/src/test/java/puzzles/treetent/rules/LinkTentCaseRuleTest.java b/src/test/java/puzzles/treetent/rules/LinkTentCaseRuleTest.java index 3ed1fd79e..ed482eba0 100644 --- a/src/test/java/puzzles/treetent/rules/LinkTentCaseRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/LinkTentCaseRuleTest.java @@ -1,22 +1,18 @@ package puzzles.treetent.rules; import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.tree.Tree; import edu.rpi.legup.model.tree.TreeNode; import edu.rpi.legup.model.tree.TreeTransition; import edu.rpi.legup.puzzle.treetent.*; import edu.rpi.legup.puzzle.treetent.rules.LinkTentCaseRule; import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; import legup.MockGameBoardFacade; import legup.TestUtilities; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.LinkedList; - public class LinkTentCaseRuleTest { private static final LinkTentCaseRule RULE = new LinkTentCaseRule(); private static TreeTent treetent; @@ -28,8 +24,8 @@ public static void setUp() { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent - * with one tree surrounding it. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent with one tree surrounding + * it. * *

checks that 1 cases is with the line connecting the central tent and the tree * @@ -76,11 +72,11 @@ public void LinkTentOneTreeTest() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent - * with four trees surrounding it. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent with four trees + * surrounding it. * - *

checks that 4 cases are created, each of which create a line - * connecting the tent to one of the four trees without repeat. + *

checks that 4 cases are created, each of which create a line connecting the tent to one of + * the four trees without repeat. * * @throws InvalidFileFormatException */ @@ -106,7 +102,7 @@ public void LinkTentFourTreesTest() throws InvalidFileFormatException { expectedLines.addFirst(new TreeTentLine(board.getCell(1, 1), board.getCell(1, 2))); for (Board testCaseBoard : cases) { - TreeTentBoard testCase = (TreeTentBoard) testCaseBoard ; + TreeTentBoard testCase = (TreeTentBoard) testCaseBoard; ArrayList lines = testCase.getLines(); // Each case should connect one line from the tent to @@ -142,17 +138,15 @@ public void LinkTentFourTreesTest() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent - * with zero trees around it. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent with zero trees around it. * - *

Ensures no cases are created + *

Ensures no cases are created * * @throws InvalidFileFormatException */ @Test public void LinkTentNoTreesTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard( - "puzzles/treetent/rules/LinkTentCaseRule/NoTrees", treetent); + TestUtilities.importTestBoard("puzzles/treetent/rules/LinkTentCaseRule/NoTrees", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -166,10 +160,9 @@ public void LinkTentNoTreesTest() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent - * with trees on a diagonal. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tent with trees on a diagonal. * - *

Ensures no cases are created + *

Ensures no cases are created * * @throws InvalidFileFormatException */ diff --git a/src/test/java/puzzles/treetent/rules/LinkTreeCaseRuleTest.java b/src/test/java/puzzles/treetent/rules/LinkTreeCaseRuleTest.java index fffde14b1..be237e8d4 100644 --- a/src/test/java/puzzles/treetent/rules/LinkTreeCaseRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/LinkTreeCaseRuleTest.java @@ -1,6 +1,5 @@ package puzzles.treetent.rules; -import com.sun.source.doctree.LinkTree; import edu.rpi.legup.model.gameboard.Board; import edu.rpi.legup.model.tree.TreeNode; import edu.rpi.legup.model.tree.TreeTransition; @@ -10,16 +9,15 @@ import edu.rpi.legup.puzzle.treetent.TreeTentLine; import edu.rpi.legup.puzzle.treetent.rules.LinkTreeCaseRule; import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; import legup.MockGameBoardFacade; import legup.TestUtilities; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import java.util.ArrayList; - public class LinkTreeCaseRuleTest { - private static final LinkTreeCaseRule RULE = new LinkTreeCaseRule(); + private static final LinkTreeCaseRule RULE = new LinkTreeCaseRule(); private static TreeTent treetent; @BeforeClass @@ -29,17 +27,15 @@ public static void setUp() { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree - * with one tent above + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree with one tent above * - *

Ensures one case is created that connects the tree to the tent. + *

Ensures one case is created that connects the tree to the tent. * * @throws InvalidFileFormatException */ @Test public void LinkTentOneTentTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard( - "puzzles/treetent/rules/LinkTreeCaseRule/OneTent", treetent); + TestUtilities.importTestBoard("puzzles/treetent/rules/LinkTreeCaseRule/OneTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -77,20 +73,18 @@ public void LinkTentOneTentTest() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree - * with two tents, one on the left and one on the right. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree with two tents, one on the + * left and one on the right. * - *

Ensures two cases are created, one connecting the tree and the - * left tent, and one connecting the tree and the right tent. - * Because tents must be surrounded by grass, there can be at most - * two tents around a given tree. + *

Ensures two cases are created, one connecting the tree and the left tent, and one + * connecting the tree and the right tent. Because tents must be surrounded by grass, there can + * be at most two tents around a given tree. * * @throws InvalidFileFormatException */ @Test public void LinkTentTwoTentsTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard( - "puzzles/treetent/rules/LinkTreeCaseRule/TwoTents", treetent); + TestUtilities.importTestBoard("puzzles/treetent/rules/LinkTreeCaseRule/TwoTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -107,7 +101,7 @@ public void LinkTentTwoTentsTest() throws InvalidFileFormatException { expectedLines.addFirst(new TreeTentLine(board.getCell(1, 1), board.getCell(2, 1))); for (Board testCaseBoard : cases) { - TreeTentBoard testCase = (TreeTentBoard) testCaseBoard ; + TreeTentBoard testCase = (TreeTentBoard) testCaseBoard; ArrayList lines = testCase.getLines(); // Each case should connect one line from the tent to @@ -143,17 +137,15 @@ public void LinkTentTwoTentsTest() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree - * with zero tents around it. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree with zero tents around it. * - *

Ensures no cases are created + *

Ensures no cases are created * * @throws InvalidFileFormatException */ @Test public void LinkTentNoTreesTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard( - "puzzles/treetent/rules/LinkTreeCaseRule/NoTents", treetent); + TestUtilities.importTestBoard("puzzles/treetent/rules/LinkTreeCaseRule/NoTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); @@ -167,17 +159,15 @@ public void LinkTentNoTreesTest() throws InvalidFileFormatException { } /** - * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree - * with tents on a diagonal. + * empty 3x3 TreeTent puzzle Tests LinkTentCaseRule on a central tree with tents on a diagonal. * - *

Ensures no cases are created + *

Ensures no cases are created * * @throws InvalidFileFormatException */ @Test public void LinkTentDiagTentsTest() throws InvalidFileFormatException { - TestUtilities.importTestBoard( - "puzzles/treetent/rules/LinkTreeCaseRule/NoTents", treetent); + TestUtilities.importTestBoard("puzzles/treetent/rules/LinkTreeCaseRule/NoTents", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); transition.setRule(RULE); diff --git a/src/test/java/puzzles/treetent/rules/SurroundTentWithGrassDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/SurroundTentWithGrassDirectRuleTest.java index 6177bb64c..dc61cb863 100644 --- a/src/test/java/puzzles/treetent/rules/SurroundTentWithGrassDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/SurroundTentWithGrassDirectRuleTest.java @@ -27,17 +27,16 @@ public static void setUp() { treetent = new TreeTent(); } - /** - * 3x3 TreeTent puzzle Tests SurroundTentWithGrassDirectRule - *

TREE at (0, 0), (2, 0), (0, 1), (2, 1), (1, 2), and (2, 2); TENT at (1, 1) - * RGR - * RTR - * GRR - *

Makes (1, 0) and (0, 2) GRASS - * Checks that the rule detects unknown adjacent and diagonal tiles correctly - */ - @Test - public void SurroundTentWithGrassBasicRuleTest() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests SurroundTentWithGrassDirectRule + * + *

TREE at (0, 0), (2, 0), (0, 1), (2, 1), (1, 2), and (2, 2); TENT at (1, 1) RGR RTR GRR + * + *

Makes (1, 0) and (0, 2) GRASS Checks that the rule detects unknown adjacent and diagonal + * tiles correctly + */ + @Test + public void SurroundTentWithGrassBasicRuleTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/SurroundTentWithGrassDirectRule/SurroundTentWithGrass", treetent); @@ -69,17 +68,16 @@ public void SurroundTentWithGrassBasicRuleTest() throws InvalidFileFormatExcepti } } - /** - * 3x3 TreeTent puzzle Tests SurroundTentWithGrassDirectRule - *

TENT at (1, 1) - * GGG - * GTG - * GGG - *

Makes all cells adjacent and diagonal to the tent GRASS - * Checks that the rule detects all adjacent and diagonal tiles correctly - */ - @Test - public void SurroundTentWithGrassBasicRuleTest_BadBoard() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests SurroundTentWithGrassDirectRule + * + *

TENT at (1, 1) GGG GTG GGG + * + *

Makes all cells adjacent and diagonal to the tent GRASS Checks that the rule detects all + * adjacent and diagonal tiles correctly + */ + @Test + public void SurroundTentWithGrassBasicRuleTest_BadBoard() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/SurroundTentWithGrassDirectRule/SurroundTentWithGrassBad", treetent); @@ -137,17 +135,15 @@ public void SurroundTentWithGrassBasicRuleTest_BadBoard() throws InvalidFileForm } } - /** - * 3x3 TreeTent puzzle Tests SurroundTentWithGrassDirectRule - *

TENT at (1, 1); TREE on all adjacent and diagonal tiles - * RRR - * RTR - * RRR - *

Null - * Checks that the rule correctly detects no missing tiles - */ - @Test - public void SurroundTentWithGrassBasicRuleTest_FullBoard() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests SurroundTentWithGrassDirectRule + * + *

TENT at (1, 1); TREE on all adjacent and diagonal tiles RRR RTR RRR + * + *

Null Checks that the rule correctly detects no missing tiles + */ + @Test + public void SurroundTentWithGrassBasicRuleTest_FullBoard() throws InvalidFileFormatException { TestUtilities.importTestBoard( "puzzles/treetent/rules/SurroundTentWithGrassDirectRule/SurroundTentWithGrassTrees", treetent); diff --git a/src/test/java/puzzles/treetent/rules/TentForTreeDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/TentForTreeDirectRuleTest.java index e55704ec2..6bd2db071 100644 --- a/src/test/java/puzzles/treetent/rules/TentForTreeDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/TentForTreeDirectRuleTest.java @@ -5,14 +5,13 @@ import edu.rpi.legup.puzzle.treetent.*; import edu.rpi.legup.puzzle.treetent.rules.TentForTreeDirectRule; import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; import legup.MockGameBoardFacade; import legup.TestUtilities; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import java.util.ArrayList; - public class TentForTreeDirectRuleTest { private static final TentForTreeDirectRule RULE = new TentForTreeDirectRule(); @@ -24,62 +23,58 @@ public static void setUp() { treetent = new TreeTent(); } - /** - * 3x3 TreeTent puzzle Tests TentForTreeDirectRule - *

TREE at (1, 0); TENT at (1, 1) - * XRX - * XTX - * XXX - *

Makes a line between (1, 0) and (1, 1) - * Checks that the rule correctly detects the central tent as the only possible connection - */ - @Test - public void TentForTreeTestOneTreeOneTentTest() throws InvalidFileFormatException { - - TestUtilities.importTestBoard( - "puzzles/treetent/rules/TentForTreeDirectRule/OneTreeOneTent", - treetent); - - TreeNode rootNode = treetent.getTree().getRootNode(); - TreeTransition transition = rootNode.getChildren().get(0); - transition.setRule(RULE); - - TreeTentBoard board = (TreeTentBoard) transition.getBoard(); - - TreeTentCell cell1 = board.getCell(1, 0); - TreeTentCell cell2 = board.getCell(1, 1); - TreeTentLine line = new TreeTentLine(cell1, cell2); - - board.addModifiedData(line); - board.getLines().add(line); - - Assert.assertNull(RULE.checkRule(transition)); - - ArrayList lines = board.getLines(); - for (TreeTentLine l : lines) { - if (l.compare((line))) { - Assert.assertNull(RULE.checkRuleAt(transition, l)); - } else { - Assert.assertNotNull(RULE.checkRuleAt(transition, l)); + /** + * 3x3 TreeTent puzzle Tests TentForTreeDirectRule + * + *

TREE at (1, 0); TENT at (1, 1) XRX XTX XXX + * + *

Makes a line between (1, 0) and (1, 1) Checks that the rule correctly detects the central + * tent as the only possible connection + */ + @Test + public void TentForTreeTestOneTreeOneTentTest() throws InvalidFileFormatException { + + TestUtilities.importTestBoard( + "puzzles/treetent/rules/TentForTreeDirectRule/OneTreeOneTent", treetent); + + TreeNode rootNode = treetent.getTree().getRootNode(); + TreeTransition transition = rootNode.getChildren().get(0); + transition.setRule(RULE); + + TreeTentBoard board = (TreeTentBoard) transition.getBoard(); + + TreeTentCell cell1 = board.getCell(1, 0); + TreeTentCell cell2 = board.getCell(1, 1); + TreeTentLine line = new TreeTentLine(cell1, cell2); + + board.addModifiedData(line); + board.getLines().add(line); + + Assert.assertNull(RULE.checkRule(transition)); + + ArrayList lines = board.getLines(); + for (TreeTentLine l : lines) { + if (l.compare((line))) { + Assert.assertNull(RULE.checkRuleAt(transition, l)); + } else { + Assert.assertNotNull(RULE.checkRuleAt(transition, l)); + } } } - } - - /** - * 3x3 TreeTent puzzle Tests TentForTreeDirectRule - *

TREE at (1, 0) and (1, 2); TENT at (1, 1) - * XRX - * XTX - * XRX - *

Makes a line between (1, 0) and (1, 1) - * Checks that the rule works when connecting a line between the tree at (1, 0) and tent at (1, 1) - */ - @Test - public void TentForTreeArbitraryTreeTest() throws InvalidFileFormatException { + + /** + * 3x3 TreeTent puzzle Tests TentForTreeDirectRule + * + *

TREE at (1, 0) and (1, 2); TENT at (1, 1) XRX XTX XRX + * + *

Makes a line between (1, 0) and (1, 1) Checks that the rule works when connecting a line + * between the tree at (1, 0) and tent at (1, 1) + */ + @Test + public void TentForTreeArbitraryTreeTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TentForTreeDirectRule/ArbitraryTree", - treetent); + "puzzles/treetent/rules/TentForTreeDirectRule/ArbitraryTree", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); @@ -97,21 +92,19 @@ public void TentForTreeArbitraryTreeTest() throws InvalidFileFormatException { Assert.assertNull(RULE.checkRule(transition)); } - /** - * 3x3 TreeTent puzzle Tests TentForTreeDirectRule - *

TREE at (1, 0) and (1, 2); TENT at (1, 1); LINE between (1, 0) and (1, 1) - * XRX - * XTX - * XRX - *

Makes a line between (1, 1) and (1, 2) - * Checks that the rule fails for the tree at (1, 2) because there are no valid tents to connect to - */ - @Test - public void TentForTreeConnectedTent() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests TentForTreeDirectRule + * + *

TREE at (1, 0) and (1, 2); TENT at (1, 1); LINE between (1, 0) and (1, 1) XRX XTX XRX + * + *

Makes a line between (1, 1) and (1, 2) Checks that the rule fails for the tree at (1, 2) + * because there are no valid tents to connect to + */ + @Test + public void TentForTreeConnectedTent() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TentForTreeDirectRule/ArbitraryTree", - treetent); + "puzzles/treetent/rules/TentForTreeDirectRule/ArbitraryTree", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); @@ -134,20 +127,18 @@ public void TentForTreeConnectedTent() throws InvalidFileFormatException { } } - /** - * 3x3 TreeTent puzzle Tests TentForTreeDirectRule - *

TREE at (1, 1); TENT at (1, 0) and (1, 2) - * XTX - * XRX - * XTX - *

Makes a line between (1, 1) and (1, 2) - * Checks that the rule fails for the tree at (1, 1) because there are two valid tents to connect to - */ - @Test - public void TentForTreeOneTreeTwoAdjacentTent() throws InvalidFileFormatException { + /** + * 3x3 TreeTent puzzle Tests TentForTreeDirectRule + * + *

TREE at (1, 1); TENT at (1, 0) and (1, 2) XTX XRX XTX + * + *

Makes a line between (1, 1) and (1, 2) Checks that the rule fails for the tree at (1, 1) + * because there are two valid tents to connect to + */ + @Test + public void TentForTreeOneTreeTwoAdjacentTent() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TentForTreeDirectRule/OneTreeTwoAdjacentTent", - treetent); + "puzzles/treetent/rules/TentForTreeDirectRule/OneTreeTwoAdjacentTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); diff --git a/src/test/java/puzzles/treetent/rules/TreeForTentDirectRuleTest.java b/src/test/java/puzzles/treetent/rules/TreeForTentDirectRuleTest.java index ba1b49b8c..3cccdc417 100644 --- a/src/test/java/puzzles/treetent/rules/TreeForTentDirectRuleTest.java +++ b/src/test/java/puzzles/treetent/rules/TreeForTentDirectRuleTest.java @@ -8,14 +8,13 @@ import edu.rpi.legup.puzzle.treetent.TreeTentLine; import edu.rpi.legup.puzzle.treetent.rules.TreeForTentDirectRule; import edu.rpi.legup.save.InvalidFileFormatException; +import java.util.ArrayList; import legup.MockGameBoardFacade; import legup.TestUtilities; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import java.util.ArrayList; - public class TreeForTentDirectRuleTest { private static final TreeForTentDirectRule RULE = new TreeForTentDirectRule(); @@ -29,19 +28,17 @@ public static void setUp() { /** * 3x3 TreeTent puzzle Tests TreeForTentDirectRule - *

TENT at (1, 0); TREE at (1, 1) - * XTX - * XRX - * XXX - *

Makes a line between (1, 0) and (1, 1) - * Checks that the rule correctly detects the central tree as the only possible connection + * + *

TENT at (1, 0); TREE at (1, 1) XTX XRX XXX + * + *

Makes a line between (1, 0) and (1, 1) Checks that the rule correctly detects the central + * tree as the only possible connection */ - @Test - public void TreeForTentTestOneTreeOneTentTest() throws InvalidFileFormatException { + @Test + public void TreeForTentTestOneTreeOneTentTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TreeForTentDirectRule/OneTentOneTree", - treetent); + "puzzles/treetent/rules/TreeForTentDirectRule/OneTentOneTree", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); @@ -61,19 +58,17 @@ public void TreeForTentTestOneTreeOneTentTest() throws InvalidFileFormatExceptio /** * 3x3 TreeTent puzzle Tests TreeForTentDirectRule - *

TENT at (1, 0) and (1, 2); TREE at (1, 1) - * XTX - * XRX - * XTX - *

Makes a line between (1, 0) and (1, 1) - * Checks that the rule works when connecting a line between the tent at (1, 0) and the tree at (1, 1) + * + *

TENT at (1, 0) and (1, 2); TREE at (1, 1) XTX XRX XTX + * + *

Makes a line between (1, 0) and (1, 1) Checks that the rule works when connecting a line + * between the tent at (1, 0) and the tree at (1, 1) */ @Test public void TentForTreeWithArbitraryTreeTest() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TreeForTentDirectRule/ArbitraryTent", - treetent); + "puzzles/treetent/rules/TreeForTentDirectRule/ArbitraryTent", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); @@ -93,19 +88,17 @@ public void TentForTreeWithArbitraryTreeTest() throws InvalidFileFormatException /** * 3x3 TreeTent puzzle Tests TreeForTentDirectRule - *

TENT at (1, 0) and (1, 2); TREE at (1, 1); LINE between (1, 0) and (1, 1) - * XTX - * XRX - * XTX - *

Makes a line between (1, 1) and (1, 2) - * Checks that the rule fails for the tent at (1, 2) because there are no valid trees to connect to + * + *

TENT at (1, 0) and (1, 2); TREE at (1, 1); LINE between (1, 0) and (1, 1) XTX XRX XTX + * + *

Makes a line between (1, 1) and (1, 2) Checks that the rule fails for the tent at (1, 2) + * because there are no valid trees to connect to */ @Test public void TentForTreeConnectedTent() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TreeForTentDirectRule/ConnectedTree", - treetent); + "puzzles/treetent/rules/TreeForTentDirectRule/ConnectedTree", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); @@ -130,18 +123,16 @@ public void TentForTreeConnectedTent() throws InvalidFileFormatException { /** * 3x3 TreeTent puzzle Tests TreeForTentDirectRule - *

TENT at (1, 1); TREE at (1, 0) and (1, 2) - * XRX - * XTX - * XRX - *

Makes a line between (1, 1) and (1, 2) - * Checks that the rule fails for the tree at (1, 1) because there are two valid trees to connect to + * + *

TENT at (1, 1); TREE at (1, 0) and (1, 2) XRX XTX XRX + * + *

Makes a line between (1, 1) and (1, 2) Checks that the rule fails for the tree at (1, 1) + * because there are two valid trees to connect to */ @Test public void TentForTreeOneTreeTwoAdjacentTent() throws InvalidFileFormatException { TestUtilities.importTestBoard( - "puzzles/treetent/rules/TreeForTentDirectRule/OneTentTwoAdjacentTrees", - treetent); + "puzzles/treetent/rules/TreeForTentDirectRule/OneTentTwoAdjacentTrees", treetent); TreeNode rootNode = treetent.getTree().getRootNode(); TreeTransition transition = rootNode.getChildren().get(0); From 3b64e778970fd5122885ea88d1fce8a77fcdd9c9 Mon Sep 17 00:00:00 2001 From: Bram van Heuveln Date: Tue, 18 Jun 2024 17:50:00 +0000 Subject: [PATCH 36/36] Automated Java code formatting changes --- src/test/java/legup/TestRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/legup/TestRunner.java b/src/test/java/legup/TestRunner.java index 2142f695d..5486a0353 100644 --- a/src/test/java/legup/TestRunner.java +++ b/src/test/java/legup/TestRunner.java @@ -94,7 +94,7 @@ public static void main(String[] args) { printTestResults(result36); Result result37 = JUnitCore.runClasses(TentOrGrassCaseRuleTest.class); printTestResults(result37); - + // Minesweeper Result result38 = JUnitCore.runClasses(MinesweeperUtilitiesTest.class); printTestResults(result38);