From 723bb3aade3a1d4102dcaa52f291a4adf955fd76 Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Fri, 27 Jan 2023 14:53:09 -0500
Subject: [PATCH 001/148] Cancel Open Proof == Null
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 3 +++
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 2 ++
2 files changed, 5 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 3eba9a3de..4b8a37d2a 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -47,6 +47,9 @@ public class HomePanel extends LegupPanel {
@Override
public void actionPerformed(ActionEvent e) {
Object[] items = legupUI.getProofEditor().promptPuzzle();
+ if (items == null) {
+ return;
+ }
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
legupUI.displayPanel(1);
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index e661a4336..df6407094 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -376,6 +376,8 @@ public Object[] promptPuzzle() {
if (fileDialog.getDirectory() != null && fileDialog.getFile() != null) {
fileName = fileDialog.getDirectory() + File.separator + fileDialog.getFile();
puzzleFile = new File(fileName);
+ } else {
+ return null;
}
return new Object[]{fileName, puzzleFile};
From 101fa85299ac96dd73e941685d6de61a0197bef9 Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Fri, 27 Jan 2023 15:28:10 -0500
Subject: [PATCH 002/148] Comments
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 2 ++
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 1 +
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 1 +
3 files changed, 4 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 4b8a37d2a..23fd2b11b 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -48,6 +48,7 @@ public class HomePanel extends LegupPanel {
public void actionPerformed(ActionEvent e) {
Object[] items = legupUI.getProofEditor().promptPuzzle();
if (items == null) {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
return;
}
String fileName = (String) items[0];
@@ -62,6 +63,7 @@ public void actionPerformed(ActionEvent e) {
public void actionPerformed(ActionEvent e) {
Object[] items = legupUI.getPuzzleEditor().promptPuzzle();
if (items == null) {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
return;
}
String fileName = (String) items[0];
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index df6407094..0b3fa1e65 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -377,6 +377,7 @@ public Object[] promptPuzzle() {
fileName = fileDialog.getDirectory() + File.separator + fileDialog.getFile();
puzzleFile = new File(fileName);
} else {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
return null;
}
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 7e178be4b..f474d3074 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -313,6 +313,7 @@ public Object[] promptPuzzle() {
puzzleFile = new File(fileName);
}
else {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
return null;
}
From 50404a1a58e31d70da9b7e1b6f675017f6b78b6c Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Fri, 27 Jan 2023 15:57:18 -0500
Subject: [PATCH 003/148] Checkstyle 1
---
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 0b3fa1e65..4474e5291 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -376,7 +376,8 @@ public Object[] promptPuzzle() {
if (fileDialog.getDirectory() != null && fileDialog.getFile() != null) {
fileName = fileDialog.getDirectory() + File.separator + fileDialog.getFile();
puzzleFile = new File(fileName);
- } else {
+ }
+ else {
// The attempt to prompt a puzzle ended gracefully (cancel)
return null;
}
From 8ade19a9d275fd8b28533a02076b54aa3b87e810 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 27 Jan 2023 20:09:43 -0500
Subject: [PATCH 004/148] changed all file names that have "Basic Rules" to
"Direct Rules"
---
.idea/codeStyles/codeStyleConfig.xml | 2 +-
result.csv | 58 ++--
.../rpi/legup/app/PuzzleKeyAccelerator.java | 6 +-
.../rpi/legup/controller/RuleController.java | 2 +-
...ava => ApplyDefaultDirectRuleCommand.java} | 256 +++++++--------
...nd.java => ValidateDirectRuleCommand.java} | 304 ++++++++---------
src/main/java/edu/rpi/legup/model/Puzzle.java | 28 +-
.../rules/{BasicRule.java => DirectRule.java} | 204 ++++++------
...cRule.java => ContinueShipDirectRule.java} | 86 ++---
...le.java => FinishWithShipsDirectRule.java} | 232 ++++++-------
...le.java => FinishWithWaterDirectRule.java} | 86 ++---
...icRule.java => SegmentTypeDirectRule.java} | 86 ++---
...cRule.java => SurroundShipDirectRule.java} | 86 ++---
...le.java => FinishWithBlackDirectRule.java} | 138 ++++----
...le.java => FinishWithWhiteDirectRule.java} | 138 ++++----
.../rules/fillapix_reference_sheet.txt | 4 +-
...asicRule.java => BlackPathDirectRule.java} | 14 +-
...sicRule.java => BottleNeckDirectRule.java} | 14 +-
...Rule.java => FillRoomBlackDirectRule.java} | 86 ++---
...Rule.java => FillRoomWhiteDirectRule.java} | 86 ++---
...thBasicRule.java => OneRowDirectRule.java} | 14 +-
.../rules/PreventWhiteLineDirectRule.java | 7 +
...cRule.java => ThreeByThreeDirectRule.java} | 14 +-
.../heyawake/rules/TwoInCornerBasicRule.java | 7 -
...icRule.java => TwoInCornerDirectRule.java} | 14 +-
...e.java => WhiteAroundBlackDirectRule.java} | 86 ++---
.../heyawake/rules/WhiteEscapeBasicRule.java | 7 -
.../heyawake/rules/WhiteEscapeDirectRule.java | 7 +
.../heyawake/rules/ZigZagWhiteBasicRule.java | 7 -
.../heyawake/rules/ZigZagWhiteDirectRule.java | 7 +
.../rules/heyawake_reference_sheet.txt | 22 +-
...e.java => EmptyCellinLightDirectRule.java} | 128 ++++----
...cRule.java => EmptyCornersDirectRule.java} | 230 ++++++-------
...le.java => FinishWithBulbsDirectRule.java} | 212 ++++++------
...le.java => FinishWithEmptyDirectRule.java} | 232 ++++++-------
...asicRule.java => MustLightDirectRule.java} | 298 ++++++++---------
.../lightup/rules/lightup_reference_sheet.txt | 10 +-
...asicRule.java => BlackEdgeDirectRule.java} | 84 ++---
...cRule.java => BlockedBlackDirectRule.java} | 84 ++---
...ule.java => ConnectedCellsDirectRule.java} | 84 ++---
...sicRule.java => FinishPathDirectRule.java} | 84 ++---
...asicRule.java => NearWhiteDirectRule.java} | 84 ++---
...Rule.java => OnlyOneChoiceDirectRule.java} | 84 ++---
...asicRule.java => WhiteEdgeDirectRule.java} | 82 ++---
.../masyu/rules/masyu_reference_sheet.txt | 14 +-
...ava => BlackBetweenRegionsDirectRule.java} | 224 ++++++-------
...le.java => BlackBottleNeckDirectRule.java} | 130 ++++----
...le.java => CannotReachCellDirectRule.java} | 122 +++----
...icRule.java => CornerBlackDirectRule.java} | 217 ++++++------
...icRule.java => FillinBlackDirectRule.java} | 120 +++----
...icRule.java => FillinWhiteDirectRule.java} | 120 +++----
...java => PreventBlackSquareDirectRule.java} | 132 ++++----
...ule.java => SurroundRegionDirectRule.java} | 130 ++++----
...le.java => WhiteBottleNeckDirectRule.java} | 138 ++++----
.../rules/nurikabe_reference_sheet.txt | 18 +-
...cRuleAtomic.java => DirectRuleAtomic.java} | 30 +-
...e_Generic.java => DirectRule_Generic.java} | 138 ++++----
...ion.java => DirectRuleAndElimination.java} | 20 +-
...> DirectRuleBiconditionalElimination.java} | 20 +-
... => DirectRuleConditionalElimination.java} | 20 +-
...ion.java => DirectRuleNotElimination.java} | 20 +-
...tion.java => DirectRuleOrElimination.java} | 20 +-
...ava => DirectRule_GenericElimination.java} | 34 +-
...on.java => DirectRuleAndIntroduction.java} | 20 +-
... DirectRuleBiconditionalIntroduction.java} | 20 +-
...=> DirectRuleConditionalIntroduction.java} | 20 +-
...on.java => DirectRuleNotIntroduction.java} | 20 +-
...ion.java => DirectRuleOrIntroduction.java} | 20 +-
...va => DirectRule_GenericIntroduction.java} | 34 +-
...e.java => LastSingularCellDirectRule.java} | 230 ++++++-------
...java => LastSingularNumberDirectRule.java} | 196 +++++------
...le.java => LastVisibleCellDirectRule.java} | 234 ++++++-------
....java => LastVisibleNumberDirectRule.java} | 198 +++++------
...dgeBasicRule.java => NEdgeDirectRule.java} | 203 ++++++------
.../rules/skyscrapers_reference_sheet.txt | 10 +-
....java => AdvancedDeductionDirectRule.java} | 192 +++++------
....java => LastCellForNumberDirectRule.java} | 186 +++++------
....java => LastNumberForCellDirectRule.java} | 154 ++++-----
.../sudoku/rules/sudoku_reference_sheet.txt | 6 +-
...sicRule.java => EmptyFieldDirectRule.java} | 172 +++++-----
...le.java => FinishWithGrassDirectRule.java} | 172 +++++-----
...le.java => FinishWithTentsDirectRule.java} | 176 +++++-----
...le.java => LastCampingSpotDirectRule.java} | 205 ++++++------
...a => SurroundTentWithGrassDirectRule.java} | 164 +++++-----
...icRule.java => TentForTreeDirectRule.java} | 248 +++++++-------
...icRule.java => TreeForTentDirectRule.java} | 244 +++++++-------
.../rules/treetent_reference_sheet.txt | 14 +-
.../edu/rpi/legup/ui/PreferencesDialog.java | 2 +-
.../edu/rpi/legup/ui/ProofEditorPanel.java | 2 +-
...sicRulePanel.java => DirectRulePanel.java} | 42 +--
.../ui/proofeditorui/rulesview/RuleFrame.java | 16 +-
.../ui/proofeditorui/rulesview/RulePanel.java | 2 +-
.../rules/EmptyCellinLightBasicRuleTest.java | 2 +-
.../rules/EmptyCornersBasicRuleTest.java | 2 +-
.../rules/FinishWithBulbsBasicRuleTest.java | 2 +-
.../rules/FinishWithEmptyBasicRuleTest.java | 2 +-
.../lightup/rules/MustLightBasicRuleTest.java | 2 +-
...=> BlackBetweenRegionsDirectRuleTest.java} | 308 +++++++++---------
...st.java => CornerBlackDirectRuleTest.java} | 97 +++---
.../rules/FillinBlackBasicRuleTest.java | 2 +-
...st.java => FillinWhiteDirectRuleTest.java} | 101 +++---
... => PreventBlackSquareDirectRuleTest.java} | 274 ++++++++--------
...java => SurroundRegionDirectRuleTest.java} | 192 +++++------
...ava => WhiteBottleNeckDirectRuleTest.java} | 154 ++++-----
104 files changed, 4895 insertions(+), 4916 deletions(-)
rename src/main/java/edu/rpi/legup/history/{ApplyDefaultBasicRuleCommand.java => ApplyDefaultDirectRuleCommand.java} (91%)
rename src/main/java/edu/rpi/legup/history/{ValidateBasicRuleCommand.java => ValidateDirectRuleCommand.java} (94%)
rename src/main/java/edu/rpi/legup/model/rules/{BasicRule.java => DirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/battleship/rules/{ContinueShipBasicRule.java => ContinueShipDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/battleship/rules/{FinishWithShipsBasicRule.java => FinishWithShipsDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/battleship/rules/{FinishWithWaterBasicRule.java => FinishWithWaterDirectRule.java} (87%)
rename src/main/java/edu/rpi/legup/puzzle/battleship/rules/{SegmentTypeBasicRule.java => SegmentTypeDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/battleship/rules/{SurroundShipBasicRule.java => SurroundShipDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/fillapix/rules/{FinishWithBlackBasicRule.java => FinishWithBlackDirectRule.java} (93%)
rename src/main/java/edu/rpi/legup/puzzle/fillapix/rules/{FinishWithWhiteBasicRule.java => FinishWithWhiteDirectRule.java} (93%)
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{BottleNeckBasicRule.java => BlackPathDirectRule.java} (62%)
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{OneRowBasicRule.java => BottleNeckDirectRule.java} (61%)
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{FillRoomBlackBasicRule.java => FillRoomBlackDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{FillRoomWhiteBasicRule.java => FillRoomWhiteDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{BlackPathBasicRule.java => OneRowDirectRule.java} (64%)
create mode 100644 src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineDirectRule.java
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{PreventWhiteLineBasicRule.java => ThreeByThreeDirectRule.java} (60%)
delete mode 100644 src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerBasicRule.java
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{ThreeByThreeBasicRule.java => TwoInCornerDirectRule.java} (61%)
rename src/main/java/edu/rpi/legup/puzzle/heyawake/rules/{WhiteAroundBlackBasicRule.java => WhiteAroundBlackDirectRule.java} (87%)
delete mode 100644 src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeBasicRule.java
create mode 100644 src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeDirectRule.java
delete mode 100644 src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteBasicRule.java
create mode 100644 src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteDirectRule.java
rename src/main/java/edu/rpi/legup/puzzle/lightup/rules/{EmptyCellinLightBasicRule.java => EmptyCellinLightDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/lightup/rules/{EmptyCornersBasicRule.java => EmptyCornersDirectRule.java} (95%)
rename src/main/java/edu/rpi/legup/puzzle/lightup/rules/{FinishWithBulbsBasicRule.java => FinishWithBulbsDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/lightup/rules/{FinishWithEmptyBasicRule.java => FinishWithEmptyDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/lightup/rules/{MustLightBasicRule.java => MustLightDirectRule.java} (95%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{BlackEdgeBasicRule.java => BlackEdgeDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{BlockedBlackBasicRule.java => BlockedBlackDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{ConnectedCellsBasicRule.java => ConnectedCellsDirectRule.java} (87%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{FinishPathBasicRule.java => FinishPathDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{NearWhiteBasicRule.java => NearWhiteDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{OnlyOneChoiceBasicRule.java => OnlyOneChoiceDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/masyu/rules/{WhiteEdgeBasicRule.java => WhiteEdgeDirectRule.java} (88%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{BlackBetweenRegionsBasicRule.java => BlackBetweenRegionsDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{BlackBottleNeckBasicRule.java => BlackBottleNeckDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{CannotReachCellBasicRule.java => CannotReachCellDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{CornerBlackBasicRule.java => CornerBlackDirectRule.java} (95%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{FillinBlackBasicRule.java => FillinBlackDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{FillinWhiteBasicRule.java => FillinWhiteDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{PreventBlackSquareBasicRule.java => PreventBlackSquareDirectRule.java} (91%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{SurroundRegionBasicRule.java => SurroundRegionDirectRule.java} (91%)
rename src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/{WhiteBottleNeckBasicRule.java => WhiteBottleNeckDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/{BasicRuleAtomic.java => DirectRuleAtomic.java} (77%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/{BasicRule_Generic.java => DirectRule_Generic.java} (89%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/{BasicRuleAndElimination.java => DirectRuleAndElimination.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/{BasicRuleBiconditionalElimination.java => DirectRuleBiconditionalElimination.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/{BasicRuleConditionalElimination.java => DirectRuleConditionalElimination.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/{BasicRuleNotElimination.java => DirectRuleNotElimination.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/{BasicRuleOrElimination.java => DirectRuleOrElimination.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/{BasicRule_GenericElimination.java => DirectRule_GenericElimination.java} (55%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/{BasicRuleAndIntroduction.java => DirectRuleAndIntroduction.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/{BasicRuleBiconditionalIntroduction.java => DirectRuleBiconditionalIntroduction.java} (63%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/{BasicRuleConditionalIntroduction.java => DirectRuleConditionalIntroduction.java} (63%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/{BasicRuleNotIntroduction.java => DirectRuleNotIntroduction.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/{BasicRuleOrIntroduction.java => DirectRuleOrIntroduction.java} (64%)
rename src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/{BasicRule_GenericIntroduction.java => DirectRule_GenericIntroduction.java} (55%)
rename src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/{LastSingularCellBasicRule.java => LastSingularCellDirectRule.java} (95%)
rename src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/{LastSingularNumberBasicRule.java => LastSingularNumberDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/{LastVisibleCellBasicRule.java => LastVisibleCellDirectRule.java} (95%)
rename src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/{LastVisibleNumberBasicRule.java => LastVisibleNumberDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/{NEdgeBasicRule.java => NEdgeDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{AdvancedDeductionBasicRule.java => AdvancedDeductionDirectRule.java} (93%)
rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{LastCellForNumberBasicRule.java => LastCellForNumberDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/sudoku/rules/{LastNumberForCellBasicRule.java => LastNumberForCellDirectRule.java} (92%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{EmptyFieldBasicRule.java => EmptyFieldDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{FinishWithGrassBasicRule.java => FinishWithGrassDirectRule.java} (93%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{FinishWithTentsBasicRule.java => FinishWithTentsDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{LastCampingSpotBasicRule.java => LastCampingSpotDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{SurroundTentWithGrassBasicRule.java => SurroundTentWithGrassDirectRule.java} (93%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{TentForTreeBasicRule.java => TentForTreeDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/puzzle/treetent/rules/{TreeForTentBasicRule.java => TreeForTentDirectRule.java} (94%)
rename src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/{BasicRulePanel.java => DirectRulePanel.java} (65%)
rename src/test/java/puzzles/nurikabe/rules/{BlackBetweenRegionsBasicRuleTest.java => BlackBetweenRegionsDirectRuleTest.java} (84%)
rename src/test/java/puzzles/nurikabe/rules/{CornerBlackBasicRuleTest.java => CornerBlackDirectRuleTest.java} (79%)
rename src/test/java/puzzles/nurikabe/rules/{FillinWhiteBasicRuleTest.java => FillinWhiteDirectRuleTest.java} (68%)
rename src/test/java/puzzles/nurikabe/rules/{PreventBlackSquareBasicRuleTest.java => PreventBlackSquareDirectRuleTest.java} (89%)
rename src/test/java/puzzles/nurikabe/rules/{SurroundRegionBasicRuleTest.java => SurroundRegionDirectRuleTest.java} (84%)
rename src/test/java/puzzles/nurikabe/rules/{WhiteBottleNeckBasicRuleTest.java => WhiteBottleNeckDirectRuleTest.java} (90%)
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
index 79ee123c2..a55e7a179 100644
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/result.csv b/result.csv
index 628b0d342..56c95e73a 100644
--- a/result.csv
+++ b/result.csv
@@ -569,7 +569,7 @@ build/classes/java/main/edu/rpi/legup/controller,RuleController.class,Invalid,,U
build/classes/java/main/edu/rpi/legup/controller,ToolbarController.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/controller,TreeController.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,AddTreeElementCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ApplyDefaultBasicRuleCommand.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/history,ApplyDefaultDirectRuleCommand.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,AutoCaseRuleCommand.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,CommandError.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,CommandState.class,Invalid,,Ungradeable
@@ -582,7 +582,7 @@ build/classes/java/main/edu/rpi/legup/history,IHistorySubject.class,Invalid,,Ung
build/classes/java/main/edu/rpi/legup/history,InvalidCommandStateTransition.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,MergeCommand.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,PuzzleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ValidateBasicRuleCommand.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/history,ValidateDirectRuleCommand.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,ValidateCaseRuleCommand.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/history,ValidateContradictionRuleCommand.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup,Legup.class,Invalid,,Ungradeable
@@ -606,7 +606,7 @@ build/classes/java/main/edu/rpi/legup/model,Puzzle.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/model,PuzzleExporter.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/model,PuzzleImporter.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/model,RegisterPuzzle.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,BasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/model/rules,DirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/model/rules,CaseRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/model/rules,ContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/model/rules,MergeRule.class,Invalid,,Ungradeable
@@ -633,15 +633,15 @@ build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipImporter.class
build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipType.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipView.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,AdjacentShipsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ContinueShipBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,FinishWithShipsBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,FinishWithWaterBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ContinueShipDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,FinishWithShipsDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,FinishWithWaterDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,IncompleteShipContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SegmentTypeBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SegmentTypeDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SegmentTypeCaseRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ShipLocationCaseRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ShipOrWaterCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SurroundShipBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SurroundShipDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooFewInFleetContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooFewRowColContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooManyInFleetContradictionRule.class,Invalid,,Ungradeable
@@ -659,8 +659,8 @@ build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixImporter.class,Inv
build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixUtilities.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixView.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,BlackOrWhiteCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,FinishWithBlackBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,FinishWithWhiteBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,FinishWithBlackDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,FinishWithWhiteDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,TooFewBlackCellsContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,TooManyBlackCellsContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake,Heyawake.class,Invalid,,Ungradeable
@@ -674,22 +674,22 @@ build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeImporter.class,Inv
build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeView.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,AdjacentBlacksContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BlackOrWhiteCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BlackPathBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BottleNeckBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,FillRoomBlackBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,FillRoomWhiteBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,OneRowBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,PreventWhiteLineBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BlackPathDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BottleNeckDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,FillRoomBlackDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,FillRoomWhiteDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,OneRowDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,PreventWhiteLineDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,RoomTooEmptyContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,RoomTooFullContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ThreeByThreeBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,TwoInCornerBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ThreeByThreeDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,TwoInCornerDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteAreaContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteAroundBlackBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteEscapeBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteAroundBlackDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteEscapeDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteLineContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ZigZagCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ZigZagWhiteBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ZigZagWhiteDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/elements,BlackTile.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/elements,BulbTile.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/elements,NumberTile.class,Invalid,,Ungradeable
@@ -704,14 +704,14 @@ build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpExporter.class,Inval
build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpImporter.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpView.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,BulbsInPathContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,BulbsOutsideDiagonalBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,BulbsOutsideDiagonalDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,CannotLightACellContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,EmptyCellinLightBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,EmptyCornersBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,FinishWithBulbsBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,FinishWithEmptyBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,EmptyCellinLightDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,EmptyCornersDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,FinishWithBulbsDirectRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,FinishWithEmptyDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,LightOrEmptyCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,MustLightBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,MustLightDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,SatisfyNumberCaseRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,TooFewBulbsContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,TooManyBulbsContradictionRule.class,Invalid,,Ungradeable
@@ -730,9 +730,9 @@ build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuType.class,Invalid,,Ungr
build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuView.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BadLoopingContradictionRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackEdgeBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackEdgeDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackSplitCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlockedBlackBasicRule.class,Invalid,,Ungradeable
+build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlockedBlackDirectRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,ConnectedCellsBasicRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,FinishPathBasicRule.class,Invalid,,Ungradeable
build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,NearWhiteBasicRule.class,Invalid,,Ungradeable
diff --git a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
index a03a77a03..17d53eab6 100644
--- a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
+++ b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
@@ -1,9 +1,9 @@
package edu.rpi.legup.app;
import edu.rpi.legup.history.ICommand;
-import edu.rpi.legup.history.ValidateBasicRuleCommand;
+import edu.rpi.legup.history.ValidateDirectRuleCommand;
import edu.rpi.legup.history.ValidateContradictionRuleCommand;
-import edu.rpi.legup.model.rules.BasicRule;
+import edu.rpi.legup.model.rules.DirectRule;
import edu.rpi.legup.model.rules.ContradictionRule;
import edu.rpi.legup.model.rules.Rule;
import edu.rpi.legup.model.rules.RuleType;
@@ -84,7 +84,7 @@ public void keyPressed(KeyEvent e) {
else {
TreeViewSelection selection = treeView.getSelection();
- ICommand validate = new ValidateBasicRuleCommand(selection, (BasicRule) rule);
+ ICommand validate = new ValidateDirectRuleCommand(selection, (DirectRule) rule);
if (validate.canExecute()) {
getInstance().getHistory().pushChange(validate);
validate.execute();
diff --git a/src/main/java/edu/rpi/legup/controller/RuleController.java b/src/main/java/edu/rpi/legup/controller/RuleController.java
index 6abe39d84..fef6fca45 100644
--- a/src/main/java/edu/rpi/legup/controller/RuleController.java
+++ b/src/main/java/edu/rpi/legup/controller/RuleController.java
@@ -95,7 +95,7 @@ public void buttonPressed(Rule rule) {
}
else {
boolean def = LegupPreferences.getInstance().getUserPrefAsBool(LegupPreferences.ALLOW_DEFAULT_RULES);
- ICommand validate = def ? new ApplyDefaultBasicRuleCommand(selection, (BasicRule) rule) : new ValidateBasicRuleCommand(selection, (BasicRule) rule);
+ ICommand validate = def ? new ApplyDefaultDirectRuleCommand(selection, (DirectRule) rule) : new ValidateDirectRuleCommand(selection, (DirectRule) rule);
if (validate.canExecute()) {
getInstance().getHistory().pushChange(validate);
validate.execute();
diff --git a/src/main/java/edu/rpi/legup/history/ApplyDefaultBasicRuleCommand.java b/src/main/java/edu/rpi/legup/history/ApplyDefaultDirectRuleCommand.java
similarity index 91%
rename from src/main/java/edu/rpi/legup/history/ApplyDefaultBasicRuleCommand.java
rename to src/main/java/edu/rpi/legup/history/ApplyDefaultDirectRuleCommand.java
index 23f2fa066..bc4c89741 100644
--- a/src/main/java/edu/rpi/legup/history/ApplyDefaultBasicRuleCommand.java
+++ b/src/main/java/edu/rpi/legup/history/ApplyDefaultDirectRuleCommand.java
@@ -1,128 +1,128 @@
-package edu.rpi.legup.history;
-
-import edu.rpi.legup.app.GameBoardFacade;
-import edu.rpi.legup.model.Puzzle;
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.*;
-import edu.rpi.legup.ui.proofeditorui.treeview.*;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ApplyDefaultBasicRuleCommand extends PuzzleCommand {
-
- private TreeViewSelection selection;
- private BasicRule rule;
- private Map addMap;
-
- /**
- * ApplyDefaultBasicRuleCommand Constructor creates a command for applying the default of a basic rule
- *
- * @param selection selection of tree element views
- * @param rule basic rule for the command
- */
- public ApplyDefaultBasicRuleCommand(TreeViewSelection selection, BasicRule rule) {
- this.selection = selection.copy();
- this.rule = rule;
- this.addMap = new HashMap<>();
- }
-
- /**
- * Gets the reason why the command cannot be executed
- *
- * @return if command cannot be executed, returns reason for why the command cannot be executed,
- * otherwise null if command can be executed
- */
- @Override
- public String getErrorString() {
- List selectedViews = selection.getSelectedViews();
- if (selectedViews.isEmpty()) {
- return CommandError.DEFAULT_APPLICATION + " - " + CommandError.NO_SELECTED_VIEWS.toString();
- }
- else {
- for (TreeElementView view : selectedViews) {
- TreeElement element = view.getTreeElement();
- if (element.getType() == TreeElementType.NODE) {
- TreeNode node = (TreeNode) element;
- if (!node.getChildren().isEmpty()) {
- return CommandError.DEFAULT_APPLICATION + " - " + CommandError.NO_CHILDREN.toString();
- }
- else {
- if (rule.getDefaultBoard(node) == null) {
- return CommandError.DEFAULT_APPLICATION + " - " + "This selection contains a tree element that this rule cannot be applied to.";
- }
- }
- }
- else {
- return CommandError.DEFAULT_APPLICATION + " - " + CommandError.SELECTION_CONTAINS_TRANSITION.toString();
- }
- }
- }
- return null;
- }
-
- /**
- * Executes an command
- */
- @Override
- public void executeCommand() {
- Tree tree = GameBoardFacade.getInstance().getTree();
- TreeView treeView = GameBoardFacade.getInstance().getLegupUI().getTreePanel().getTreeView();
- Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
- final TreeViewSelection newSelection = new TreeViewSelection();
-
- for (TreeElementView selectedView : selection.getSelectedViews()) {
- TreeNodeView nodeView = (TreeNodeView) selectedView;
- TreeNode node = nodeView.getTreeElement();
- TreeTransition transition = addMap.get(node);
- TreeNode childNode;
- if (transition == null) {
- transition = (TreeTransition) tree.addTreeElement(node);
- childNode = (TreeNode) tree.addTreeElement(transition);
- addMap.put(node, transition);
- }
- else {
- tree.addTreeElement(node, transition);
- childNode = transition.getChildNode();
- }
-
- transition.setRule(rule);
- Board defaultBoard = rule.getDefaultBoard(node);
- transition.setBoard(defaultBoard);
- Board copyBoard = defaultBoard.copy();
- copyBoard.setModifiable(false);
- childNode.setBoard(copyBoard);
-
- final TreeTransition finalTran = transition;
- puzzle.notifyTreeListeners(listener -> listener.onTreeElementAdded(finalTran));
-
- newSelection.addToSelection(treeView.getElementView(childNode));
- }
-
- final TreeElement finalTreeElement = newSelection.getFirstSelection().getTreeElement();
- puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
- puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(newSelection));
- }
-
- /**
- * Undoes an command
- */
- @Override
- public void undoCommand() {
- Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
-
- for (TreeElementView selectedView : selection.getSelectedViews()) {
- TreeNodeView nodeView = (TreeNodeView) selectedView;
- TreeNode node = nodeView.getTreeElement();
- final TreeTransition transition = addMap.get(node);
-
- puzzle.notifyTreeListeners(listener -> listener.onTreeElementRemoved(transition));
- }
-
- final TreeElement finalTreeElement = selection.getFirstSelection().getTreeElement();
- puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
- puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(selection));
- }
-}
+package edu.rpi.legup.history;
+
+import edu.rpi.legup.app.GameBoardFacade;
+import edu.rpi.legup.model.Puzzle;
+import edu.rpi.legup.model.gameboard.Board;
+import edu.rpi.legup.model.rules.DirectRule;
+import edu.rpi.legup.model.tree.*;
+import edu.rpi.legup.ui.proofeditorui.treeview.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ApplyDefaultDirectRuleCommand extends PuzzleCommand {
+
+ private TreeViewSelection selection;
+ private DirectRule rule;
+ private Map addMap;
+
+ /**
+ * ApplyDefaultDirectRuleCommand Constructor creates a command for applying the default of a basic rule
+ *
+ * @param selection selection of tree element views
+ * @param rule basic rule for the command
+ */
+ public ApplyDefaultDirectRuleCommand(TreeViewSelection selection, DirectRule rule) {
+ this.selection = selection.copy();
+ this.rule = rule;
+ this.addMap = new HashMap<>();
+ }
+
+ /**
+ * Gets the reason why the command cannot be executed
+ *
+ * @return if command cannot be executed, returns reason for why the command cannot be executed,
+ * otherwise null if command can be executed
+ */
+ @Override
+ public String getErrorString() {
+ List selectedViews = selection.getSelectedViews();
+ if (selectedViews.isEmpty()) {
+ return CommandError.DEFAULT_APPLICATION + " - " + CommandError.NO_SELECTED_VIEWS.toString();
+ }
+ else {
+ for (TreeElementView view : selectedViews) {
+ TreeElement element = view.getTreeElement();
+ if (element.getType() == TreeElementType.NODE) {
+ TreeNode node = (TreeNode) element;
+ if (!node.getChildren().isEmpty()) {
+ return CommandError.DEFAULT_APPLICATION + " - " + CommandError.NO_CHILDREN.toString();
+ }
+ else {
+ if (rule.getDefaultBoard(node) == null) {
+ return CommandError.DEFAULT_APPLICATION + " - " + "This selection contains a tree element that this rule cannot be applied to.";
+ }
+ }
+ }
+ else {
+ return CommandError.DEFAULT_APPLICATION + " - " + CommandError.SELECTION_CONTAINS_TRANSITION.toString();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Executes an command
+ */
+ @Override
+ public void executeCommand() {
+ Tree tree = GameBoardFacade.getInstance().getTree();
+ TreeView treeView = GameBoardFacade.getInstance().getLegupUI().getTreePanel().getTreeView();
+ Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
+ final TreeViewSelection newSelection = new TreeViewSelection();
+
+ for (TreeElementView selectedView : selection.getSelectedViews()) {
+ TreeNodeView nodeView = (TreeNodeView) selectedView;
+ TreeNode node = nodeView.getTreeElement();
+ TreeTransition transition = addMap.get(node);
+ TreeNode childNode;
+ if (transition == null) {
+ transition = (TreeTransition) tree.addTreeElement(node);
+ childNode = (TreeNode) tree.addTreeElement(transition);
+ addMap.put(node, transition);
+ }
+ else {
+ tree.addTreeElement(node, transition);
+ childNode = transition.getChildNode();
+ }
+
+ transition.setRule(rule);
+ Board defaultBoard = rule.getDefaultBoard(node);
+ transition.setBoard(defaultBoard);
+ Board copyBoard = defaultBoard.copy();
+ copyBoard.setModifiable(false);
+ childNode.setBoard(copyBoard);
+
+ final TreeTransition finalTran = transition;
+ puzzle.notifyTreeListeners(listener -> listener.onTreeElementAdded(finalTran));
+
+ newSelection.addToSelection(treeView.getElementView(childNode));
+ }
+
+ final TreeElement finalTreeElement = newSelection.getFirstSelection().getTreeElement();
+ puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
+ puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(newSelection));
+ }
+
+ /**
+ * Undoes an command
+ */
+ @Override
+ public void undoCommand() {
+ Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
+
+ for (TreeElementView selectedView : selection.getSelectedViews()) {
+ TreeNodeView nodeView = (TreeNodeView) selectedView;
+ TreeNode node = nodeView.getTreeElement();
+ final TreeTransition transition = addMap.get(node);
+
+ puzzle.notifyTreeListeners(listener -> listener.onTreeElementRemoved(transition));
+ }
+
+ final TreeElement finalTreeElement = selection.getFirstSelection().getTreeElement();
+ puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
+ puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(selection));
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/history/ValidateBasicRuleCommand.java b/src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/history/ValidateBasicRuleCommand.java
rename to src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java
index 29d8a6193..a0c4855cf 100644
--- a/src/main/java/edu/rpi/legup/history/ValidateBasicRuleCommand.java
+++ b/src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java
@@ -1,152 +1,152 @@
-package edu.rpi.legup.history;
-
-import edu.rpi.legup.app.GameBoardFacade;
-import edu.rpi.legup.model.Puzzle;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.rules.Rule;
-import edu.rpi.legup.model.tree.*;
-import edu.rpi.legup.ui.proofeditorui.treeview.*;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ValidateBasicRuleCommand extends PuzzleCommand {
- private TreeViewSelection selection;
-
- private Map oldRules;
- private Map addNode;
- private BasicRule newRule;
-
- /**
- * ValidateBasicRuleCommand Constructor creates a command for verifying a basic rule
- *
- * @param selection selection of tree elements
- * @param rule basic rule
- */
- public ValidateBasicRuleCommand(TreeViewSelection selection, BasicRule rule) {
- this.selection = selection.copy();
- this.newRule = rule;
- this.oldRules = new HashMap<>();
- this.addNode = new HashMap<>();
- }
-
- /**
- * Executes an command
- */
- @Override
- public void executeCommand() {
- Tree tree = GameBoardFacade.getInstance().getTree();
- TreeView treeView = GameBoardFacade.getInstance().getLegupUI().getTreePanel().getTreeView();
- Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
- final TreeViewSelection newSelection = new TreeViewSelection();
-
- List selectedViews = selection.getSelectedViews();
- for (TreeElementView selectedView : selectedViews) {
- TreeElement element = selectedView.getTreeElement();
- TreeTransitionView transitionView;
- if (element.getType() == TreeElementType.NODE) {
- TreeNodeView nodeView = (TreeNodeView) selectedView;
- transitionView = nodeView.getChildrenViews().get(0);
- }
- else {
- transitionView = (TreeTransitionView) selectedView;
- }
- TreeTransition transition = transitionView.getTreeElement();
-
- oldRules.put(transition, transition.getRule());
- transition.setRule(newRule);
-
- TreeNode childNode = transition.getChildNode();
- if (childNode == null) {
- childNode = addNode.get(transition);
- if (childNode == null) {
- childNode = (TreeNode) tree.addTreeElement(transition);
- addNode.put(transition, childNode);
- }
- else {
- tree.addTreeElement(transition, childNode);
- }
-
- final TreeNode finalNode = childNode;
- puzzle.notifyTreeListeners(listener -> listener.onTreeElementAdded(finalNode));
- }
- newSelection.addToSelection(treeView.getElementView(childNode));
- }
- TreeElementView firstSelectedView = selection.getFirstSelection();
- final TreeElement finalTreeElement;
- if (firstSelectedView.getType() == TreeElementType.NODE) {
- TreeNodeView nodeView = (TreeNodeView) firstSelectedView;
- finalTreeElement = nodeView.getChildrenViews().get(0).getTreeElement();
- }
- else {
- TreeTransitionView transitionView = (TreeTransitionView) firstSelectedView;
- finalTreeElement = transitionView.getChildView().getTreeElement();
- }
- puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
- puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(newSelection));
- }
-
- /**
- * Gets the reason why the command cannot be executed
- *
- * @return if command cannot be executed, returns reason for why the command cannot be executed,
- * otherwise null if command can be executed
- */
- @Override
- public String getErrorString() {
- List selectedViews = selection.getSelectedViews();
- if (selectedViews.isEmpty()) {
- return CommandError.NO_SELECTED_VIEWS.toString();
- }
-
- for (TreeElementView view : selectedViews) {
- if (view.getType() == TreeElementType.NODE) {
- TreeNodeView nodeView = (TreeNodeView) view;
- if (nodeView.getChildrenViews().size() != 1) {
- return CommandError.ONE_CHILD.toString();
- }
- }
- else {
- TreeTransitionView transView = (TreeTransitionView) view;
- if (transView.getParentViews().size() > 1) {
- return CommandError.CONTAINS_MERGE.toString();
- }
- }
- }
- return null;
- }
-
- /**
- * Undoes an command
- */
- @Override
- public void undoCommand() {
- Tree tree = GameBoardFacade.getInstance().getTree();
- Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
-
- for (TreeElementView selectedView : selection.getSelectedViews()) {
- TreeElement element = selectedView.getTreeElement();
- TreeTransitionView transitionView;
- if (element.getType() == TreeElementType.NODE) {
- TreeNodeView nodeView = (TreeNodeView) selectedView;
- transitionView = nodeView.getChildrenViews().get(0);
- }
- else {
- transitionView = (TreeTransitionView) selectedView;
- }
- TreeTransition transition = transitionView.getTreeElement();
- transition.setRule(oldRules.get(transition));
-
- if (addNode.get(transition) != null) {
- final TreeNode childNode = transition.getChildNode();
- tree.removeTreeElement(childNode);
- puzzle.notifyTreeListeners(listener -> listener.onTreeElementRemoved(childNode));
- }
- }
-
- final TreeElement finalTreeElement = selection.getFirstSelection().getTreeElement();
- puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
- puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(selection));
- }
-}
+package edu.rpi.legup.history;
+
+import edu.rpi.legup.app.GameBoardFacade;
+import edu.rpi.legup.model.Puzzle;
+import edu.rpi.legup.model.rules.DirectRule;
+import edu.rpi.legup.model.rules.Rule;
+import edu.rpi.legup.model.tree.*;
+import edu.rpi.legup.ui.proofeditorui.treeview.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ValidateDirectRuleCommand extends PuzzleCommand {
+ private TreeViewSelection selection;
+
+ private Map oldRules;
+ private Map addNode;
+ private DirectRule newRule;
+
+ /**
+ * ValidateBasicRuleCommand Constructor creates a command for verifying a basic rule
+ *
+ * @param selection selection of tree elements
+ * @param rule basic rule
+ */
+ public ValidateDirectRuleCommand(TreeViewSelection selection, DirectRule rule) {
+ this.selection = selection.copy();
+ this.newRule = rule;
+ this.oldRules = new HashMap<>();
+ this.addNode = new HashMap<>();
+ }
+
+ /**
+ * Executes an command
+ */
+ @Override
+ public void executeCommand() {
+ Tree tree = GameBoardFacade.getInstance().getTree();
+ TreeView treeView = GameBoardFacade.getInstance().getLegupUI().getTreePanel().getTreeView();
+ Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
+ final TreeViewSelection newSelection = new TreeViewSelection();
+
+ List selectedViews = selection.getSelectedViews();
+ for (TreeElementView selectedView : selectedViews) {
+ TreeElement element = selectedView.getTreeElement();
+ TreeTransitionView transitionView;
+ if (element.getType() == TreeElementType.NODE) {
+ TreeNodeView nodeView = (TreeNodeView) selectedView;
+ transitionView = nodeView.getChildrenViews().get(0);
+ }
+ else {
+ transitionView = (TreeTransitionView) selectedView;
+ }
+ TreeTransition transition = transitionView.getTreeElement();
+
+ oldRules.put(transition, transition.getRule());
+ transition.setRule(newRule);
+
+ TreeNode childNode = transition.getChildNode();
+ if (childNode == null) {
+ childNode = addNode.get(transition);
+ if (childNode == null) {
+ childNode = (TreeNode) tree.addTreeElement(transition);
+ addNode.put(transition, childNode);
+ }
+ else {
+ tree.addTreeElement(transition, childNode);
+ }
+
+ final TreeNode finalNode = childNode;
+ puzzle.notifyTreeListeners(listener -> listener.onTreeElementAdded(finalNode));
+ }
+ newSelection.addToSelection(treeView.getElementView(childNode));
+ }
+ TreeElementView firstSelectedView = selection.getFirstSelection();
+ final TreeElement finalTreeElement;
+ if (firstSelectedView.getType() == TreeElementType.NODE) {
+ TreeNodeView nodeView = (TreeNodeView) firstSelectedView;
+ finalTreeElement = nodeView.getChildrenViews().get(0).getTreeElement();
+ }
+ else {
+ TreeTransitionView transitionView = (TreeTransitionView) firstSelectedView;
+ finalTreeElement = transitionView.getChildView().getTreeElement();
+ }
+ puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
+ puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(newSelection));
+ }
+
+ /**
+ * Gets the reason why the command cannot be executed
+ *
+ * @return if command cannot be executed, returns reason for why the command cannot be executed,
+ * otherwise null if command can be executed
+ */
+ @Override
+ public String getErrorString() {
+ List selectedViews = selection.getSelectedViews();
+ if (selectedViews.isEmpty()) {
+ return CommandError.NO_SELECTED_VIEWS.toString();
+ }
+
+ for (TreeElementView view : selectedViews) {
+ if (view.getType() == TreeElementType.NODE) {
+ TreeNodeView nodeView = (TreeNodeView) view;
+ if (nodeView.getChildrenViews().size() != 1) {
+ return CommandError.ONE_CHILD.toString();
+ }
+ }
+ else {
+ TreeTransitionView transView = (TreeTransitionView) view;
+ if (transView.getParentViews().size() > 1) {
+ return CommandError.CONTAINS_MERGE.toString();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Undoes an command
+ */
+ @Override
+ public void undoCommand() {
+ Tree tree = GameBoardFacade.getInstance().getTree();
+ Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
+
+ for (TreeElementView selectedView : selection.getSelectedViews()) {
+ TreeElement element = selectedView.getTreeElement();
+ TreeTransitionView transitionView;
+ if (element.getType() == TreeElementType.NODE) {
+ TreeNodeView nodeView = (TreeNodeView) selectedView;
+ transitionView = nodeView.getChildrenViews().get(0);
+ }
+ else {
+ transitionView = (TreeTransitionView) selectedView;
+ }
+ TreeTransition transition = transitionView.getTreeElement();
+ transition.setRule(oldRules.get(transition));
+
+ if (addNode.get(transition) != null) {
+ final TreeNode childNode = transition.getChildNode();
+ tree.removeTreeElement(childNode);
+ puzzle.notifyTreeListeners(listener -> listener.onTreeElementRemoved(childNode));
+ }
+ }
+
+ final TreeElement finalTreeElement = selection.getFirstSelection().getTreeElement();
+ puzzle.notifyBoardListeners(listener -> listener.onTreeElementChanged(finalTreeElement));
+ puzzle.notifyTreeListeners(listener -> listener.onTreeSelectionChanged(selection));
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/model/Puzzle.java b/src/main/java/edu/rpi/legup/model/Puzzle.java
index 27eceb412..b21dcfd2d 100644
--- a/src/main/java/edu/rpi/legup/model/Puzzle.java
+++ b/src/main/java/edu/rpi/legup/model/Puzzle.java
@@ -53,7 +53,7 @@ public abstract class Puzzle implements IBoardSubject, ITreeSubject {
private List boardListeners;
private List treeListeners;
- protected List basicRules;
+ protected List directRules;
protected List contradictionRules;
protected List caseRules;
protected List placeableElements;
@@ -66,7 +66,7 @@ public Puzzle() {
this.boardListeners = new ArrayList<>();
this.treeListeners = new ArrayList<>();
- this.basicRules = new ArrayList<>();
+ this.directRules = new ArrayList<>();
this.contradictionRules = new ArrayList<>();
this.caseRules = new ArrayList<>();
@@ -148,7 +148,7 @@ private void registerRules() {
switch (rule.getRuleType()) {
case BASIC:
- this.addBasicRule((BasicRule) rule);
+ this.addDirectRule((DirectRule) rule);
break;
case CASE:
this.addCaseRule((CaseRule) rule);
@@ -329,8 +329,8 @@ public String getName() {
*
* @return list of basic rules
*/
- public List getBasicRules() {
- return basicRules;
+ public List getDirectRules() {
+ return directRules;
}
public List getPlaceableElements() {
@@ -345,10 +345,10 @@ public List getNonPlaceableElements() {
/**
* Sets the list of basic rules
*
- * @param basicRules list of basic rules
+ * @param directRules list of basic rules
*/
- public void setBasicRules(List basicRules) {
- this.basicRules = basicRules;
+ public void setDirectRules(List directRules) {
+ this.directRules = directRules;
}
/**
@@ -356,8 +356,8 @@ public void setBasicRules(List basicRules) {
*
* @param rule basic rule to add
*/
- public void addBasicRule(BasicRule rule) {
- basicRules.add(rule);
+ public void addDirectRule(DirectRule rule) {
+ directRules.add(rule);
}
public void addPlaceableElement(PlaceableElement element) {
@@ -373,8 +373,8 @@ public void addNonPlaceableElement(NonPlaceableElement element) {
*
* @param rule basic rule to remove
*/
- public void removeBasicRule(BasicRule rule) {
- basicRules.remove(rule);
+ public void removeDirectRule(DirectRule rule) {
+ directRules.remove(rule);
}
/**
@@ -456,7 +456,7 @@ public void removeCaseRule(CaseRule rule) {
* @return Rule
*/
public Rule getRuleByName(String name) {
- for (Rule rule : basicRules) {
+ for (Rule rule : directRules) {
if (rule.getRuleName().equals(name)) {
return rule;
}
@@ -485,7 +485,7 @@ public Rule getRuleByName(String name) {
* @return Rule
*/
public Rule getRuleByID(String id) {
- for (Rule rule : basicRules) {
+ for (Rule rule : directRules) {
if (rule.getRuleID().equals(id)) {
return rule;
}
diff --git a/src/main/java/edu/rpi/legup/model/rules/BasicRule.java b/src/main/java/edu/rpi/legup/model/rules/DirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/model/rules/BasicRule.java
rename to src/main/java/edu/rpi/legup/model/rules/DirectRule.java
index e71007d6b..940bbe32f 100644
--- a/src/main/java/edu/rpi/legup/model/rules/BasicRule.java
+++ b/src/main/java/edu/rpi/legup/model/rules/DirectRule.java
@@ -1,102 +1,102 @@
-package edu.rpi.legup.model.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-import static edu.rpi.legup.model.rules.RuleType.BASIC;
-
-public abstract class BasicRule extends Rule {
- /**
- * BasicRule Constructor creates a new basic rule.
- *
- * @param ruleID ID of the rule
- * @param ruleName name of the rule
- * @param description description of the rule
- * @param imageName file name of the image
- */
- public BasicRule(String ruleID, String ruleName, String description, String imageName) {
- super(ruleID, ruleName, description, imageName);
- this.ruleType = BASIC;
- }
-
- /**
- * Checks whether the {@link TreeTransition} 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
- */
- public String checkRule(TreeTransition transition) {
- Board finalBoard = transition.getBoard();
-
- if (!finalBoard.isModified()) {
- return "State must be modified";
- }
- else {
- if (transition.getParents().size() != 1 ||
- transition.getParents().get(0).getChildren().size() != 1) {
- return "State must have only 1 parent and 1 child";
- }
- else {
- return checkRuleRaw(transition);
- }
- }
- }
-
- /**
- * 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
- */
- public String checkRuleRaw(TreeTransition transition) {
- Board finalBoard = transition.getBoard();
- String checkStr = null;
- for (PuzzleElement puzzleElement : finalBoard.getModifiedData()) {
- String tempStr = checkRuleAt(transition, puzzleElement);
- if (tempStr != null) {
- checkStr = tempStr;
- }
- }
- return checkStr;
- }
-
- /**
- * Checks whether the child node logically follows from the parent node at the specific {@link PuzzleElement} 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 checkRuleAt(TreeTransition transition, PuzzleElement puzzleElement) {
- Board finalBoard = transition.getBoard();
- puzzleElement = finalBoard.getPuzzleElement(puzzleElement);
- String checkStr;
- if (!puzzleElement.isModified()) {
- checkStr = "PuzzleElement must be modified";
- }
- else {
- if (transition.getParents().size() != 1 ||
- transition.getParents().get(0).getChildren().size() != 1) {
- checkStr = "State must have only 1 parent and 1 child";
- }
- else {
- checkStr = checkRuleRawAt(transition, puzzleElement);
- }
- }
- puzzleElement.setValid(checkStr == null);
- return checkStr;
- }
-
- /**
- * 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
- */
- public abstract Board getDefaultBoard(TreeNode node);
-}
+package edu.rpi.legup.model.rules;
+
+import edu.rpi.legup.model.gameboard.Board;
+import edu.rpi.legup.model.gameboard.PuzzleElement;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+
+import static edu.rpi.legup.model.rules.RuleType.BASIC;
+
+public abstract class DirectRule extends Rule {
+ /**
+ * DirectRule Constructor creates a new basic rule.
+ *
+ * @param ruleID ID of the rule
+ * @param ruleName name of the rule
+ * @param description description of the rule
+ * @param imageName file name of the image
+ */
+ public DirectRule(String ruleID, String ruleName, String description, String imageName) {
+ super(ruleID, ruleName, description, imageName);
+ this.ruleType = BASIC;
+ }
+
+ /**
+ * Checks whether the {@link TreeTransition} 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
+ */
+ public String checkRule(TreeTransition transition) {
+ Board finalBoard = transition.getBoard();
+
+ if (!finalBoard.isModified()) {
+ return "State must be modified";
+ }
+ else {
+ if (transition.getParents().size() != 1 ||
+ transition.getParents().get(0).getChildren().size() != 1) {
+ return "State must have only 1 parent and 1 child";
+ }
+ else {
+ return checkRuleRaw(transition);
+ }
+ }
+ }
+
+ /**
+ * 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
+ */
+ public String checkRuleRaw(TreeTransition transition) {
+ Board finalBoard = transition.getBoard();
+ String checkStr = null;
+ for (PuzzleElement puzzleElement : finalBoard.getModifiedData()) {
+ String tempStr = checkRuleAt(transition, puzzleElement);
+ if (tempStr != null) {
+ checkStr = tempStr;
+ }
+ }
+ return checkStr;
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node at the specific {@link PuzzleElement} 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 checkRuleAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ Board finalBoard = transition.getBoard();
+ puzzleElement = finalBoard.getPuzzleElement(puzzleElement);
+ String checkStr;
+ if (!puzzleElement.isModified()) {
+ checkStr = "PuzzleElement must be modified";
+ }
+ else {
+ if (transition.getParents().size() != 1 ||
+ transition.getParents().get(0).getChildren().size() != 1) {
+ checkStr = "State must have only 1 parent and 1 child";
+ }
+ else {
+ checkStr = checkRuleRawAt(transition, puzzleElement);
+ }
+ }
+ puzzleElement.setValid(checkStr == null);
+ return checkStr;
+ }
+
+ /**
+ * 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
+ */
+ public abstract Board getDefaultBoard(TreeNode node);
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/ContinueShipBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/ContinueShipDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/battleship/rules/ContinueShipBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/battleship/rules/ContinueShipDirectRule.java
index f947fb859..18c55d635 100644
--- a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/ContinueShipBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/ContinueShipDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.battleship.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class ContinueShipBasicRule extends BasicRule {
-
- public ContinueShipBasicRule() {
- super("BTSP-BASC-0001",
- "Continue Ship",
- "",
- "edu/rpi/legup/images/battleship/rules/ContinueShip.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should be overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.battleship.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 ContinueShipDirectRule extends DirectRule {
+
+ public ContinueShipDirectRule() {
+ super("BTSP-BASC-0001",
+ "Continue Ship",
+ "",
+ "edu/rpi/legup/images/battleship/rules/ContinueShip.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should be overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/battleship/rules/FinishWithShipsBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithShipsDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithShipsBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithShipsDirectRule.java
index 8edb9dd15..3374d1806 100644
--- a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithShipsBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithShipsDirectRule.java
@@ -1,116 +1,116 @@
-package edu.rpi.legup.puzzle.battleship.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.battleship.BattleshipBoard;
-import edu.rpi.legup.puzzle.battleship.BattleshipCell;
-import edu.rpi.legup.puzzle.battleship.BattleshipClue;
-import edu.rpi.legup.puzzle.battleship.BattleshipType;
-
-import java.awt.*;
-import java.util.List;
-
-public class FinishWithShipsBasicRule extends BasicRule {
-
- public FinishWithShipsBasicRule() {
- super("BTSP-BASC-0002",
- "Finish with Ships",
- "The number of undetermined squares is equal to the number " +
- "of segments remaining for each clue.",
- "edu/rpi/legup/images/battleship/rules/finishShip.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should be overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition,
- PuzzleElement puzzleElement) {
- BattleshipBoard initBoard = (BattleshipBoard) transition.getParents()
- .get(0).getBoard();
- BattleshipCell initCell = (BattleshipCell) initBoard
- .getPuzzleElement(puzzleElement);
- BattleshipBoard finalBoard = (BattleshipBoard) transition.getBoard();
- BattleshipCell finalCell = (BattleshipCell) finalBoard
- .getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == BattleshipType.UNKNOWN
- && BattleshipType.isShip(finalCell.getType()))) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be a ship.";
- }
-
- if (isForced(initBoard, initCell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to" +
- "be a ship segment.";
- }
- }
-
- private boolean isForced(BattleshipBoard board, BattleshipCell cell) {
- Point loc = cell.getLocation();
-
- // count the number of ship segments and unknowns in the row
- List row = board.getRow(loc.y);
- int rowCount = 0;
- for (BattleshipCell c : row) {
- if (c.getType() == BattleshipType.SHIP_UNKNOWN
- || BattleshipType.isShip(c.getType())) {
- rowCount++;
- }
- }
-
- // count the number of ship segments and unknowns in the column
- List col = board.getColumn(loc.x);
- int colCount = 0;
- for (BattleshipCell c : col) {
- if (c.getType() == BattleshipType.SHIP_UNKNOWN
- || BattleshipType.isShip(c.getType())) {
- colCount++;
- }
- }
-
- // compare the counts with the clues
- BattleshipClue east = board.getEast().get(loc.y);
- BattleshipClue south = board.getSouth().get(loc.x);
-
- return rowCount <= east.getData() && colCount <= south.getData();
- }
-
- /**
- * 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) {
- BattleshipBoard board = (BattleshipBoard) node.getBoard().copy();
- for (PuzzleElement element : board.getPuzzleElements()) {
- BattleshipCell cell = (BattleshipCell) element;
- if (cell.getType() == BattleshipType.UNKNOWN && isForced(board, cell)) {
- cell.setData(BattleshipType.SHIP_UNKNOWN);
- board.addModifiedData(cell);
- }
- }
-
- if (board.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return board;
- }
- }
-}
+package edu.rpi.legup.puzzle.battleship.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.battleship.BattleshipBoard;
+import edu.rpi.legup.puzzle.battleship.BattleshipCell;
+import edu.rpi.legup.puzzle.battleship.BattleshipClue;
+import edu.rpi.legup.puzzle.battleship.BattleshipType;
+
+import java.awt.*;
+import java.util.List;
+
+public class FinishWithShipsDirectRule extends DirectRule {
+
+ public FinishWithShipsDirectRule() {
+ super("BTSP-BASC-0002",
+ "Finish with Ships",
+ "The number of undetermined squares is equal to the number " +
+ "of segments remaining for each clue.",
+ "edu/rpi/legup/images/battleship/rules/finishShip.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should be overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition,
+ PuzzleElement puzzleElement) {
+ BattleshipBoard initBoard = (BattleshipBoard) transition.getParents()
+ .get(0).getBoard();
+ BattleshipCell initCell = (BattleshipCell) initBoard
+ .getPuzzleElement(puzzleElement);
+ BattleshipBoard finalBoard = (BattleshipBoard) transition.getBoard();
+ BattleshipCell finalCell = (BattleshipCell) finalBoard
+ .getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == BattleshipType.UNKNOWN
+ && BattleshipType.isShip(finalCell.getType()))) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be a ship.";
+ }
+
+ if (isForced(initBoard, initCell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to" +
+ "be a ship segment.";
+ }
+ }
+
+ private boolean isForced(BattleshipBoard board, BattleshipCell cell) {
+ Point loc = cell.getLocation();
+
+ // count the number of ship segments and unknowns in the row
+ List row = board.getRow(loc.y);
+ int rowCount = 0;
+ for (BattleshipCell c : row) {
+ if (c.getType() == BattleshipType.SHIP_UNKNOWN
+ || BattleshipType.isShip(c.getType())) {
+ rowCount++;
+ }
+ }
+
+ // count the number of ship segments and unknowns in the column
+ List col = board.getColumn(loc.x);
+ int colCount = 0;
+ for (BattleshipCell c : col) {
+ if (c.getType() == BattleshipType.SHIP_UNKNOWN
+ || BattleshipType.isShip(c.getType())) {
+ colCount++;
+ }
+ }
+
+ // compare the counts with the clues
+ BattleshipClue east = board.getEast().get(loc.y);
+ BattleshipClue south = board.getSouth().get(loc.x);
+
+ return rowCount <= east.getData() && colCount <= south.getData();
+ }
+
+ /**
+ * 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) {
+ BattleshipBoard board = (BattleshipBoard) node.getBoard().copy();
+ for (PuzzleElement element : board.getPuzzleElements()) {
+ BattleshipCell cell = (BattleshipCell) element;
+ if (cell.getType() == BattleshipType.UNKNOWN && isForced(board, cell)) {
+ cell.setData(BattleshipType.SHIP_UNKNOWN);
+ board.addModifiedData(cell);
+ }
+ }
+
+ if (board.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return board;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithWaterBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithWaterDirectRule.java
similarity index 87%
rename from src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithWaterBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithWaterDirectRule.java
index be29e7c18..157b13d01 100644
--- a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithWaterBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/FinishWithWaterDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.battleship.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class FinishWithWaterBasicRule extends BasicRule {
-
- public FinishWithWaterBasicRule() {
- super("BTSP-BASC-0003",
- "Finish with Water",
- "",
- "edu/rpi/legup/images/battleship/rules/finishWater.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.battleship.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 FinishWithWaterDirectRule extends DirectRule {
+
+ public FinishWithWaterDirectRule() {
+ super("BTSP-BASC-0003",
+ "Finish with Water",
+ "",
+ "edu/rpi/legup/images/battleship/rules/finishWater.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/battleship/rules/SegmentTypeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/SegmentTypeDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/battleship/rules/SegmentTypeBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/battleship/rules/SegmentTypeDirectRule.java
index 676b9dc69..f90dea1bd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/SegmentTypeBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/SegmentTypeDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.battleship.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class SegmentTypeBasicRule extends BasicRule {
-
- public SegmentTypeBasicRule() {
- super("BTSP-BASC-0004",
- "Segment Type",
- "",
- "edu/rpi/legup/images/battleship/rules/SegmentChoice.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.battleship.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 SegmentTypeDirectRule extends DirectRule {
+
+ public SegmentTypeDirectRule() {
+ super("BTSP-BASC-0004",
+ "Segment Type",
+ "",
+ "edu/rpi/legup/images/battleship/rules/SegmentChoice.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/battleship/rules/SurroundShipBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/SurroundShipDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/battleship/rules/SurroundShipBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/battleship/rules/SurroundShipDirectRule.java
index ee3bd18a9..57ad42121 100644
--- a/src/main/java/edu/rpi/legup/puzzle/battleship/rules/SurroundShipBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/battleship/rules/SurroundShipDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.battleship.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class SurroundShipBasicRule extends BasicRule {
-
- public SurroundShipBasicRule() {
- super("BTSP-BASC-0005",
- "Surround Ship",
- "",
- "edu/rpi/legup/images/battleship/rules/SurroundShip.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.battleship.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 SurroundShipDirectRule extends DirectRule {
+
+ public SurroundShipDirectRule() {
+ super("BTSP-BASC-0005",
+ "Surround Ship",
+ "",
+ "edu/rpi/legup/images/battleship/rules/SurroundShip.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/fillapix/rules/FinishWithBlackBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithBlackDirectRule.java
similarity index 93%
rename from src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithBlackBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithBlackDirectRule.java
index 58efa2ab1..afd226693 100644
--- a/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithBlackBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithBlackDirectRule.java
@@ -1,70 +1,70 @@
-package edu.rpi.legup.puzzle.fillapix.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.fillapix.FillapixBoard;
-import edu.rpi.legup.puzzle.fillapix.FillapixCell;
-import edu.rpi.legup.puzzle.fillapix.FillapixCellType;
-
-public class FinishWithBlackBasicRule extends BasicRule {
- public FinishWithBlackBasicRule() {
- super("FPIX-BASC-0001",
- "Finish with Black",
- "The remaining unknowns around and on a cell must be black to satisfy the number",
- "edu/rpi/legup/images/fillapix/rules/FinishWithBlack.png");
- }
-
- @Override
- public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- FillapixBoard board = (FillapixBoard) transition.getBoard();
- FillapixBoard parentBoard = (FillapixBoard) transition.getParents().get(0).getBoard();
- FillapixCell cell = (FillapixCell) board.getPuzzleElement(puzzleElement);
- FillapixCell parentCell = (FillapixCell) parentBoard.getPuzzleElement(puzzleElement);
-
- if (!(parentCell.getType() == FillapixCellType.UNKNOWN && cell.getType() == FillapixCellType.BLACK)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be black to be applicable with this rule.";
- }
-
- if (isForcedBlack(parentBoard, cell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be black";
- }
- }
-
- private boolean isForcedBlack(FillapixBoard board, FillapixCell cell) {
- TooFewBlackCellsContradictionRule tooManyBlackCells = new TooFewBlackCellsContradictionRule();
- FillapixBoard whiteCaseBoard = board.copy();
- FillapixCell whiteCell = (FillapixCell) whiteCaseBoard.getPuzzleElement(cell);
- whiteCell.setType(FillapixCellType.WHITE);
- return tooManyBlackCells.checkContradictionAt(whiteCaseBoard, cell) == 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) {
- FillapixBoard fillapixBoard = (FillapixBoard) node.getBoard().copy();
- for (PuzzleElement element : fillapixBoard.getPuzzleElements()) {
- FillapixCell cell = (FillapixCell) element;
- if (cell.getType() == FillapixCellType.UNKNOWN && isForcedBlack((FillapixBoard) node.getBoard(), cell)) {
- cell.setType(FillapixCellType.BLACK);
- fillapixBoard.addModifiedData(cell);
- }
- }
- if (fillapixBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return fillapixBoard;
- }
- }
+package edu.rpi.legup.puzzle.fillapix.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.fillapix.FillapixBoard;
+import edu.rpi.legup.puzzle.fillapix.FillapixCell;
+import edu.rpi.legup.puzzle.fillapix.FillapixCellType;
+
+public class FinishWithBlackDirectRule extends DirectRule {
+ public FinishWithBlackDirectRule() {
+ super("FPIX-BASC-0001",
+ "Finish with Black",
+ "The remaining unknowns around and on a cell must be black to satisfy the number",
+ "edu/rpi/legup/images/fillapix/rules/FinishWithBlack.png");
+ }
+
+ @Override
+ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ FillapixBoard board = (FillapixBoard) transition.getBoard();
+ FillapixBoard parentBoard = (FillapixBoard) transition.getParents().get(0).getBoard();
+ FillapixCell cell = (FillapixCell) board.getPuzzleElement(puzzleElement);
+ FillapixCell parentCell = (FillapixCell) parentBoard.getPuzzleElement(puzzleElement);
+
+ if (!(parentCell.getType() == FillapixCellType.UNKNOWN && cell.getType() == FillapixCellType.BLACK)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be black to be applicable with this rule.";
+ }
+
+ if (isForcedBlack(parentBoard, cell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be black";
+ }
+ }
+
+ private boolean isForcedBlack(FillapixBoard board, FillapixCell cell) {
+ TooFewBlackCellsContradictionRule tooManyBlackCells = new TooFewBlackCellsContradictionRule();
+ FillapixBoard whiteCaseBoard = board.copy();
+ FillapixCell whiteCell = (FillapixCell) whiteCaseBoard.getPuzzleElement(cell);
+ whiteCell.setType(FillapixCellType.WHITE);
+ return tooManyBlackCells.checkContradictionAt(whiteCaseBoard, cell) == 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) {
+ FillapixBoard fillapixBoard = (FillapixBoard) node.getBoard().copy();
+ for (PuzzleElement element : fillapixBoard.getPuzzleElements()) {
+ FillapixCell cell = (FillapixCell) element;
+ if (cell.getType() == FillapixCellType.UNKNOWN && isForcedBlack((FillapixBoard) node.getBoard(), cell)) {
+ cell.setType(FillapixCellType.BLACK);
+ fillapixBoard.addModifiedData(cell);
+ }
+ }
+ if (fillapixBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return fillapixBoard;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithWhiteBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithWhiteDirectRule.java
similarity index 93%
rename from src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithWhiteBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithWhiteDirectRule.java
index 0874f0177..ec482d5f7 100644
--- a/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithWhiteBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/FinishWithWhiteDirectRule.java
@@ -1,70 +1,70 @@
-package edu.rpi.legup.puzzle.fillapix.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.fillapix.FillapixBoard;
-import edu.rpi.legup.puzzle.fillapix.FillapixCell;
-import edu.rpi.legup.puzzle.fillapix.FillapixCellType;
-
-public class FinishWithWhiteBasicRule extends BasicRule {
- public FinishWithWhiteBasicRule() {
- super("FFIX-BASC-0002",
- "Finish with White",
- "The remaining unknowns around and on a cell must be white to satisfy the number",
- "edu/rpi/legup/images/fillapix/rules/FinishWithWhite.png");
- }
-
- @Override
- public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- FillapixBoard board = (FillapixBoard) transition.getBoard();
- FillapixBoard parentBoard = (FillapixBoard) transition.getParents().get(0).getBoard();
- FillapixCell cell = (FillapixCell) board.getPuzzleElement(puzzleElement);
- FillapixCell parentCell = (FillapixCell) parentBoard.getPuzzleElement(puzzleElement);
-
- if (!(parentCell.getType() == FillapixCellType.UNKNOWN && cell.getType() == FillapixCellType.WHITE)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be white to be applicable with this rule";
- }
-
- if (isForcedWhite(parentBoard, cell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be white";
- }
- }
-
- private boolean isForcedWhite(FillapixBoard board, FillapixCell cell) {
- TooManyBlackCellsContradictionRule tooManyBlackCells = new TooManyBlackCellsContradictionRule();
- FillapixBoard blackCaseBoard = board.copy();
- FillapixCell blackCell = (FillapixCell) blackCaseBoard.getPuzzleElement(cell);
- blackCell.setType(FillapixCellType.BLACK);
- return tooManyBlackCells.checkContradictionAt(blackCaseBoard, cell) == 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) {
- FillapixBoard fillapixBoard = (FillapixBoard) node.getBoard().copy();
- for (PuzzleElement element : fillapixBoard.getPuzzleElements()) {
- FillapixCell cell = (FillapixCell) element;
- if (cell.getType() == FillapixCellType.UNKNOWN && isForcedWhite((FillapixBoard) node.getBoard(), cell)) {
- cell.setType(FillapixCellType.WHITE);
- fillapixBoard.addModifiedData(cell);
- }
- }
- if (fillapixBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return fillapixBoard;
- }
- }
+package edu.rpi.legup.puzzle.fillapix.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.fillapix.FillapixBoard;
+import edu.rpi.legup.puzzle.fillapix.FillapixCell;
+import edu.rpi.legup.puzzle.fillapix.FillapixCellType;
+
+public class FinishWithWhiteDirectRule extends DirectRule {
+ public FinishWithWhiteDirectRule() {
+ super("FFIX-BASC-0002",
+ "Finish with White",
+ "The remaining unknowns around and on a cell must be white to satisfy the number",
+ "edu/rpi/legup/images/fillapix/rules/FinishWithWhite.png");
+ }
+
+ @Override
+ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ FillapixBoard board = (FillapixBoard) transition.getBoard();
+ FillapixBoard parentBoard = (FillapixBoard) transition.getParents().get(0).getBoard();
+ FillapixCell cell = (FillapixCell) board.getPuzzleElement(puzzleElement);
+ FillapixCell parentCell = (FillapixCell) parentBoard.getPuzzleElement(puzzleElement);
+
+ if (!(parentCell.getType() == FillapixCellType.UNKNOWN && cell.getType() == FillapixCellType.WHITE)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be white to be applicable with this rule";
+ }
+
+ if (isForcedWhite(parentBoard, cell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be white";
+ }
+ }
+
+ private boolean isForcedWhite(FillapixBoard board, FillapixCell cell) {
+ TooManyBlackCellsContradictionRule tooManyBlackCells = new TooManyBlackCellsContradictionRule();
+ FillapixBoard blackCaseBoard = board.copy();
+ FillapixCell blackCell = (FillapixCell) blackCaseBoard.getPuzzleElement(cell);
+ blackCell.setType(FillapixCellType.BLACK);
+ return tooManyBlackCells.checkContradictionAt(blackCaseBoard, cell) == 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) {
+ FillapixBoard fillapixBoard = (FillapixBoard) node.getBoard().copy();
+ for (PuzzleElement element : fillapixBoard.getPuzzleElements()) {
+ FillapixCell cell = (FillapixCell) element;
+ if (cell.getType() == FillapixCellType.UNKNOWN && isForcedWhite((FillapixBoard) node.getBoard(), cell)) {
+ cell.setType(FillapixCellType.WHITE);
+ fillapixBoard.addModifiedData(cell);
+ }
+ }
+ if (fillapixBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return fillapixBoard;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/fillapix_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/fillapix_reference_sheet.txt
index eee67639a..b6172e7fb 100644
--- a/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/fillapix_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/fillapix/rules/fillapix_reference_sheet.txt
@@ -1,5 +1,5 @@
-FPIX-BASC-0001 : FinishWithBlackBasicRule
-FPIX-BASC-0002 : FinishWithWhiteBasicRule
+FPIX-BASC-0001 : FinishWithBlackDirectRule
+FPIX-BASC-0002 : FinishWithWhiteDirectRule
FPIX-CONT-0001 : TooFewBlackCellsContradictionRule
FPIX-CONT-0002 : TooManyBlackCellsContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BottleNeckBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BlackPathDirectRule.java
similarity index 62%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BottleNeckBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BlackPathDirectRule.java
index 4267c4076..474bdccdd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BottleNeckBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BlackPathDirectRule.java
@@ -1,7 +1,7 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class BottleNeckBasicRule {
- public BottleNeckBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class BlackPathDirectRule {
+ public BlackPathDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/OneRowBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BottleNeckDirectRule.java
similarity index 61%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/OneRowBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BottleNeckDirectRule.java
index 2acb0624f..f2e7fef5c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/OneRowBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BottleNeckDirectRule.java
@@ -1,7 +1,7 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class OneRowBasicRule {
- public OneRowBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class BottleNeckDirectRule {
+ public BottleNeckDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomBlackBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomBlackDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomBlackBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomBlackDirectRule.java
index b738a20b0..828739160 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomBlackBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomBlackDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class FillRoomBlackBasicRule extends BasicRule {
-
- public FillRoomBlackBasicRule() {
- super("HEYA-BASC-0003",
- "Fill Room Black",
- "",
- "edu/rpi/legup/images/heyawake/rules/FillRoomBlack.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.heyawake.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 FillRoomBlackDirectRule extends DirectRule {
+
+ public FillRoomBlackDirectRule() {
+ super("HEYA-BASC-0003",
+ "Fill Room Black",
+ "",
+ "edu/rpi/legup/images/heyawake/rules/FillRoomBlack.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/heyawake/rules/FillRoomWhiteBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomWhiteDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomWhiteBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomWhiteDirectRule.java
index cbfb3ad06..6b1a11c29 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomWhiteBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/FillRoomWhiteDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class FillRoomWhiteBasicRule extends BasicRule {
-
- public FillRoomWhiteBasicRule() {
- super("HEYA-BASC-0004",
- "Fill Room White",
- "",
- "edu/rpi/legup/images/heyawake/rules/FillRoomWhite.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.heyawake.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 FillRoomWhiteDirectRule extends DirectRule {
+
+ public FillRoomWhiteDirectRule() {
+ super("HEYA-BASC-0004",
+ "Fill Room White",
+ "",
+ "edu/rpi/legup/images/heyawake/rules/FillRoomWhite.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/heyawake/rules/BlackPathBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/OneRowDirectRule.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BlackPathBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/OneRowDirectRule.java
index 8b214a648..3e8c07a4d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/BlackPathBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/OneRowDirectRule.java
@@ -1,7 +1,7 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class BlackPathBasicRule {
- public BlackPathBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class OneRowDirectRule {
+ public OneRowDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineDirectRule.java
new file mode 100644
index 000000000..0efd90694
--- /dev/null
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineDirectRule.java
@@ -0,0 +1,7 @@
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class PreventWhiteLineDirectRule {
+ public PreventWhiteLineDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ThreeByThreeDirectRule.java
similarity index 60%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ThreeByThreeDirectRule.java
index 58e1f31b7..6dee3fc83 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/PreventWhiteLineBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ThreeByThreeDirectRule.java
@@ -1,7 +1,7 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class PreventWhiteLineBasicRule {
- public PreventWhiteLineBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class ThreeByThreeDirectRule {
+ public ThreeByThreeDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerBasicRule.java
deleted file mode 100644
index 2746d3cce..000000000
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerBasicRule.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class TwoInCornerBasicRule {
- public TwoInCornerBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ThreeByThreeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerDirectRule.java
similarity index 61%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ThreeByThreeBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerDirectRule.java
index 9560b411a..8e2776fc7 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ThreeByThreeBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/TwoInCornerDirectRule.java
@@ -1,7 +1,7 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class ThreeByThreeBasicRule {
- public ThreeByThreeBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class TwoInCornerDirectRule {
+ public TwoInCornerDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteAroundBlackBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteAroundBlackDirectRule.java
similarity index 87%
rename from src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteAroundBlackBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteAroundBlackDirectRule.java
index 2b99baab5..21a698d41 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteAroundBlackBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteAroundBlackDirectRule.java
@@ -1,43 +1,43 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class WhiteAroundBlackBasicRule extends BasicRule {
-
- public WhiteAroundBlackBasicRule() {
- super("HEYA-BASC-0009",
- "White Around Black",
- "",
- "edu/rpi/legup/images/heyawake/rules/WhiteAroundBlack.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.heyawake.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 WhiteAroundBlackDirectRule extends DirectRule {
+
+ public WhiteAroundBlackDirectRule() {
+ super("HEYA-BASC-0009",
+ "White Around Black",
+ "",
+ "edu/rpi/legup/images/heyawake/rules/WhiteAroundBlack.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/heyawake/rules/WhiteEscapeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeBasicRule.java
deleted file mode 100644
index 1232f79e3..000000000
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeBasicRule.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class WhiteEscapeBasicRule {
- public WhiteEscapeBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeDirectRule.java
new file mode 100644
index 000000000..231d353e6
--- /dev/null
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/WhiteEscapeDirectRule.java
@@ -0,0 +1,7 @@
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class WhiteEscapeDirectRule {
+ public WhiteEscapeDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteBasicRule.java
deleted file mode 100644
index 235a9029d..000000000
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteBasicRule.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package edu.rpi.legup.puzzle.heyawake.rules;
-
-public class ZigZagWhiteBasicRule {
- public ZigZagWhiteBasicRule() {
- throw new RuntimeException("This rule has not been implemented");
- }
-}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteDirectRule.java
new file mode 100644
index 000000000..22a76b9a9
--- /dev/null
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/ZigZagWhiteDirectRule.java
@@ -0,0 +1,7 @@
+package edu.rpi.legup.puzzle.heyawake.rules;
+
+public class ZigZagWhiteDirectRule {
+ public ZigZagWhiteDirectRule() {
+ throw new RuntimeException("This rule has not been implemented");
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/heyawake_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/heyawake_reference_sheet.txt
index 5e05fbf56..f396dff0e 100644
--- a/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/heyawake_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/heyawake/rules/heyawake_reference_sheet.txt
@@ -1,14 +1,14 @@
-HEYA-BASC-0001 : BlackPathBasicRule
-HEYA-BASC-0002 : BottleNeckBasicRule
-HEYA-BASC-0003 : FillRoomBlackBasicRule
-HEYA-BASC-0004 : FillRoomWhiteBasicRule
-HEYA-BASC-0005 : OneRowBasicRule
-HEYA-BASC-0006 : PreventWhiteLineBasicRule
-HEYA-BASC-0007 : ThreeByThreeBasicRule
-HEYA-BASC-0008 : TwoInCornerBasicRule
-HEYA-BASC-0009 : WhiteAroundBlackBasicRule
-HEYA-BASC-0010 : WhiteEscapeBasicRule
-HEYA-BASC-0011 : ZigZagWhiteBasicRule
+HEYA-BASC-0001 : BlackPathDirectRule
+HEYA-BASC-0002 : BottleNeckDirectRule
+HEYA-BASC-0003 : FillRoomBlackDirectRule
+HEYA-BASC-0004 : FillRoomWhiteDirectRule
+HEYA-BASC-0005 : OneRowDirectRule
+HEYA-BASC-0006 : PreventWhiteLineDirectRule
+HEYA-BASC-0007 : ThreeByThreeDirectRule
+HEYA-BASC-0008 : TwoInCornerDirectRule
+HEYA-BASC-0009 : WhiteAroundBlackDirectRule
+HEYA-BASC-0010 : WhiteEscapeDirectRule
+HEYA-BASC-0011 : ZigZagWhiteDirectRule
HEYA-CONT-0001 : AdjacentBlacksContradictionRule
HEYA-CONT-0002 : RoomTooEmptyContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCellinLightBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCellinLightDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCellinLightBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCellinLightDirectRule.java
index 68d69165a..a40ede284 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCellinLightBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCellinLightDirectRule.java
@@ -1,64 +1,64 @@
-package edu.rpi.legup.puzzle.lightup.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.lightup.LightUpBoard;
-import edu.rpi.legup.puzzle.lightup.LightUpCell;
-import edu.rpi.legup.puzzle.lightup.LightUpCellType;
-
-public class EmptyCellinLightBasicRule extends BasicRule {
-
- public EmptyCellinLightBasicRule() {
- super("LTUP-BASC-0002", "Empty Cells in Light",
- "Cells in light must be empty.",
- "edu/rpi/legup/images/lightup/rules/EmptyCellInLight.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 index of the 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) {
- LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
- initialBoard.fillWithLight();
- LightUpCell initCell = (LightUpCell) initialBoard.getPuzzleElement(puzzleElement);
- LightUpCell finalCell = (LightUpCell) transition.getBoard().getPuzzleElement(puzzleElement);
- if (finalCell.getType() == LightUpCellType.EMPTY && initCell.getType() == LightUpCellType.UNKNOWN && initCell.isLite()) {
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + ": Cell is not forced to be empty";
- }
-
- /**
- * 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) {
- LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- LightUpCell cell = (LightUpCell) element;
- if (cell.getType() == LightUpCellType.UNKNOWN && cell.isLite()) {
- cell.setData(LightUpCellType.EMPTY.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.lightup.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.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
+
+public class EmptyCellinLightDirectRule extends DirectRule {
+
+ public EmptyCellinLightDirectRule() {
+ super("LTUP-BASC-0002", "Empty Cells in Light",
+ "Cells in light must be empty.",
+ "edu/rpi/legup/images/lightup/rules/EmptyCellInLight.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 index of the 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) {
+ LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
+ initialBoard.fillWithLight();
+ LightUpCell initCell = (LightUpCell) initialBoard.getPuzzleElement(puzzleElement);
+ LightUpCell finalCell = (LightUpCell) transition.getBoard().getPuzzleElement(puzzleElement);
+ if (finalCell.getType() == LightUpCellType.EMPTY && initCell.getType() == LightUpCellType.UNKNOWN && initCell.isLite()) {
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + ": Cell is not forced to be empty";
+ }
+
+ /**
+ * 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) {
+ LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ LightUpCell cell = (LightUpCell) element;
+ if (cell.getType() == LightUpCellType.UNKNOWN && cell.isLite()) {
+ cell.setData(LightUpCellType.EMPTY.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCornersBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCornersDirectRule.java
similarity index 95%
rename from src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCornersBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCornersDirectRule.java
index 6c11d5140..04c493f08 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCornersBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/EmptyCornersDirectRule.java
@@ -1,115 +1,115 @@
-package edu.rpi.legup.puzzle.lightup.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.lightup.LightUpBoard;
-import edu.rpi.legup.puzzle.lightup.LightUpCell;
-import edu.rpi.legup.puzzle.lightup.LightUpCellType;
-
-import java.awt.*;
-import java.util.ArrayList;
-import java.util.List;
-
-public class EmptyCornersBasicRule extends BasicRule {
-
- public EmptyCornersBasicRule() {
- super("LTUP-BASC-0003", "Empty Corners",
- "Cells on the corners of a number must be empty if placing bulbs would prevent the number from being satisfied.",
- "edu/rpi/legup/images/lightup/rules/EmptyCorners.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 index of the 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) {
- LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
- LightUpCell cell = (LightUpCell) initialBoard.getPuzzleElement(puzzleElement);
- LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
- LightUpCell finalCell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
-
- if (!(cell.getType() == LightUpCellType.UNKNOWN && finalCell.getType() == LightUpCellType.EMPTY)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be an empty cell";
- }
-
- Point loc = finalCell.getLocation();
- List numberedCells = new ArrayList<>();
- LightUpCell upperRight = finalBoard.getCell(loc.x + 1, loc.y - 1);
- if (upperRight != null && upperRight.getType() == LightUpCellType.NUMBER) {
- numberedCells.add(upperRight);
- }
- LightUpCell upperLeft = finalBoard.getCell(loc.x - 1, loc.y - 1);
- if (upperLeft != null && upperLeft.getType() == LightUpCellType.NUMBER) {
- numberedCells.add(upperLeft);
- }
- LightUpCell lowerRight = finalBoard.getCell(loc.x + 1, loc.y + 1);
- if (lowerRight != null && lowerRight.getType() == LightUpCellType.NUMBER) {
- numberedCells.add(lowerRight);
- }
- LightUpCell lowerLeft = finalBoard.getCell(loc.x - 1, loc.y + 1);
- if (lowerLeft != null && lowerLeft.getType() == LightUpCellType.NUMBER) {
- numberedCells.add(lowerLeft);
- }
- if (numberedCells.isEmpty()) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must diagonal to a numbered cell";
- }
-
- TooFewBulbsContradictionRule tooFew = new TooFewBulbsContradictionRule();
- LightUpBoard bulbCaseBoard = finalBoard.copy();
- LightUpCell bulbCaseCell = (LightUpCell) bulbCaseBoard.getPuzzleElement(puzzleElement);
- bulbCaseCell.setData(LightUpCellType.BULB.value);
- bulbCaseBoard.fillWithLight();
-
- boolean createsContra = false;
- for (LightUpCell c : numberedCells) {
- createsContra |= tooFew.checkContradictionAt(bulbCaseBoard, c) == null;
- }
- if (createsContra) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be empty";
- }
- }
-
- /**
- * 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) {
- LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
- LightUpBoard lightUpBoardCopy = (LightUpBoard) node.getBoard().copy();
- TreeTransition transition = new TreeTransition(node, lightUpBoardCopy);
- for (PuzzleElement element : lightUpBoardCopy.getPuzzleElements()) {
- LightUpCell cell = (LightUpCell) element;
- int temp = cell.getData();
- cell.setData(LightUpCellType.EMPTY.value);
- if (checkRuleRawAt(transition, cell) == null) {
- LightUpCell modCell = (LightUpCell) lightUpBoard.getPuzzleElement(cell);
- modCell.setData(LightUpCellType.EMPTY.value);
- lightUpBoard.addModifiedData(modCell);
- }
- else {
- cell.setData(temp);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.lightup.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.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class EmptyCornersDirectRule extends DirectRule {
+
+ public EmptyCornersDirectRule() {
+ super("LTUP-BASC-0003", "Empty Corners",
+ "Cells on the corners of a number must be empty if placing bulbs would prevent the number from being satisfied.",
+ "edu/rpi/legup/images/lightup/rules/EmptyCorners.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 index of the 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) {
+ LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
+ LightUpCell cell = (LightUpCell) initialBoard.getPuzzleElement(puzzleElement);
+ LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
+ LightUpCell finalCell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
+
+ if (!(cell.getType() == LightUpCellType.UNKNOWN && finalCell.getType() == LightUpCellType.EMPTY)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be an empty cell";
+ }
+
+ Point loc = finalCell.getLocation();
+ List numberedCells = new ArrayList<>();
+ LightUpCell upperRight = finalBoard.getCell(loc.x + 1, loc.y - 1);
+ if (upperRight != null && upperRight.getType() == LightUpCellType.NUMBER) {
+ numberedCells.add(upperRight);
+ }
+ LightUpCell upperLeft = finalBoard.getCell(loc.x - 1, loc.y - 1);
+ if (upperLeft != null && upperLeft.getType() == LightUpCellType.NUMBER) {
+ numberedCells.add(upperLeft);
+ }
+ LightUpCell lowerRight = finalBoard.getCell(loc.x + 1, loc.y + 1);
+ if (lowerRight != null && lowerRight.getType() == LightUpCellType.NUMBER) {
+ numberedCells.add(lowerRight);
+ }
+ LightUpCell lowerLeft = finalBoard.getCell(loc.x - 1, loc.y + 1);
+ if (lowerLeft != null && lowerLeft.getType() == LightUpCellType.NUMBER) {
+ numberedCells.add(lowerLeft);
+ }
+ if (numberedCells.isEmpty()) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must diagonal to a numbered cell";
+ }
+
+ TooFewBulbsContradictionRule tooFew = new TooFewBulbsContradictionRule();
+ LightUpBoard bulbCaseBoard = finalBoard.copy();
+ LightUpCell bulbCaseCell = (LightUpCell) bulbCaseBoard.getPuzzleElement(puzzleElement);
+ bulbCaseCell.setData(LightUpCellType.BULB.value);
+ bulbCaseBoard.fillWithLight();
+
+ boolean createsContra = false;
+ for (LightUpCell c : numberedCells) {
+ createsContra |= tooFew.checkContradictionAt(bulbCaseBoard, c) == null;
+ }
+ if (createsContra) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be empty";
+ }
+ }
+
+ /**
+ * 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) {
+ LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
+ LightUpBoard lightUpBoardCopy = (LightUpBoard) node.getBoard().copy();
+ TreeTransition transition = new TreeTransition(node, lightUpBoardCopy);
+ for (PuzzleElement element : lightUpBoardCopy.getPuzzleElements()) {
+ LightUpCell cell = (LightUpCell) element;
+ int temp = cell.getData();
+ cell.setData(LightUpCellType.EMPTY.value);
+ if (checkRuleRawAt(transition, cell) == null) {
+ LightUpCell modCell = (LightUpCell) lightUpBoard.getPuzzleElement(cell);
+ modCell.setData(LightUpCellType.EMPTY.value);
+ lightUpBoard.addModifiedData(modCell);
+ }
+ else {
+ cell.setData(temp);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithBulbsBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithBulbsDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithBulbsBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithBulbsDirectRule.java
index 63e5b5897..40707d388 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithBulbsBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithBulbsDirectRule.java
@@ -1,106 +1,106 @@
-package edu.rpi.legup.puzzle.lightup.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.lightup.LightUpBoard;
-import edu.rpi.legup.puzzle.lightup.LightUpCell;
-import edu.rpi.legup.puzzle.lightup.LightUpCellType;
-
-import java.util.Set;
-
-public class FinishWithBulbsBasicRule extends BasicRule {
-
- public FinishWithBulbsBasicRule() {
- super("LTUP-BASC-0004", "Finish with Bulbs",
- "The remaining unknowns around a block must be bulbs to satisfy the number.",
- "edu/rpi/legup/images/lightup/rules/FinishWithBulbs.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 index of the 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) {
- LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
- LightUpCell initCell = (LightUpCell) initialBoard.getPuzzleElement(puzzleElement);
- LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
- LightUpCell finalCell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == LightUpCellType.UNKNOWN && finalCell.getType() == LightUpCellType.BULB)) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must be bulbs";
- }
-
- Set adjCells = finalBoard.getAdj(finalCell);
- adjCells.removeIf(cell -> cell.getType() != LightUpCellType.NUMBER);
- if (adjCells.isEmpty()) {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not adjacent to a numbered cell";
- }
-
- LightUpBoard emptyCase = initialBoard.copy();
- emptyCase.getPuzzleElement(finalCell).setData(LightUpCellType.EMPTY.value);
- TooFewBulbsContradictionRule tooFew = new TooFewBulbsContradictionRule();
- for (LightUpCell c : adjCells) {
- if (tooFew.checkContradictionAt(emptyCase, c) == null) {
- return null;
- }
- }
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be a bulb";
- }
-
- /**
- * Determines whether the specified cell is forced to be a bulb or not
- * @param board the entire board
- * @param cell specified cell
- * @return whether cell is forced to be a bulb or not
- */
- private boolean isForced(LightUpBoard board, LightUpCell cell) {
- Set adjCells = board.getAdj(cell);
- adjCells.removeIf(c -> c.getType() != LightUpCellType.NUMBER);
- if (adjCells.isEmpty()) {
- return false;
- }
-
- LightUpBoard emptyCase = board.copy();
- emptyCase.getPuzzleElement(cell).setData(LightUpCellType.EMPTY.value);
- TooFewBulbsContradictionRule tooFew = new TooFewBulbsContradictionRule();
- for (LightUpCell c : adjCells) {
- if (tooFew.checkContradictionAt(emptyCase, c) == null) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * 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) {
- LightUpBoard initialBoard = (LightUpBoard) node.getBoard();
- LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- LightUpCell cell = (LightUpCell) element;
- if (cell.getType() == LightUpCellType.UNKNOWN && isForced(initialBoard, cell)) {
- cell.setData(LightUpCellType.BULB.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.lightup.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.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
+
+import java.util.Set;
+
+public class FinishWithBulbsDirectRule extends DirectRule {
+
+ public FinishWithBulbsDirectRule() {
+ super("LTUP-BASC-0004", "Finish with Bulbs",
+ "The remaining unknowns around a block must be bulbs to satisfy the number.",
+ "edu/rpi/legup/images/lightup/rules/FinishWithBulbs.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 index of the 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) {
+ LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
+ LightUpCell initCell = (LightUpCell) initialBoard.getPuzzleElement(puzzleElement);
+ LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
+ LightUpCell finalCell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == LightUpCellType.UNKNOWN && finalCell.getType() == LightUpCellType.BULB)) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must be bulbs";
+ }
+
+ Set adjCells = finalBoard.getAdj(finalCell);
+ adjCells.removeIf(cell -> cell.getType() != LightUpCellType.NUMBER);
+ if (adjCells.isEmpty()) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not adjacent to a numbered cell";
+ }
+
+ LightUpBoard emptyCase = initialBoard.copy();
+ emptyCase.getPuzzleElement(finalCell).setData(LightUpCellType.EMPTY.value);
+ TooFewBulbsContradictionRule tooFew = new TooFewBulbsContradictionRule();
+ for (LightUpCell c : adjCells) {
+ if (tooFew.checkContradictionAt(emptyCase, c) == null) {
+ return null;
+ }
+ }
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be a bulb";
+ }
+
+ /**
+ * Determines whether the specified cell is forced to be a bulb or not
+ * @param board the entire board
+ * @param cell specified cell
+ * @return whether cell is forced to be a bulb or not
+ */
+ private boolean isForced(LightUpBoard board, LightUpCell cell) {
+ Set adjCells = board.getAdj(cell);
+ adjCells.removeIf(c -> c.getType() != LightUpCellType.NUMBER);
+ if (adjCells.isEmpty()) {
+ return false;
+ }
+
+ LightUpBoard emptyCase = board.copy();
+ emptyCase.getPuzzleElement(cell).setData(LightUpCellType.EMPTY.value);
+ TooFewBulbsContradictionRule tooFew = new TooFewBulbsContradictionRule();
+ for (LightUpCell c : adjCells) {
+ if (tooFew.checkContradictionAt(emptyCase, c) == null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ LightUpBoard initialBoard = (LightUpBoard) node.getBoard();
+ LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ LightUpCell cell = (LightUpCell) element;
+ if (cell.getType() == LightUpCellType.UNKNOWN && isForced(initialBoard, cell)) {
+ cell.setData(LightUpCellType.BULB.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithEmptyBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithEmptyDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithEmptyBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithEmptyDirectRule.java
index 76ff7bf35..65cbd17e4 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithEmptyBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/FinishWithEmptyDirectRule.java
@@ -1,116 +1,116 @@
-package edu.rpi.legup.puzzle.lightup.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.lightup.LightUpBoard;
-import edu.rpi.legup.puzzle.lightup.LightUpCell;
-import edu.rpi.legup.puzzle.lightup.LightUpCellType;
-
-import java.awt.*;
-
-public class FinishWithEmptyBasicRule extends BasicRule {
-
- public FinishWithEmptyBasicRule() {
- super("LTUP-BASC-0005", "Finish with Empty",
- "The remaining unknowns around a block must be empty if the number is satisfied.",
- "edu/rpi/legup/images/lightup/rules/FinishWithEmpty.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 index of the 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) {
- LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
- LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
- LightUpCell cell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
- if (cell.getType() != LightUpCellType.EMPTY) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must be empty";
- }
-
- if (isForced(initialBoard, cell.getLocation())) {
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + ": Empty is not forced";
- }
-
- /**
- * Checks whether a certain cell is forced to not be a bulb
- * @param board specified board
- * @param location location of cell to check
- * @return boolean value based on whether a certain cell has an adjacent cell that has the required amount of adjacent bulbs
- */
- private boolean isForced(LightUpBoard board, Point location) {
- return isForcedEmpty(board, new Point(location.x + 1, location.y)) ||
- isForcedEmpty(board, new Point(location.x, location.y + 1)) ||
- isForcedEmpty(board, new Point(location.x - 1, location.y)) ||
- isForcedEmpty(board, new Point(location.x, location.y - 1));
- }
-
- /**
- * Checks whether a certain cell has the required amount of adjacent bulbs
- * @param board specified board
- * @param loc location of cell to check
- * @return boolean value based on whether a certain cell has the required amount of adjacent bulbs
- */
- private boolean isForcedEmpty(LightUpBoard board, Point loc) {
- LightUpCell cell = board.getCell(loc.x, loc.y);
- if (cell == null || cell.getType() != LightUpCellType.NUMBER) {
- return false;
- }
-
- int bulbs = 0;
- int bulbsNeeded = cell.getData();
- cell = board.getCell(loc.x + 1, loc.y);
- if (cell != null && cell.getType() == LightUpCellType.BULB) {
- bulbs++;
- }
- cell = board.getCell(loc.x, loc.y + 1);
- if (cell != null && cell.getType() == LightUpCellType.BULB) {
- bulbs++;
- }
- cell = board.getCell(loc.x - 1, loc.y);
- if (cell != null && cell.getType() == LightUpCellType.BULB) {
- bulbs++;
- }
- cell = board.getCell(loc.x, loc.y - 1);
- if (cell != null && cell.getType() == LightUpCellType.BULB) {
- bulbs++;
- }
- return bulbs == bulbsNeeded;
- }
-
- /**
- * 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) {
- LightUpBoard initialBoard = (LightUpBoard) node.getBoard();
- LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- LightUpCell cell = (LightUpCell) element;
- if (cell.getType() == LightUpCellType.UNKNOWN && isForced(initialBoard, cell.getLocation())) {
- cell.setData(LightUpCellType.EMPTY.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.lightup.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.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
+
+import java.awt.*;
+
+public class FinishWithEmptyDirectRule extends DirectRule {
+
+ public FinishWithEmptyDirectRule() {
+ super("LTUP-BASC-0005", "Finish with Empty",
+ "The remaining unknowns around a block must be empty if the number is satisfied.",
+ "edu/rpi/legup/images/lightup/rules/FinishWithEmpty.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 index of the 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) {
+ LightUpBoard initialBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
+ LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
+ LightUpCell cell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (cell.getType() != LightUpCellType.EMPTY) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must be empty";
+ }
+
+ if (isForced(initialBoard, cell.getLocation())) {
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + ": Empty is not forced";
+ }
+
+ /**
+ * Checks whether a certain cell is forced to not be a bulb
+ * @param board specified board
+ * @param location location of cell to check
+ * @return boolean value based on whether a certain cell has an adjacent cell that has the required amount of adjacent bulbs
+ */
+ private boolean isForced(LightUpBoard board, Point location) {
+ return isForcedEmpty(board, new Point(location.x + 1, location.y)) ||
+ isForcedEmpty(board, new Point(location.x, location.y + 1)) ||
+ isForcedEmpty(board, new Point(location.x - 1, location.y)) ||
+ isForcedEmpty(board, new Point(location.x, location.y - 1));
+ }
+
+ /**
+ * Checks whether a certain cell has the required amount of adjacent bulbs
+ * @param board specified board
+ * @param loc location of cell to check
+ * @return boolean value based on whether a certain cell has the required amount of adjacent bulbs
+ */
+ private boolean isForcedEmpty(LightUpBoard board, Point loc) {
+ LightUpCell cell = board.getCell(loc.x, loc.y);
+ if (cell == null || cell.getType() != LightUpCellType.NUMBER) {
+ return false;
+ }
+
+ int bulbs = 0;
+ int bulbsNeeded = cell.getData();
+ cell = board.getCell(loc.x + 1, loc.y);
+ if (cell != null && cell.getType() == LightUpCellType.BULB) {
+ bulbs++;
+ }
+ cell = board.getCell(loc.x, loc.y + 1);
+ if (cell != null && cell.getType() == LightUpCellType.BULB) {
+ bulbs++;
+ }
+ cell = board.getCell(loc.x - 1, loc.y);
+ if (cell != null && cell.getType() == LightUpCellType.BULB) {
+ bulbs++;
+ }
+ cell = board.getCell(loc.x, loc.y - 1);
+ if (cell != null && cell.getType() == LightUpCellType.BULB) {
+ bulbs++;
+ }
+ return bulbs == bulbsNeeded;
+ }
+
+ /**
+ * 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) {
+ LightUpBoard initialBoard = (LightUpBoard) node.getBoard();
+ LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ LightUpCell cell = (LightUpCell) element;
+ if (cell.getType() == LightUpCellType.UNKNOWN && isForced(initialBoard, cell.getLocation())) {
+ cell.setData(LightUpCellType.EMPTY.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/MustLightBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/MustLightDirectRule.java
similarity index 95%
rename from src/main/java/edu/rpi/legup/puzzle/lightup/rules/MustLightBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/lightup/rules/MustLightDirectRule.java
index 6efaadd41..a03d653a9 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/MustLightBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/MustLightDirectRule.java
@@ -1,149 +1,149 @@
-package edu.rpi.legup.puzzle.lightup.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.lightup.LightUpBoard;
-import edu.rpi.legup.puzzle.lightup.LightUpCell;
-import edu.rpi.legup.puzzle.lightup.LightUpCellType;
-
-import java.awt.*;
-
-public class MustLightBasicRule extends BasicRule {
-
- public MustLightBasicRule() {
- super("LTUP-BASC-0006", "Must Light",
- "A cell must be a bulb if it is the only cell to be able to light another.",
- "edu/rpi/legup/images/lightup/rules/MustLight.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 index of the 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) {
- LightUpBoard parentBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
- LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
- LightUpCell parentCell = (LightUpCell) parentBoard.getPuzzleElement(puzzleElement);
- LightUpCell finalCell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(parentCell.getType() == LightUpCellType.UNKNOWN && !parentCell.isLite() && finalCell.getType() == LightUpCellType.BULB)) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must be bulbs";
- }
-
- finalBoard.fillWithLight();
- boolean isForced = isForcedBulb(parentBoard, parentCell.getLocation());
- finalCell.setData(LightUpCellType.BULB.value);
- finalBoard.fillWithLight();
-
- if (isForced) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell can be lit by another cell";
- }
- }
-
- private boolean isForcedBulb(LightUpBoard board, Point loc) {
- CannotLightACellContradictionRule cannotLite = new CannotLightACellContradictionRule();
- LightUpBoard modifiedBoard = board.copy();
- LightUpCell modifiedCell = modifiedBoard.getCell(loc.x, loc.y);
- modifiedCell.setData(LightUpCellType.EMPTY.value);
- //Check if this cell itself (the one with the bulb) has no other lighting option
- if ((modifiedCell.getType() == LightUpCellType.EMPTY || modifiedCell.getType() == LightUpCellType.UNKNOWN) &&
- !modifiedCell.isLite() && cannotLite.checkContradictionAt(modifiedBoard, modifiedCell) == null) {
- return true;
- }
- //Look right
- for (int i = loc.x + 1; i < modifiedBoard.getWidth(); i++) {
- LightUpCell c = modifiedBoard.getCell(i, loc.y);
- if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
- break;
- }
- else {
- if (c.getType() == LightUpCellType.EMPTY &&
- !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
- return true;
- }
- }
- }
- //Look left
- for (int i = loc.x - 1; i >= 0; i--) {
- LightUpCell c = modifiedBoard.getCell(i, loc.y);
- if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
- break;
- }
- else {
- if (c.getType() == LightUpCellType.EMPTY &&
- !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
- return true;
- }
- }
- }
- //Look down
- for (int i = loc.y + 1; i < modifiedBoard.getHeight(); i++) {
- LightUpCell c = modifiedBoard.getCell(loc.x, i);
- if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
- break;
- }
- else {
- if (c.getType() == LightUpCellType.EMPTY &&
- !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
- return true;
- }
- }
- }
- //Look up
- for (int i = loc.y - 1; i >= 0; i--) {
- LightUpCell c = modifiedBoard.getCell(loc.x, i);
- if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
- break;
- }
- else {
- if (c.getType() == LightUpCellType.EMPTY &&
- !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * 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) {
- LightUpBoard initialBoard = (LightUpBoard) node.getBoard();
- LightUpBoard tempBoard = (LightUpBoard) node.getBoard().copy();
- LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
- for (PuzzleElement element : tempBoard.getPuzzleElements()) {
- LightUpCell cell = (LightUpCell) element;
- if (cell.getType() == LightUpCellType.UNKNOWN && !cell.isLite()) {
- cell.setData(LightUpCellType.EMPTY.value);
- if (isForcedBulb(initialBoard, cell.getLocation())) {
- LightUpCell modCell = (LightUpCell) lightUpBoard.getPuzzleElement(cell);
- modCell.setData(LightUpCellType.BULB.value);
- lightUpBoard.addModifiedData(modCell);
- }
- cell.setData(LightUpCellType.UNKNOWN.value);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.lightup.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.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
+
+import java.awt.*;
+
+public class MustLightDirectRule extends DirectRule {
+
+ public MustLightDirectRule() {
+ super("LTUP-BASC-0006", "Must Light",
+ "A cell must be a bulb if it is the only cell to be able to light another.",
+ "edu/rpi/legup/images/lightup/rules/MustLight.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 index of the 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) {
+ LightUpBoard parentBoard = (LightUpBoard) transition.getParents().get(0).getBoard();
+ LightUpBoard finalBoard = (LightUpBoard) transition.getBoard();
+ LightUpCell parentCell = (LightUpCell) parentBoard.getPuzzleElement(puzzleElement);
+ LightUpCell finalCell = (LightUpCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(parentCell.getType() == LightUpCellType.UNKNOWN && !parentCell.isLite() && finalCell.getType() == LightUpCellType.BULB)) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must be bulbs";
+ }
+
+ finalBoard.fillWithLight();
+ boolean isForced = isForcedBulb(parentBoard, parentCell.getLocation());
+ finalCell.setData(LightUpCellType.BULB.value);
+ finalBoard.fillWithLight();
+
+ if (isForced) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell can be lit by another cell";
+ }
+ }
+
+ private boolean isForcedBulb(LightUpBoard board, Point loc) {
+ CannotLightACellContradictionRule cannotLite = new CannotLightACellContradictionRule();
+ LightUpBoard modifiedBoard = board.copy();
+ LightUpCell modifiedCell = modifiedBoard.getCell(loc.x, loc.y);
+ modifiedCell.setData(LightUpCellType.EMPTY.value);
+ //Check if this cell itself (the one with the bulb) has no other lighting option
+ if ((modifiedCell.getType() == LightUpCellType.EMPTY || modifiedCell.getType() == LightUpCellType.UNKNOWN) &&
+ !modifiedCell.isLite() && cannotLite.checkContradictionAt(modifiedBoard, modifiedCell) == null) {
+ return true;
+ }
+ //Look right
+ for (int i = loc.x + 1; i < modifiedBoard.getWidth(); i++) {
+ LightUpCell c = modifiedBoard.getCell(i, loc.y);
+ if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
+ break;
+ }
+ else {
+ if (c.getType() == LightUpCellType.EMPTY &&
+ !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
+ return true;
+ }
+ }
+ }
+ //Look left
+ for (int i = loc.x - 1; i >= 0; i--) {
+ LightUpCell c = modifiedBoard.getCell(i, loc.y);
+ if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
+ break;
+ }
+ else {
+ if (c.getType() == LightUpCellType.EMPTY &&
+ !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
+ return true;
+ }
+ }
+ }
+ //Look down
+ for (int i = loc.y + 1; i < modifiedBoard.getHeight(); i++) {
+ LightUpCell c = modifiedBoard.getCell(loc.x, i);
+ if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
+ break;
+ }
+ else {
+ if (c.getType() == LightUpCellType.EMPTY &&
+ !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
+ return true;
+ }
+ }
+ }
+ //Look up
+ for (int i = loc.y - 1; i >= 0; i--) {
+ LightUpCell c = modifiedBoard.getCell(loc.x, i);
+ if (c.getType() == LightUpCellType.BLACK || c.getType() == LightUpCellType.NUMBER) {
+ break;
+ }
+ else {
+ if (c.getType() == LightUpCellType.EMPTY &&
+ !c.isLite() && cannotLite.checkContradictionAt(modifiedBoard, c) == null) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ LightUpBoard initialBoard = (LightUpBoard) node.getBoard();
+ LightUpBoard tempBoard = (LightUpBoard) node.getBoard().copy();
+ LightUpBoard lightUpBoard = (LightUpBoard) node.getBoard().copy();
+ for (PuzzleElement element : tempBoard.getPuzzleElements()) {
+ LightUpCell cell = (LightUpCell) element;
+ if (cell.getType() == LightUpCellType.UNKNOWN && !cell.isLite()) {
+ cell.setData(LightUpCellType.EMPTY.value);
+ if (isForcedBulb(initialBoard, cell.getLocation())) {
+ LightUpCell modCell = (LightUpCell) lightUpBoard.getPuzzleElement(cell);
+ modCell.setData(LightUpCellType.BULB.value);
+ lightUpBoard.addModifiedData(modCell);
+ }
+ cell.setData(LightUpCellType.UNKNOWN.value);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/lightup_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/lightup_reference_sheet.txt
index 81929bfe9..86435d76b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/rules/lightup_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/rules/lightup_reference_sheet.txt
@@ -1,8 +1,8 @@
-LTUP-BASC-0001 : EmptyCellInLightBasicRule
-LTUP-BASC-0002 : EmptyCornersBasicRule
-LTUP-BASC-0003 : FinishWithBulbsBasicRule
-LTUP-BASC-0004 : FinishWithEmptyBasicRule
-LTUP-BASC-0005 : MustLightBasicRule
+LTUP-BASC-0001 : EmptyCellInLightDirectRule
+LTUP-BASC-0002 : EmptyCornersDirectRule
+LTUP-BASC-0003 : FinishWithBulbsDirectRule
+LTUP-BASC-0004 : FinishWithEmptyDirectRule
+LTUP-BASC-0005 : MustLightDirectRule
LTUP-CONT-0001 : BulbsInPathContradictionRule
LTUP-CONT-0002 : CannotLightACellContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlackEdgeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlackEdgeDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlackEdgeBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlackEdgeDirectRule.java
index 761cec8d8..b35dceaa7 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlackEdgeBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlackEdgeDirectRule.java
@@ -1,42 +1,42 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class BlackEdgeBasicRule extends BasicRule {
-
- public BlackEdgeBasicRule() {
- super("MASY-BASC-0001", "Black Edge",
- "",
- "edu/rpi/legup/images/masyu/RuleBlackEdge.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 BlackEdgeDirectRule extends DirectRule {
+
+ public BlackEdgeDirectRule() {
+ super("MASY-BASC-0001", "Black Edge",
+ "",
+ "edu/rpi/legup/images/masyu/RuleBlackEdge.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/BlockedBlackBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlockedBlackDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlockedBlackBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlockedBlackDirectRule.java
index fece691cb..4364d016c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlockedBlackBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/BlockedBlackDirectRule.java
@@ -1,42 +1,42 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class BlockedBlackBasicRule extends BasicRule {
-
- public BlockedBlackBasicRule() {
- super("MASY-BASC-0002", "Blocked Black",
- "",
- "edu/rpi/legup/images/masyu/RuleBlockedBlack.gif");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 BlockedBlackDirectRule extends DirectRule {
+
+ public BlockedBlackDirectRule() {
+ super("MASY-BASC-0002", "Blocked Black",
+ "",
+ "edu/rpi/legup/images/masyu/RuleBlockedBlack.gif");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/ConnectedCellsBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/ConnectedCellsDirectRule.java
similarity index 87%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/ConnectedCellsBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/ConnectedCellsDirectRule.java
index b7174c209..49949ecec 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/ConnectedCellsBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/ConnectedCellsDirectRule.java
@@ -1,42 +1,42 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class ConnectedCellsBasicRule extends BasicRule {
-
- public ConnectedCellsBasicRule() {
- super("MASY-BASC-0003", "Connected Cells",
- "",
- "edu/rpi/legup/images/masyu/RuleConnectedCells.gif");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 ConnectedCellsDirectRule extends DirectRule {
+
+ public ConnectedCellsDirectRule() {
+ super("MASY-BASC-0003", "Connected Cells",
+ "",
+ "edu/rpi/legup/images/masyu/RuleConnectedCells.gif");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/FinishPathBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/FinishPathDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/FinishPathBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/FinishPathDirectRule.java
index 3c2a00d4b..e04301ce2 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/FinishPathBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/FinishPathDirectRule.java
@@ -1,42 +1,42 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class FinishPathBasicRule extends BasicRule {
-
- public FinishPathBasicRule() {
- super("MASY-BASC-0004", "Finished Path",
- "",
- "edu/rpi/legup/images/masyu/RuleFinishPath.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 FinishPathDirectRule extends DirectRule {
+
+ public FinishPathDirectRule() {
+ super("MASY-BASC-0004", "Finished Path",
+ "",
+ "edu/rpi/legup/images/masyu/RuleFinishPath.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/NearWhiteBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/NearWhiteDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/NearWhiteBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/NearWhiteDirectRule.java
index e1d2bec67..7cf707d0d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/NearWhiteBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/NearWhiteDirectRule.java
@@ -1,42 +1,42 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class NearWhiteBasicRule extends BasicRule {
-
- public NearWhiteBasicRule() {
- super("MASY-BASC-0005", "Near White",
- "",
- "edu/rpi/legup/images/masyu/RuleNearWhite.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 NearWhiteDirectRule extends DirectRule {
+
+ public NearWhiteDirectRule() {
+ super("MASY-BASC-0005", "Near White",
+ "",
+ "edu/rpi/legup/images/masyu/RuleNearWhite.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/OnlyOneChoiceBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/OnlyOneChoiceDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/OnlyOneChoiceBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/OnlyOneChoiceDirectRule.java
index 6c657e16d..b0311e741 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/OnlyOneChoiceBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/OnlyOneChoiceDirectRule.java
@@ -1,42 +1,42 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class OnlyOneChoiceBasicRule extends BasicRule {
-
- public OnlyOneChoiceBasicRule() {
- super("MASY-BASC-0006", "Only One Choice",
- "",
- "edu/rpi/legup/images/masyu/RuleOnlyOneChoice.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 OnlyOneChoiceDirectRule extends DirectRule {
+
+ public OnlyOneChoiceDirectRule() {
+ super("MASY-BASC-0006", "Only One Choice",
+ "",
+ "edu/rpi/legup/images/masyu/RuleOnlyOneChoice.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/WhiteEdgeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/WhiteEdgeDirectRule.java
similarity index 88%
rename from src/main/java/edu/rpi/legup/puzzle/masyu/rules/WhiteEdgeBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/masyu/rules/WhiteEdgeDirectRule.java
index 3e8731e85..bd894e1d4 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/WhiteEdgeBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/WhiteEdgeDirectRule.java
@@ -1,41 +1,41 @@
-package edu.rpi.legup.puzzle.masyu.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-public class WhiteEdgeBasicRule extends BasicRule {
- public WhiteEdgeBasicRule() {
- super("MASY-BASC-0007", "White Edge",
- "",
- "edu/rpi/legup/images/masyu/RuleWhiteEdge.png");
- }
-
- /**
- * Checks whether the child node logically follows from the parent node
- * at the specific puzzleElement index using this rule
- * This method is the one that should overridden in child classes
- *
- * @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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- 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;
- }
-}
+package edu.rpi.legup.puzzle.masyu.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 WhiteEdgeDirectRule extends DirectRule {
+ public WhiteEdgeDirectRule() {
+ super("MASY-BASC-0007", "White Edge",
+ "",
+ "edu/rpi/legup/images/masyu/RuleWhiteEdge.png");
+ }
+
+ /**
+ * Checks whether the child node logically follows from the parent node
+ * at the specific puzzleElement index using this rule
+ * This method is the one that should overridden in child classes
+ *
+ * @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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ 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/masyu/rules/masyu_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/masyu_reference_sheet.txt
index a55042bcc..e0d2d8355 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/rules/masyu_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/rules/masyu_reference_sheet.txt
@@ -1,10 +1,10 @@
-MASY-BASC-0001 : BlackEdgeBasicRule
-MASY-BASC-0002 : BlockedBlackBasicRule
-MASY-BASC-0003 : ConnectedCellsBasicRule
-MASY-BASC-0004 : FinishPathBasicRule
-MASY-BASC-0005 : NearWhiteBasicRule
-MASY-BASC-0006 : OnlyOneChoiceBasicRule
-MASY-BASC-0007 : WhiteEdgeBasicRule
+MASY-BASC-0001 : BlackEdgeDirectRule
+MASY-BASC-0002 : BlockedBlackDirectRule
+MASY-BASC-0003 : ConnectedCellsDirectRule
+MASY-BASC-0004 : FinishPathDirectRule
+MASY-BASC-0005 : NearWhiteDirectRule
+MASY-BASC-0006 : OnlyOneChoiceDirectRule
+MASY-BASC-0007 : WhiteEdgeDirectRule
MASY-CONT-0001 : BadLoopingContradictionRule
MASY-CONT-0002 : BlackContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBetweenRegionsBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBetweenRegionsDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBetweenRegionsBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBetweenRegionsDirectRule.java
index f6ce61249..bb527e4e2 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBetweenRegionsBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBetweenRegionsDirectRule.java
@@ -1,112 +1,112 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeUtilities;
-import edu.rpi.legup.utility.DisjointSets;
-
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-public class BlackBetweenRegionsBasicRule extends BasicRule {
-
- public BlackBetweenRegionsBasicRule() {
- super("NURI-BASC-0001",
- "Black Between Regions",
- "Any unknowns between two regions must be black.",
- "edu/rpi/legup/images/nurikabe/rules/BetweenRegions.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) {
- Set contras = new LinkedHashSet<>();
- contras.add(new MultipleNumbersContradictionRule());
- contras.add(new TooManySpacesContradictionRule());
-
- NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
-
- NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.BLACK) {
- return super.getInvalidUseOfRuleMessage() + ": Only black cells are allowed for this rule!";
- }
-
- int x = cell.getLocation().x;
- int y = cell.getLocation().y;
-
- DisjointSets regions = NurikabeUtilities.getNurikabeRegions(destBoardState);
- Set adjacentWhiteRegions = new HashSet<>();
- NurikabeCell upCell = destBoardState.getCell(x, y - 1);
- NurikabeCell rightCell = destBoardState.getCell(x + 1, y);
- NurikabeCell downCell = destBoardState.getCell(x, y + 1);
- NurikabeCell leftCell = destBoardState.getCell(x - 1, y);
-
- if (upCell != null && (upCell.getType() == NurikabeType.WHITE || upCell.getType() == NurikabeType.NUMBER)) {
- NurikabeCell repCell = regions.find(upCell);
- if (!adjacentWhiteRegions.contains(repCell)) {
- adjacentWhiteRegions.add(repCell);
- }
- }
- if (rightCell != null && (rightCell.getType() == NurikabeType.WHITE || rightCell.getType() == NurikabeType.NUMBER)) {
- NurikabeCell repCell = regions.find(rightCell);
- if (!adjacentWhiteRegions.contains(repCell)) {
- adjacentWhiteRegions.add(repCell);
- }
- }
- if (downCell != null && (downCell.getType() == NurikabeType.WHITE || downCell.getType() == NurikabeType.NUMBER)) {
- NurikabeCell repCell = regions.find(downCell);
- if (!adjacentWhiteRegions.contains(repCell)) {
- adjacentWhiteRegions.add(repCell);
- }
- }
- if (leftCell != null && (leftCell.getType() == NurikabeType.WHITE || leftCell.getType() == NurikabeType.NUMBER)) {
- NurikabeCell repCell = regions.find(leftCell);
- if (!adjacentWhiteRegions.contains(repCell)) {
- adjacentWhiteRegions.add(repCell);
- }
- }
-
- if (adjacentWhiteRegions.size() < 2) {
- return "The new black cell must separate two white regions for this rule!";
- }
-
- NurikabeBoard modified = origBoardState.copy();
- modified.getCell(x, y).setData(NurikabeType.WHITE.toValue());
-
- for (ContradictionRule c : contras) {
- if (c.checkContradiction(modified) == null) {
- return null;
- }
- }
- return "Does not follow from the rule";
- }
-
- /**
- * 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.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeUtilities;
+import edu.rpi.legup.utility.DisjointSets;
+
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class BlackBetweenRegionsDirectRule extends DirectRule {
+
+ public BlackBetweenRegionsDirectRule() {
+ super("NURI-BASC-0001",
+ "Black Between Regions",
+ "Any unknowns between two regions must be black.",
+ "edu/rpi/legup/images/nurikabe/rules/BetweenRegions.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) {
+ Set contras = new LinkedHashSet<>();
+ contras.add(new MultipleNumbersContradictionRule());
+ contras.add(new TooManySpacesContradictionRule());
+
+ NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
+
+ NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.BLACK) {
+ return super.getInvalidUseOfRuleMessage() + ": Only black cells are allowed for this rule!";
+ }
+
+ int x = cell.getLocation().x;
+ int y = cell.getLocation().y;
+
+ DisjointSets regions = NurikabeUtilities.getNurikabeRegions(destBoardState);
+ Set adjacentWhiteRegions = new HashSet<>();
+ NurikabeCell upCell = destBoardState.getCell(x, y - 1);
+ NurikabeCell rightCell = destBoardState.getCell(x + 1, y);
+ NurikabeCell downCell = destBoardState.getCell(x, y + 1);
+ NurikabeCell leftCell = destBoardState.getCell(x - 1, y);
+
+ if (upCell != null && (upCell.getType() == NurikabeType.WHITE || upCell.getType() == NurikabeType.NUMBER)) {
+ NurikabeCell repCell = regions.find(upCell);
+ if (!adjacentWhiteRegions.contains(repCell)) {
+ adjacentWhiteRegions.add(repCell);
+ }
+ }
+ if (rightCell != null && (rightCell.getType() == NurikabeType.WHITE || rightCell.getType() == NurikabeType.NUMBER)) {
+ NurikabeCell repCell = regions.find(rightCell);
+ if (!adjacentWhiteRegions.contains(repCell)) {
+ adjacentWhiteRegions.add(repCell);
+ }
+ }
+ if (downCell != null && (downCell.getType() == NurikabeType.WHITE || downCell.getType() == NurikabeType.NUMBER)) {
+ NurikabeCell repCell = regions.find(downCell);
+ if (!adjacentWhiteRegions.contains(repCell)) {
+ adjacentWhiteRegions.add(repCell);
+ }
+ }
+ if (leftCell != null && (leftCell.getType() == NurikabeType.WHITE || leftCell.getType() == NurikabeType.NUMBER)) {
+ NurikabeCell repCell = regions.find(leftCell);
+ if (!adjacentWhiteRegions.contains(repCell)) {
+ adjacentWhiteRegions.add(repCell);
+ }
+ }
+
+ if (adjacentWhiteRegions.size() < 2) {
+ return "The new black cell must separate two white regions for this rule!";
+ }
+
+ NurikabeBoard modified = origBoardState.copy();
+ modified.getCell(x, y).setData(NurikabeType.WHITE.toValue());
+
+ for (ContradictionRule c : contras) {
+ if (c.checkContradiction(modified) == null) {
+ return null;
+ }
+ }
+ return "Does not follow from the rule";
+ }
+
+ /**
+ * 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/nurikabe/rules/BlackBottleNeckBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBottleNeckDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBottleNeckBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBottleNeckDirectRule.java
index a483236b8..c4cf0d3fd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBottleNeckBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/BlackBottleNeckDirectRule.java
@@ -1,65 +1,65 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-public class BlackBottleNeckBasicRule extends BasicRule {
-
- public BlackBottleNeckBasicRule() {
- super("NURI-BASC-0002",
- "Black Bottle Neck",
- "If there is only one path for a black to escape, then those unknowns must be black.",
- "edu/rpi/legup/images/nurikabe/rules/OneUnknownBlack.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) {
- ContradictionRule contraRule = new IsolateBlackContradictionRule();
-
- NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
-
- NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.BLACK) {
- return super.getInvalidUseOfRuleMessage() + ": Only black cells are allowed for this rule!";
- }
- NurikabeBoard modified = origBoardState.copy();
- NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
- modCell.setData(NurikabeType.WHITE.toValue());
-
- if (contraRule.checkContradiction(modified) == null) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This is not the only way for black to escape!";
- }
- }
-
- /**
- * 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.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+public class BlackBottleNeckDirectRule extends DirectRule {
+
+ public BlackBottleNeckDirectRule() {
+ super("NURI-BASC-0002",
+ "Black Bottle Neck",
+ "If there is only one path for a black to escape, then those unknowns must be black.",
+ "edu/rpi/legup/images/nurikabe/rules/OneUnknownBlack.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) {
+ ContradictionRule contraRule = new IsolateBlackContradictionRule();
+
+ NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
+
+ NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.BLACK) {
+ return super.getInvalidUseOfRuleMessage() + ": Only black cells are allowed for this rule!";
+ }
+ NurikabeBoard modified = origBoardState.copy();
+ NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
+ modCell.setData(NurikabeType.WHITE.toValue());
+
+ if (contraRule.checkContradiction(modified) == null) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This is not the only way for black to escape!";
+ }
+ }
+
+ /**
+ * 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/nurikabe/rules/CannotReachCellBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CannotReachCellDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CannotReachCellBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CannotReachCellDirectRule.java
index 4076ff9bd..4fbb20b4d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CannotReachCellBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CannotReachCellDirectRule.java
@@ -1,61 +1,61 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-public class CannotReachCellBasicRule extends BasicRule {
- public CannotReachCellBasicRule() {
- super("NURI-BASC-0008",
- "Can't Reach Cell",
- "A cell must be black if it cannot be reached by any white region",
- "edu/rpi/legup/images/nurikabe/rules/Unreachable.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
- protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
- ContradictionRule contraRule = new UnreachableWhiteCellContradictionRule();
-
- NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
- if (cell.getType() != NurikabeType.BLACK) {
- return super.getInvalidUseOfRuleMessage() + ": Only black cells are allowed for this rule!";
- }
-
- NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
- NurikabeBoard modified = origBoardState.copy();
-
- NurikabeCell modifiedCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
- modifiedCell.setData(NurikabeType.WHITE.toValue());
- if (contraRule.checkContradictionAt(modified,modifiedCell) == null) {
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + ": Cell at this index can be reached";
- }
-
- /**
- * 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.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+public class CannotReachCellDirectRule extends DirectRule {
+ public CannotReachCellDirectRule() {
+ super("NURI-BASC-0008",
+ "Can't Reach Cell",
+ "A cell must be black if it cannot be reached by any white region",
+ "edu/rpi/legup/images/nurikabe/rules/Unreachable.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
+ protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
+ ContradictionRule contraRule = new UnreachableWhiteCellContradictionRule();
+
+ NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
+ if (cell.getType() != NurikabeType.BLACK) {
+ return super.getInvalidUseOfRuleMessage() + ": Only black cells are allowed for this rule!";
+ }
+
+ NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
+ NurikabeBoard modified = origBoardState.copy();
+
+ NurikabeCell modifiedCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
+ modifiedCell.setData(NurikabeType.WHITE.toValue());
+ if (contraRule.checkContradictionAt(modified,modifiedCell) == null) {
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + ": Cell at this index can be reached";
+ }
+
+ /**
+ * 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/nurikabe/rules/CornerBlackBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
similarity index 95%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
index d24c56293..6915d8177 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
@@ -1,109 +1,108 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.Nurikabe;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-import edu.rpi.legup.utility.ConnectedRegions;
-
-import java.awt.*;
-import java.util.Set;
-
-public class CornerBlackBasicRule extends BasicRule {
-
- public CornerBlackBasicRule() {
- super("NURI-BASC-0003",
- "Corners Black",
- "If there is only one white square connected to unknowns and one more white is needed then the angles of that white square are black",
- "edu/rpi/legup/images/nurikabe/rules/CornerBlack.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) {
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell = (NurikabeCell) board.getPuzzleElement(puzzleElement);
- if (cell.getType() != NurikabeType.BLACK) {
- return "Only black cells are allowed for this rule!";
- }
-
- ContradictionRule tooFewContra = new TooFewSpacesContradictionRule();
- Point cellLocation = cell.getLocation();
- // 1. Find the coordinates of the white space (should be a corner of cell)
- for (int i = -1; i < 2; i += 2) {
- for (int j = -1; j < 2; j += 2) {
- // If the corner does not exist, skip the corner
- if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.x + i < board.getHeight())) {
- continue;
- }
-
- NurikabeCell corner = board.getCell(cellLocation.x + i, cellLocation.y + j);
- NurikabeType cornerType = corner.getType();
- if (cornerType == NurikabeType.WHITE || cornerType == NurikabeType.NUMBER) {
- Point cornerLocation = corner.getLocation();
- // 2. Check if the intersecting adjacent spaces of the white space and the black corner are empty
- if (board.getCell(cornerLocation.x, cellLocation.y).getType() == NurikabeType.UNKNOWN && board.getCell(cellLocation.x, cornerLocation.y).getType() == NurikabeType.UNKNOWN) {
- // System.out.println("Went inside if statement");
- NurikabeBoard modified = board.copy();
- modified.getCell(cornerLocation.x, cellLocation.y).setData(NurikabeType.BLACK.toValue());
- modified.getCell(cellLocation.x, cornerLocation.y).setData(NurikabeType.BLACK.toValue());
- boolean containsContradiction = tooFewContra.checkContradiction(modified) == null;
- if (containsContradiction) {
- // 3. Check if the connected region is 1 under what is needed
- Set region = ConnectedRegions.getRegionAroundPoint(cornerLocation, NurikabeType.BLACK.toValue(), modified.getIntArray(), modified.getWidth(), modified.getHeight());
- int regionNumber = 0;
- // System.out.println("Region set size: " + region.size());
- for (Point p : region) {
- NurikabeCell pCell = modified.getCell(p.x, p.y);
- if (pCell.getType() == NurikabeType.NUMBER) {
- if (regionNumber == 0) {
- regionNumber = pCell.getData();
- }
- else {
- return "There is a MultipleNumbers Contradiction on the board.";
- }
- }
- }
- // If the region size is 0, there is a possibility that there was only 1 cell in the white
- // region, and that white cell was a NurikabeType.NUMBER cell
- if (regionNumber == 0 && corner.getType() == NurikabeType.NUMBER && corner.getData() == 2) {
- return null;
- }
- // If the region size is not 0, make sure the regionNumber and the region size match (need
- // to add 1 to account for the cell that was surrounded
- if (regionNumber != 0 && region.size() + 1 == regionNumber) {
- return null;
- }
- }
- }
- }
- }
- }
- return "This is not a valid use of the corner black rule!";
- }
-
- /**
- * 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.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+import edu.rpi.legup.utility.ConnectedRegions;
+
+import java.awt.*;
+import java.util.Set;
+
+public class CornerBlackDirectRule extends DirectRule {
+
+ public CornerBlackDirectRule() {
+ super("NURI-BASC-0003",
+ "Corners Black",
+ "If there is only one white square connected to unknowns and one more white is needed then the angles of that white square are black",
+ "edu/rpi/legup/images/nurikabe/rules/CornerBlack.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) {
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell = (NurikabeCell) board.getPuzzleElement(puzzleElement);
+ if (cell.getType() != NurikabeType.BLACK) {
+ return "Only black cells are allowed for this rule!";
+ }
+
+ ContradictionRule tooFewContra = new TooFewSpacesContradictionRule();
+ Point cellLocation = cell.getLocation();
+ // 1. Find the coordinates of the white space (should be a corner of cell)
+ for (int i = -1; i < 2; i += 2) {
+ for (int j = -1; j < 2; j += 2) {
+ // If the corner does not exist, skip the corner
+ if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.x + i < board.getHeight())) {
+ continue;
+ }
+
+ NurikabeCell corner = board.getCell(cellLocation.x + i, cellLocation.y + j);
+ NurikabeType cornerType = corner.getType();
+ if (cornerType == NurikabeType.WHITE || cornerType == NurikabeType.NUMBER) {
+ Point cornerLocation = corner.getLocation();
+ // 2. Check if the intersecting adjacent spaces of the white space and the black corner are empty
+ if (board.getCell(cornerLocation.x, cellLocation.y).getType() == NurikabeType.UNKNOWN && board.getCell(cellLocation.x, cornerLocation.y).getType() == NurikabeType.UNKNOWN) {
+ // System.out.println("Went inside if statement");
+ NurikabeBoard modified = board.copy();
+ modified.getCell(cornerLocation.x, cellLocation.y).setData(NurikabeType.BLACK.toValue());
+ modified.getCell(cellLocation.x, cornerLocation.y).setData(NurikabeType.BLACK.toValue());
+ boolean containsContradiction = tooFewContra.checkContradiction(modified) == null;
+ if (containsContradiction) {
+ // 3. Check if the connected region is 1 under what is needed
+ Set region = ConnectedRegions.getRegionAroundPoint(cornerLocation, NurikabeType.BLACK.toValue(), modified.getIntArray(), modified.getWidth(), modified.getHeight());
+ int regionNumber = 0;
+ // System.out.println("Region set size: " + region.size());
+ for (Point p : region) {
+ NurikabeCell pCell = modified.getCell(p.x, p.y);
+ if (pCell.getType() == NurikabeType.NUMBER) {
+ if (regionNumber == 0) {
+ regionNumber = pCell.getData();
+ }
+ else {
+ return "There is a MultipleNumbers Contradiction on the board.";
+ }
+ }
+ }
+ // If the region size is 0, there is a possibility that there was only 1 cell in the white
+ // region, and that white cell was a NurikabeType.NUMBER cell
+ if (regionNumber == 0 && corner.getType() == NurikabeType.NUMBER && corner.getData() == 2) {
+ return null;
+ }
+ // If the region size is not 0, make sure the regionNumber and the region size match (need
+ // to add 1 to account for the cell that was surrounded
+ if (regionNumber != 0 && region.size() + 1 == regionNumber) {
+ return null;
+ }
+ }
+ }
+ }
+ }
+ }
+ return "This is not a valid use of the corner black rule!";
+ }
+
+ /**
+ * 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/nurikabe/rules/FillinBlackBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinBlackDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinBlackBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinBlackDirectRule.java
index 326729797..aab389e4a 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinBlackBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinBlackDirectRule.java
@@ -1,60 +1,60 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-public class FillinBlackBasicRule extends BasicRule {
-
- public FillinBlackBasicRule() {
- super("NURI-BASC-0004",
- "Fill In Black",
- "If there an unknown region surrounded by black, it must be black.",
- "edu/rpi/legup/images/nurikabe/rules/FillInBlack.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) {
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoard = (NurikabeBoard) transition.getParents().get(0).getBoard();
- ContradictionRule contraRule = new NoNumberContradictionRule();
-
- NurikabeCell cell = (NurikabeCell) board.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.BLACK) {
- return "Only black cells are allowed for this rule!";
- }
- NurikabeBoard modified = origBoard.copy();
- modified.getPuzzleElement(puzzleElement).setData(NurikabeType.WHITE.toValue());
- if (contraRule.checkContradictionAt(modified, puzzleElement) != null) {
- return "Black cells must be placed in a region of black cells!";
- }
- 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;
- }
-}
+package edu.rpi.legup.puzzle.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+public class FillinBlackDirectRule extends DirectRule {
+
+ public FillinBlackDirectRule() {
+ super("NURI-BASC-0004",
+ "Fill In Black",
+ "If there an unknown region surrounded by black, it must be black.",
+ "edu/rpi/legup/images/nurikabe/rules/FillInBlack.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) {
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoard = (NurikabeBoard) transition.getParents().get(0).getBoard();
+ ContradictionRule contraRule = new NoNumberContradictionRule();
+
+ NurikabeCell cell = (NurikabeCell) board.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.BLACK) {
+ return "Only black cells are allowed for this rule!";
+ }
+ NurikabeBoard modified = origBoard.copy();
+ modified.getPuzzleElement(puzzleElement).setData(NurikabeType.WHITE.toValue());
+ if (contraRule.checkContradictionAt(modified, puzzleElement) != null) {
+ return "Black cells must be placed in a region of black cells!";
+ }
+ 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/nurikabe/rules/FillinWhiteBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinWhiteDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinWhiteBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinWhiteDirectRule.java
index 748cc66ff..4f57602d5 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinWhiteBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FillinWhiteDirectRule.java
@@ -1,60 +1,60 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-public class FillinWhiteBasicRule extends BasicRule {
-
- public FillinWhiteBasicRule() {
- super("NURI-BASC-0005",
- "Fill In White",
- "If there an unknown region surrounded by white, it must be white.",
- "edu/rpi/legup/images/nurikabe/rules/FillInWhite.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) {
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoard = (NurikabeBoard) transition.getParents().get(0).getBoard();
- ContradictionRule contraRule = new IsolateBlackContradictionRule();
-
- NurikabeCell cell = (NurikabeCell) board.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.WHITE) {
- return "Only white cells are allowed for this rule!";
- }
- NurikabeBoard modified = origBoard.copy();
- modified.getPuzzleElement(puzzleElement).setData(NurikabeType.BLACK.toValue());
- if (contraRule.checkContradictionAt(modified, puzzleElement) != null) {
- return "white cells must be placed in a region of white cells!";
- }
- 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;
- }
-}
+package edu.rpi.legup.puzzle.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+public class FillinWhiteDirectRule extends DirectRule {
+
+ public FillinWhiteDirectRule() {
+ super("NURI-BASC-0005",
+ "Fill In White",
+ "If there an unknown region surrounded by white, it must be white.",
+ "edu/rpi/legup/images/nurikabe/rules/FillInWhite.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) {
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoard = (NurikabeBoard) transition.getParents().get(0).getBoard();
+ ContradictionRule contraRule = new IsolateBlackContradictionRule();
+
+ NurikabeCell cell = (NurikabeCell) board.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.WHITE) {
+ return "Only white cells are allowed for this rule!";
+ }
+ NurikabeBoard modified = origBoard.copy();
+ modified.getPuzzleElement(puzzleElement).setData(NurikabeType.BLACK.toValue());
+ if (contraRule.checkContradictionAt(modified, puzzleElement) != null) {
+ return "white cells must be placed in a region of white cells!";
+ }
+ 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/nurikabe/rules/PreventBlackSquareBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/PreventBlackSquareDirectRule.java
similarity index 91%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/PreventBlackSquareBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/PreventBlackSquareDirectRule.java
index 0233e48ef..2502ee62f 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/PreventBlackSquareBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/PreventBlackSquareDirectRule.java
@@ -1,66 +1,66 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-public class PreventBlackSquareBasicRule extends BasicRule {
-
- public PreventBlackSquareBasicRule() {
- super("NURI-BASC-0006",
- "Prevent Black Square",
- "There cannot be a 2x2 square of black. (3 blacks = fill in last corner white)",
- "edu/rpi/legup/images/nurikabe/rules/NoBlackSquare.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) {
- ContradictionRule contraRule = new BlackSquareContradictionRule();
-
- NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
-
- NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.WHITE) {
- return "Only white cells are allowed for this rule!";
- }
-
- NurikabeBoard modified = origBoardState.copy();
- NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
- modCell.setData(NurikabeType.BLACK.toValue());
-
- if (contraRule.checkContradiction(modified) == null) {
- return null;
- }
- else {
- return "Does not contain a contradiction 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;
- }
-}
+package edu.rpi.legup.puzzle.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+public class PreventBlackSquareDirectRule extends DirectRule {
+
+ public PreventBlackSquareDirectRule() {
+ super("NURI-BASC-0006",
+ "Prevent Black Square",
+ "There cannot be a 2x2 square of black. (3 blacks = fill in last corner white)",
+ "edu/rpi/legup/images/nurikabe/rules/NoBlackSquare.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) {
+ ContradictionRule contraRule = new BlackSquareContradictionRule();
+
+ NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
+
+ NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.WHITE) {
+ return "Only white cells are allowed for this rule!";
+ }
+
+ NurikabeBoard modified = origBoardState.copy();
+ NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
+ modCell.setData(NurikabeType.BLACK.toValue());
+
+ if (contraRule.checkContradiction(modified) == null) {
+ return null;
+ }
+ else {
+ return "Does not contain a contradiction 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/nurikabe/rules/SurroundRegionBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/SurroundRegionDirectRule.java
similarity index 91%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/SurroundRegionBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/SurroundRegionDirectRule.java
index 0a925911d..b77f8a79f 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/SurroundRegionBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/SurroundRegionDirectRule.java
@@ -1,65 +1,65 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-public class SurroundRegionBasicRule extends BasicRule {
-
- public SurroundRegionBasicRule() {
- super("NURI-BASC-0007", "Surround Region",
- "Surround Region",
- "edu/rpi/legup/images/nurikabe/rules/SurroundBlack.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) {
- ContradictionRule contraRule = new TooManySpacesContradictionRule();
-
- NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
-
- NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.BLACK) {
- return "Only black cells are allowed for this rule!";
- }
-
- NurikabeBoard modified = origBoardState.copy();
- NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
- modCell.setData(NurikabeType.WHITE.toValue());
-
- if (contraRule.checkContradiction(modified) == null) {
- return null;
- }
- else {
- return "Does not follow from this rule 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;
- }
-}
+package edu.rpi.legup.puzzle.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+public class SurroundRegionDirectRule extends DirectRule {
+
+ public SurroundRegionDirectRule() {
+ super("NURI-BASC-0007", "Surround Region",
+ "Surround Region",
+ "edu/rpi/legup/images/nurikabe/rules/SurroundBlack.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) {
+ ContradictionRule contraRule = new TooManySpacesContradictionRule();
+
+ NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
+
+ NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.BLACK) {
+ return "Only black cells are allowed for this rule!";
+ }
+
+ NurikabeBoard modified = origBoardState.copy();
+ NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
+ modCell.setData(NurikabeType.WHITE.toValue());
+
+ if (contraRule.checkContradiction(modified) == null) {
+ return null;
+ }
+ else {
+ return "Does not follow from this rule 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/nurikabe/rules/WhiteBottleNeckBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/WhiteBottleNeckDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/WhiteBottleNeckBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/WhiteBottleNeckDirectRule.java
index eca68fde8..dd337858c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/WhiteBottleNeckBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/WhiteBottleNeckDirectRule.java
@@ -1,69 +1,69 @@
-package edu.rpi.legup.puzzle.nurikabe.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-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.nurikabe.NurikabeBoard;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
-import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-public class WhiteBottleNeckBasicRule extends BasicRule {
-
- public WhiteBottleNeckBasicRule() {
- super("NURI-BASC-0009",
- "White Bottle Neck",
- "If a region needs more whites and there is only one path for the region to expand, then those unknowns must be white.", "edu/rpi/legup/images/nurikabe/rules/OneUnknownWhite.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) {
- Set contras = new LinkedHashSet<>();
- contras.add(new NoNumberContradictionRule());
- contras.add(new TooFewSpacesContradictionRule());
-
- NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
- NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
-
- NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
-
- if (cell.getType() != NurikabeType.WHITE) {
- return "Only white cells are allowed for this rule!";
- }
- NurikabeBoard modified = origBoardState.copy();
- NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
- modCell.setData(NurikabeType.BLACK.toValue());
-
- for (ContradictionRule contraRule : contras) {
- if (contraRule.checkContradiction(modified) == null) {
- return null;
- }
- }
- return "This is not the only way for white to escape!";
- }
-
- /**
- * 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.nurikabe.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.rules.ContradictionRule;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
+import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class WhiteBottleNeckDirectRule extends DirectRule {
+
+ public WhiteBottleNeckDirectRule() {
+ super("NURI-BASC-0009",
+ "White Bottle Neck",
+ "If a region needs more whites and there is only one path for the region to expand, then those unknowns must be white.", "edu/rpi/legup/images/nurikabe/rules/OneUnknownWhite.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) {
+ Set contras = new LinkedHashSet<>();
+ contras.add(new NoNumberContradictionRule());
+ contras.add(new TooFewSpacesContradictionRule());
+
+ NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
+ NurikabeBoard origBoardState = (NurikabeBoard) transition.getParents().get(0).getBoard();
+
+ NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
+
+ if (cell.getType() != NurikabeType.WHITE) {
+ return "Only white cells are allowed for this rule!";
+ }
+ NurikabeBoard modified = origBoardState.copy();
+ NurikabeCell modCell = (NurikabeCell) modified.getPuzzleElement(puzzleElement);
+ modCell.setData(NurikabeType.BLACK.toValue());
+
+ for (ContradictionRule contraRule : contras) {
+ if (contraRule.checkContradiction(modified) == null) {
+ return null;
+ }
+ }
+ return "This is not the only way for white to escape!";
+ }
+
+ /**
+ * 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/nurikabe/rules/nurikabe_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt
index 2af0b5fea..6a6e6bc1f 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/nurikabe_reference_sheet.txt
@@ -1,12 +1,12 @@
-NURI-BASC-0001 : BlackBetweenRegionsBasicRule
-NURI-BASC-0002 : BlackBottleNeckBasicRule
-NURI-BASC-0003 : CornerBlackBasicRule
-NURI-BASC-0004 : FillinBlackBasicRule
-NURI-BASC-0005 : FillinWhiteBasicRule
-NURI-BASC-0006 : PreventBlackSquareBasicRule
-NURI-BASC-0007 : SurroundRegionBasicRule
-NURI-BASC-0008 : CannotReachCellBasicRule
-NURI-BASC-0009 : WhiteBottleNeckBasicRule
+NURI-BASC-0001 : BlackBetweenRegionsDirectRule
+NURI-BASC-0002 : BlackBottleNeckDirectRule
+NURI-BASC-0003 : CornerBlackDirectRule
+NURI-BASC-0004 : FillinBlackDirectRule
+NURI-BASC-0005 : FillinWhiteDirectRule
+NURI-BASC-0006 : PreventBlackSquareDirectRule
+NURI-BASC-0007 : SurroundRegionDirectRule
+NURI-BASC-0008 : CannotReachCellDirectRule
+NURI-BASC-0009 : WhiteBottleNeckDirectRule
NURI-CONT-0001 : BlackSquareContradictionRule
NURI-CONT-0002 : UnreachableWhiteCellContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/DirectRuleAtomic.java
similarity index 77%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/DirectRuleAtomic.java
index df90efadf..35a1182b0 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/DirectRuleAtomic.java
@@ -1,16 +1,16 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAtomic;
-
-public class BasicRuleAtomic extends BasicRule_Generic {
-
- public BasicRuleAtomic() {
- super("STTT-BASC-0001", "Atomic Rule",
- "All identical atoms have the same T/F value",
- "Atomic",
- new ContradictionRuleAtomic(),
- false
- );
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAtomic;
+
+public class DirectRuleAtomic extends DirectRule_Generic {
+
+ public DirectRuleAtomic() {
+ super("STTT-BASC-0001", "Atomic Rule",
+ "All identical atoms have the same T/F value",
+ "Atomic",
+ new ContradictionRuleAtomic(),
+ false
+ );
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/DirectRule_Generic.java
similarity index 89%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/DirectRule_Generic.java
index 4d1385e87..69636f56a 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/DirectRule_Generic.java
@@ -1,69 +1,69 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-
-import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard;
-import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell;
-import edu.rpi.legup.model.rules.ContradictionRule;
-
-public abstract class BasicRule_Generic extends BasicRule {
-
- final ContradictionRule CORRESPONDING_CONTRADICTION_RULE;
- final boolean ELIMINATION_RULE;
-
- public BasicRule_Generic(String ruleID, String ruleName, String description, String imageName, ContradictionRule contraRule, boolean eliminationRule) {
- super(ruleID, ruleName, description, "edu/rpi/legup/images/shorttruthtable/ruleimages/basic/" + imageName + ".png");
- this.CORRESPONDING_CONTRADICTION_RULE = contraRule;
- this.ELIMINATION_RULE = eliminationRule;
- }
-
- public String checkRuleRawAt(TreeTransition transition, PuzzleElement element) {
-
- // Check that the puzzle element is not unknown
- ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard();
- ShortTruthTableCell cell = (ShortTruthTableCell) board.getPuzzleElement(element);
-
- if (!cell.isAssigned()) {
- return super.getInvalidUseOfRuleMessage() + ": Only assigned cells are allowed for basic rules";
- }
-
- // Strategy: Negate the modified cell and check if there is a contradiction. If there is one, then the
- // original statement must be true. If there isn't one, then the original statement must be false.
-
- ShortTruthTableBoard modifiedBoard = board.copy();
-
- PuzzleElement checkElement =
- this.ELIMINATION_RULE
- ? cell.getStatementReference().getParentStatement().getCell()
- : element;
-
- ShortTruthTableCell checkCell =
- this.ELIMINATION_RULE
- ? (ShortTruthTableCell) modifiedBoard.getCell(cell.getX(), cell.getY())
- : (ShortTruthTableCell) modifiedBoard.getPuzzleElement(element);
-
- checkCell.setType(checkCell.getType().getNegation());
-
- String contradictionMessage = CORRESPONDING_CONTRADICTION_RULE.checkContradictionAt(modifiedBoard, checkElement);
- if (contradictionMessage == null) { // A contradiction exists in the modified statement; this is good!
- return null;
- }
-
- return super.getInvalidUseOfRuleMessage();
- }
-
- /**
- * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}.
- *
- * @param node short truth table board 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.shorttruthtable.rules.basic;
+
+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.shorttruthtable.ShortTruthTableBoard;
+import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell;
+import edu.rpi.legup.model.rules.ContradictionRule;
+
+public abstract class DirectRule_Generic extends DirectRule {
+
+ final ContradictionRule CORRESPONDING_CONTRADICTION_RULE;
+ final boolean ELIMINATION_RULE;
+
+ public DirectRule_Generic(String ruleID, String ruleName, String description, String imageName, ContradictionRule contraRule, boolean eliminationRule) {
+ super(ruleID, ruleName, description, "edu/rpi/legup/images/shorttruthtable/ruleimages/basic/" + imageName + ".png");
+ this.CORRESPONDING_CONTRADICTION_RULE = contraRule;
+ this.ELIMINATION_RULE = eliminationRule;
+ }
+
+ public String checkRuleRawAt(TreeTransition transition, PuzzleElement element) {
+
+ // Check that the puzzle element is not unknown
+ ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard();
+ ShortTruthTableCell cell = (ShortTruthTableCell) board.getPuzzleElement(element);
+
+ if (!cell.isAssigned()) {
+ return super.getInvalidUseOfRuleMessage() + ": Only assigned cells are allowed for basic rules";
+ }
+
+ // Strategy: Negate the modified cell and check if there is a contradiction. If there is one, then the
+ // original statement must be true. If there isn't one, then the original statement must be false.
+
+ ShortTruthTableBoard modifiedBoard = board.copy();
+
+ PuzzleElement checkElement =
+ this.ELIMINATION_RULE
+ ? cell.getStatementReference().getParentStatement().getCell()
+ : element;
+
+ ShortTruthTableCell checkCell =
+ this.ELIMINATION_RULE
+ ? (ShortTruthTableCell) modifiedBoard.getCell(cell.getX(), cell.getY())
+ : (ShortTruthTableCell) modifiedBoard.getPuzzleElement(element);
+
+ checkCell.setType(checkCell.getType().getNegation());
+
+ String contradictionMessage = CORRESPONDING_CONTRADICTION_RULE.checkContradictionAt(modifiedBoard, checkElement);
+ if (contradictionMessage == null) { // A contradiction exists in the modified statement; this is good!
+ return null;
+ }
+
+ return super.getInvalidUseOfRuleMessage();
+ }
+
+ /**
+ * Creates a transition {@link Board} that has this rule applied to it using the {@link TreeNode}.
+ *
+ * @param node short truth table board 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/shorttruthtable/rules/basic/elimination/BasicRuleAndElimination.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleAndElimination.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleAndElimination.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleAndElimination.java
index e63894afa..63e3c8dd9 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleAndElimination.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleAndElimination.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAnd;
-
-public class BasicRuleAndElimination extends BasicRule_GenericElimination {
-
- public BasicRuleAndElimination() {
- super("STTT-BASC-0002", "And", new ContradictionRuleAnd());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAnd;
+
+public class DirectRuleAndElimination extends DirectRule_GenericElimination {
+
+ public DirectRuleAndElimination() {
+ super("STTT-BASC-0002", "And", new ContradictionRuleAnd());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleBiconditionalElimination.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleBiconditionalElimination.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleBiconditionalElimination.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleBiconditionalElimination.java
index 2b9d74b09..7f7336a4c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleBiconditionalElimination.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleBiconditionalElimination.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleBiconditional;
-
-public class BasicRuleBiconditionalElimination extends BasicRule_GenericElimination {
-
- public BasicRuleBiconditionalElimination() {
- super("STTT-BASC-0003", "Biconditional", new ContradictionRuleBiconditional());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleBiconditional;
+
+public class DirectRuleBiconditionalElimination extends DirectRule_GenericElimination {
+
+ public DirectRuleBiconditionalElimination() {
+ super("STTT-BASC-0003", "Biconditional", new ContradictionRuleBiconditional());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleConditionalElimination.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleConditionalElimination.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleConditionalElimination.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleConditionalElimination.java
index fb2bd6845..8f15be021 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleConditionalElimination.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleConditionalElimination.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleConditional;
-
-public class BasicRuleConditionalElimination extends BasicRule_GenericElimination {
-
- public BasicRuleConditionalElimination() {
- super("STTT-BASC-0004", "Conditional", new ContradictionRuleConditional());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleConditional;
+
+public class DirectRuleConditionalElimination extends DirectRule_GenericElimination {
+
+ public DirectRuleConditionalElimination() {
+ super("STTT-BASC-0004", "Conditional", new ContradictionRuleConditional());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleNotElimination.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleNotElimination.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleNotElimination.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleNotElimination.java
index 78043b18a..a2f08635c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleNotElimination.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleNotElimination.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleNot;
-
-public class BasicRuleNotElimination extends BasicRule_GenericElimination {
-
- public BasicRuleNotElimination() {
- super("STTT-BASC-0005", "Not", new ContradictionRuleNot());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleNot;
+
+public class DirectRuleNotElimination extends DirectRule_GenericElimination {
+
+ public DirectRuleNotElimination() {
+ super("STTT-BASC-0005", "Not", new ContradictionRuleNot());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleOrElimination.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleOrElimination.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleOrElimination.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleOrElimination.java
index 9a970cff8..eca1848bd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRuleOrElimination.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRuleOrElimination.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleOr;
-
-public class BasicRuleOrElimination extends BasicRule_GenericElimination {
-
- public BasicRuleOrElimination() {
- super("STTT-BASC-0006", "Or", new ContradictionRuleOr());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleOr;
+
+public class DirectRuleOrElimination extends DirectRule_GenericElimination {
+
+ public DirectRuleOrElimination() {
+ super("STTT-BASC-0006", "Or", new ContradictionRuleOr());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRule_GenericElimination.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRule_GenericElimination.java
similarity index 55%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRule_GenericElimination.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRule_GenericElimination.java
index bd2470fed..49dc43510 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/BasicRule_GenericElimination.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination/DirectRule_GenericElimination.java
@@ -1,18 +1,18 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.basic.BasicRule_Generic;
-import edu.rpi.legup.model.rules.ContradictionRule;
-
-public abstract class BasicRule_GenericElimination extends BasicRule_Generic {
-
- public BasicRule_GenericElimination(String ruleID, String ruleName, ContradictionRule contradictionRule) {
-
- super(ruleID, ruleName + " Elimination",
- ruleName + " statements must have a valid pattern",
- "elimination/" + ruleName,
- contradictionRule,
- true
- );
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.elimination;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.basic.DirectRule_Generic;
+import edu.rpi.legup.model.rules.ContradictionRule;
+
+public abstract class DirectRule_GenericElimination extends DirectRule_Generic {
+
+ public DirectRule_GenericElimination(String ruleID, String ruleName, ContradictionRule contradictionRule) {
+
+ super(ruleID, ruleName + " Elimination",
+ ruleName + " statements must have a valid pattern",
+ "elimination/" + ruleName,
+ contradictionRule,
+ true
+ );
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleAndIntroduction.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleAndIntroduction.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleAndIntroduction.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleAndIntroduction.java
index 07e4e672b..0ca2a7dcf 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleAndIntroduction.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleAndIntroduction.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAnd;
-
-public class BasicRuleAndIntroduction extends BasicRule_GenericIntroduction {
-
- public BasicRuleAndIntroduction() {
- super("STTT-BASC-0007", "And", new ContradictionRuleAnd());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleAnd;
+
+public class DirectRuleAndIntroduction extends DirectRule_GenericIntroduction {
+
+ public DirectRuleAndIntroduction() {
+ super("STTT-BASC-0007", "And", new ContradictionRuleAnd());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleBiconditionalIntroduction.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleBiconditionalIntroduction.java
similarity index 63%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleBiconditionalIntroduction.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleBiconditionalIntroduction.java
index 427b38c3b..b72d5299c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleBiconditionalIntroduction.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleBiconditionalIntroduction.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleBiconditional;
-
-public class BasicRuleBiconditionalIntroduction extends BasicRule_GenericIntroduction {
-
- public BasicRuleBiconditionalIntroduction() {
- super("STTT-BASC-0008", "Biconditional", new ContradictionRuleBiconditional());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleBiconditional;
+
+public class DirectRuleBiconditionalIntroduction extends DirectRule_GenericIntroduction {
+
+ public DirectRuleBiconditionalIntroduction() {
+ super("STTT-BASC-0008", "Biconditional", new ContradictionRuleBiconditional());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleConditionalIntroduction.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleConditionalIntroduction.java
similarity index 63%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleConditionalIntroduction.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleConditionalIntroduction.java
index fe4979df7..0e27d267c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleConditionalIntroduction.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleConditionalIntroduction.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleConditional;
-
-public class BasicRuleConditionalIntroduction extends BasicRule_GenericIntroduction {
-
- public BasicRuleConditionalIntroduction() {
- super("STTT-BASC-0009", "Conditional", new ContradictionRuleConditional());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleConditional;
+
+public class DirectRuleConditionalIntroduction extends DirectRule_GenericIntroduction {
+
+ public DirectRuleConditionalIntroduction() {
+ super("STTT-BASC-0009", "Conditional", new ContradictionRuleConditional());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleNotIntroduction.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleNotIntroduction.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleNotIntroduction.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleNotIntroduction.java
index d336101b8..980a132fe 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleNotIntroduction.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleNotIntroduction.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleNot;
-
-public class BasicRuleNotIntroduction extends BasicRule_GenericIntroduction {
-
- public BasicRuleNotIntroduction() {
- super("STTT-BASC-0010", "Not", new ContradictionRuleNot());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleNot;
+
+public class DirectRuleNotIntroduction extends DirectRule_GenericIntroduction {
+
+ public DirectRuleNotIntroduction() {
+ super("STTT-BASC-0010", "Not", new ContradictionRuleNot());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleOrIntroduction.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleOrIntroduction.java
similarity index 64%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleOrIntroduction.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleOrIntroduction.java
index 5a9a2ba41..0fd7108bd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRuleOrIntroduction.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRuleOrIntroduction.java
@@ -1,11 +1,11 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleOr;
-
-public class BasicRuleOrIntroduction extends BasicRule_GenericIntroduction {
-
- public BasicRuleOrIntroduction() {
- super("STTT-BASC-0011", "Or", new ContradictionRuleOr());
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.contradiction.ContradictionRuleOr;
+
+public class DirectRuleOrIntroduction extends DirectRule_GenericIntroduction {
+
+ public DirectRuleOrIntroduction() {
+ super("STTT-BASC-0011", "Or", new ContradictionRuleOr());
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRule_GenericIntroduction.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRule_GenericIntroduction.java
similarity index 55%
rename from src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRule_GenericIntroduction.java
rename to src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRule_GenericIntroduction.java
index dccb25385..123165d7a 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/BasicRule_GenericIntroduction.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction/DirectRule_GenericIntroduction.java
@@ -1,18 +1,18 @@
-package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
-
-import edu.rpi.legup.puzzle.shorttruthtable.rules.basic.BasicRule_Generic;
-import edu.rpi.legup.model.rules.ContradictionRule;
-
-public abstract class BasicRule_GenericIntroduction extends BasicRule_Generic {
-
- protected BasicRule_GenericIntroduction(String ruleID, String ruleName, ContradictionRule contradictionRule) {
-
- super(ruleID, ruleName + " Introduction",
- ruleName + " statements must have a valid pattern",
- "introduction/" + ruleName,
- contradictionRule,
- false
- );
- }
-
+package edu.rpi.legup.puzzle.shorttruthtable.rules.basic.introduction;
+
+import edu.rpi.legup.puzzle.shorttruthtable.rules.basic.DirectRule_Generic;
+import edu.rpi.legup.model.rules.ContradictionRule;
+
+public abstract class DirectRule_GenericIntroduction extends DirectRule_Generic {
+
+ protected DirectRule_GenericIntroduction(String ruleID, String ruleName, ContradictionRule contradictionRule) {
+
+ super(ruleID, ruleName + " Introduction",
+ ruleName + " statements must have a valid pattern",
+ "introduction/" + ruleName,
+ contradictionRule,
+ false
+ );
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
similarity index 95%
rename from src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
index 727559083..327030e4b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
@@ -1,115 +1,115 @@
-package edu.rpi.legup.puzzle.skyscrapers.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersBoard;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
-
-import java.util.ArrayList;
-
-public class LastSingularCellBasicRule extends BasicRule {
-
- public LastSingularCellBasicRule() {
- super("SKYS-BASC-0002", "Last Non-Duplicate Cell",
- "There is only one cell on this row/col for this number that does not create a duplicate contradiction",
- "edu/rpi/legup/images/skyscrapers/rules/LastCell.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 index of the 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
- SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
- SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
- SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == SkyscrapersType.UNKNOWN && finalCell.getType() == SkyscrapersType.Number)) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must be number";
- }
-
- //set all rules used by case rule to false except for dupe, get all cases
- boolean dupeTemp = initialBoard.getDupeFlag();
- boolean viewTemp = initialBoard.getViewFlag();
- initialBoard.setDupeFlag(true);
- initialBoard.setViewFlag(false);
- CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
- ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
- ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
- initialBoard.setDupeFlag(dupeTemp);
- initialBoard.setViewFlag(viewTemp);
-
- System.out.println(XCandidates.size());
- System.out.println(YCandidates.size());
-
- //return null if either pass, both messages otherwise
- String xCheck = candidateCheck(XCandidates,puzzleElement,finalCell);
- String yCheck = candidateCheck(YCandidates,puzzleElement,finalCell);
- if(xCheck==null || yCheck==null){
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + "\nRow" + xCheck + "\nCol" + yCheck;
- }
-
- //helper to check if candidate list is valid
- private String candidateCheck(ArrayList candidates,PuzzleElement puzzleElement, SkyscrapersCell finalCell){
- if(candidates.size() == 1){
- if(((SkyscrapersCell) candidates.get(0).getPuzzleElement(puzzleElement)).getType() == SkyscrapersType.Number) {
- if (candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()) {
- return null;
- }
- return ": Wrong number in the cell.";
- }
- return ": No case for this cell.";
- }
- return ": This cell is not forced.";
- }
-
- private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
- SkyscrapersBoard emptyCase = board.copy();
- emptyCase.getPuzzleElement(cell).setData(0);
- DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
- if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
- System.out.println("no contradiction ln");
- return true;
- }
- return false;
- }
-
- /**
- * 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
- SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
- System.out.println(lightUpBoard.getPuzzleElements().size());
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- System.out.println("123");
- SkyscrapersCell cell = (SkyscrapersCell) element;
- if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
- //cell.setData(SkyscrapersType.BULB.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.skyscrapers.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.skyscrapers.SkyscrapersBoard;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
+
+import java.util.ArrayList;
+
+public class LastSingularCellDirectRule extends DirectRule {
+
+ public LastSingularCellDirectRule() {
+ super("SKYS-BASC-0002", "Last Non-Duplicate Cell",
+ "There is only one cell on this row/col for this number that does not create a duplicate contradiction",
+ "edu/rpi/legup/images/skyscrapers/rules/LastCell.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 index of the 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
+ SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
+ SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
+ SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == SkyscrapersType.UNKNOWN && finalCell.getType() == SkyscrapersType.Number)) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must be number";
+ }
+
+ //set all rules used by case rule to false except for dupe, get all cases
+ boolean dupeTemp = initialBoard.getDupeFlag();
+ boolean viewTemp = initialBoard.getViewFlag();
+ initialBoard.setDupeFlag(true);
+ initialBoard.setViewFlag(false);
+ CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
+ ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
+ ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
+ initialBoard.setDupeFlag(dupeTemp);
+ initialBoard.setViewFlag(viewTemp);
+
+ System.out.println(XCandidates.size());
+ System.out.println(YCandidates.size());
+
+ //return null if either pass, both messages otherwise
+ String xCheck = candidateCheck(XCandidates,puzzleElement,finalCell);
+ String yCheck = candidateCheck(YCandidates,puzzleElement,finalCell);
+ if(xCheck==null || yCheck==null){
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + "\nRow" + xCheck + "\nCol" + yCheck;
+ }
+
+ //helper to check if candidate list is valid
+ private String candidateCheck(ArrayList candidates,PuzzleElement puzzleElement, SkyscrapersCell finalCell){
+ if(candidates.size() == 1){
+ if(((SkyscrapersCell) candidates.get(0).getPuzzleElement(puzzleElement)).getType() == SkyscrapersType.Number) {
+ if (candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()) {
+ return null;
+ }
+ return ": Wrong number in the cell.";
+ }
+ return ": No case for this cell.";
+ }
+ return ": This cell is not forced.";
+ }
+
+ private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
+ SkyscrapersBoard emptyCase = board.copy();
+ emptyCase.getPuzzleElement(cell).setData(0);
+ DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
+ if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
+ System.out.println("no contradiction ln");
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
+ SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
+ System.out.println(lightUpBoard.getPuzzleElements().size());
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ System.out.println("123");
+ SkyscrapersCell cell = (SkyscrapersCell) element;
+ if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
+ //cell.setData(SkyscrapersType.BULB.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularNumberBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularNumberDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularNumberBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularNumberDirectRule.java
index 248998e84..08d3f4589 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularNumberBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularNumberDirectRule.java
@@ -1,98 +1,98 @@
-package edu.rpi.legup.puzzle.skyscrapers.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersBoard;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
-
-import java.util.ArrayList;
-
-public class LastSingularNumberBasicRule extends BasicRule {
-
- public LastSingularNumberBasicRule() {
- super("SKYS-BASC-0003", "Last Non-Duplicate Number",
- "There is only one number for this cell that does not create a duplicate contradiction",
- "edu/rpi/legup/images/skyscrapers/rules/LastNumber.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 index of the 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
- SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
- SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
- SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
- if (initCell.getType() != SkyscrapersType.UNKNOWN || finalCell.getType() != SkyscrapersType.Number) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must transition from unknown to number";
- }
-
- //set all rules used by case rule to false except for dupe, get all cases
- boolean dupeTemp = initialBoard.getDupeFlag();
- boolean viewTemp = initialBoard.getViewFlag();
- initialBoard.setDupeFlag(true);
- initialBoard.setViewFlag(false);
- NumberForCellCaseRule caseRule = new NumberForCellCaseRule();
- ArrayList candidates = caseRule.getCases(initialBoard,puzzleElement);
- initialBoard.setDupeFlag(dupeTemp);
- initialBoard.setViewFlag(viewTemp);
-
- //check if given value is the only remaining value
- if(candidates.size() == 1){
- if(candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()){
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + ": Wrong number in the cell.";
- }
- return super.getInvalidUseOfRuleMessage() + ":This cell is not forced.";
- }
-
- private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
- SkyscrapersBoard emptyCase = board.copy();
- emptyCase.getPuzzleElement(cell).setData(0);
- DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
- if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
- System.out.println("no contradiction ln");
- return true;
- }
- return false;
- }
-
- /**
- * 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
- SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
- System.out.println(lightUpBoard.getPuzzleElements().size());
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- System.out.println("123");
- SkyscrapersCell cell = (SkyscrapersCell) element;
- if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
- //cell.setData(SkyscrapersType.BULB.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.skyscrapers.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.skyscrapers.SkyscrapersBoard;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
+
+import java.util.ArrayList;
+
+public class LastSingularNumberDirectRule extends DirectRule {
+
+ public LastSingularNumberDirectRule() {
+ super("SKYS-BASC-0003", "Last Non-Duplicate Number",
+ "There is only one number for this cell that does not create a duplicate contradiction",
+ "edu/rpi/legup/images/skyscrapers/rules/LastNumber.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 index of the 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
+ SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
+ SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
+ SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (initCell.getType() != SkyscrapersType.UNKNOWN || finalCell.getType() != SkyscrapersType.Number) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must transition from unknown to number";
+ }
+
+ //set all rules used by case rule to false except for dupe, get all cases
+ boolean dupeTemp = initialBoard.getDupeFlag();
+ boolean viewTemp = initialBoard.getViewFlag();
+ initialBoard.setDupeFlag(true);
+ initialBoard.setViewFlag(false);
+ NumberForCellCaseRule caseRule = new NumberForCellCaseRule();
+ ArrayList candidates = caseRule.getCases(initialBoard,puzzleElement);
+ initialBoard.setDupeFlag(dupeTemp);
+ initialBoard.setViewFlag(viewTemp);
+
+ //check if given value is the only remaining value
+ if(candidates.size() == 1){
+ if(candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()){
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + ": Wrong number in the cell.";
+ }
+ return super.getInvalidUseOfRuleMessage() + ":This cell is not forced.";
+ }
+
+ private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
+ SkyscrapersBoard emptyCase = board.copy();
+ emptyCase.getPuzzleElement(cell).setData(0);
+ DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
+ if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
+ System.out.println("no contradiction ln");
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
+ SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
+ System.out.println(lightUpBoard.getPuzzleElements().size());
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ System.out.println("123");
+ SkyscrapersCell cell = (SkyscrapersCell) element;
+ if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
+ //cell.setData(SkyscrapersType.BULB.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
similarity index 95%
rename from src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
index d28ed6cbd..57b724cd6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
@@ -1,117 +1,117 @@
-package edu.rpi.legup.puzzle.skyscrapers.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersBoard;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
-
-import java.util.ArrayList;
-
-public class LastVisibleCellBasicRule extends BasicRule {
-
- public LastVisibleCellBasicRule() {
- super("SKYS-BASC-0001", "Last Visible Cell",
- "There is only one cell on this row/col for this number that does not create a visibility contradiction",
- "edu/rpi/legup/images/skyscrapers/rules/FixedMax.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 index of the 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) {
- //last cell for number based on preemptive visibility rules
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
- SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
- SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
- SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
- if (initCell.getType() != SkyscrapersType.UNKNOWN || finalCell.getType() != SkyscrapersType.Number) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must transition from unknown to number";
- }
-
- //set all rules used by case rule to false except for dupe, get all cases
- boolean dupeTemp = initialBoard.getDupeFlag();
- boolean viewTemp = initialBoard.getViewFlag();
- initialBoard.setDupeFlag(false);
- initialBoard.setViewFlag(true);
- CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
- ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
- ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
- initialBoard.setDupeFlag(dupeTemp);
- initialBoard.setViewFlag(viewTemp);
-
- System.out.println(XCandidates.size());
- System.out.println(YCandidates.size());
-
- //return null if either pass, both messages otherwise
- String xCheck = candidateCheck(XCandidates,puzzleElement,finalCell);
- String yCheck = candidateCheck(YCandidates,puzzleElement,finalCell);
- if(xCheck==null || yCheck==null){
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + "\nRow" + xCheck + "\nCol" + yCheck;
- }
-
- //helper to check if candidate list is valid
- private String candidateCheck(ArrayList candidates,PuzzleElement puzzleElement, SkyscrapersCell finalCell){
- if(candidates.size() == 1){
- if(((SkyscrapersCell) candidates.get(0).getPuzzleElement(puzzleElement)).getType() == SkyscrapersType.Number) {
- if (candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()) {
- return null;
- }
- return ": Wrong number in the cell.";
- }
- return ": No case for this cell.";
- }
- return ": This cell is not forced.";
- }
-
- private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
- SkyscrapersBoard emptyCase = board.copy();
- emptyCase.getPuzzleElement(cell).setData(0);
- DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
- if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
- System.out.println("no contradiction ln");
- return true;
- }
- return false;
- }
-
- /**
- * 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
- SkyscrapersBoard modBoard = (SkyscrapersBoard) node.getBoard().copy();
- System.out.println(modBoard.getPuzzleElements().size());
- for (PuzzleElement element : modBoard.getPuzzleElements()) {
- System.out.println("123");
- SkyscrapersCell cell = (SkyscrapersCell) element;
- if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
- //cell.setData(SkyscrapersType.BULB.value);
- modBoard.addModifiedData(cell);
- }
- }
- System.out.println(modBoard.getModifiedData().isEmpty());
- if (modBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return modBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.skyscrapers.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.skyscrapers.SkyscrapersBoard;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
+
+import java.util.ArrayList;
+
+public class LastVisibleCellDirectRule extends DirectRule {
+
+ public LastVisibleCellDirectRule() {
+ super("SKYS-BASC-0001", "Last Visible Cell",
+ "There is only one cell on this row/col for this number that does not create a visibility contradiction",
+ "edu/rpi/legup/images/skyscrapers/rules/FixedMax.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 index of the 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) {
+ //last cell for number based on preemptive visibility rules
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
+ SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
+ SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
+ SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (initCell.getType() != SkyscrapersType.UNKNOWN || finalCell.getType() != SkyscrapersType.Number) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must transition from unknown to number";
+ }
+
+ //set all rules used by case rule to false except for dupe, get all cases
+ boolean dupeTemp = initialBoard.getDupeFlag();
+ boolean viewTemp = initialBoard.getViewFlag();
+ initialBoard.setDupeFlag(false);
+ initialBoard.setViewFlag(true);
+ CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
+ ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
+ ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
+ initialBoard.setDupeFlag(dupeTemp);
+ initialBoard.setViewFlag(viewTemp);
+
+ System.out.println(XCandidates.size());
+ System.out.println(YCandidates.size());
+
+ //return null if either pass, both messages otherwise
+ String xCheck = candidateCheck(XCandidates,puzzleElement,finalCell);
+ String yCheck = candidateCheck(YCandidates,puzzleElement,finalCell);
+ if(xCheck==null || yCheck==null){
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + "\nRow" + xCheck + "\nCol" + yCheck;
+ }
+
+ //helper to check if candidate list is valid
+ private String candidateCheck(ArrayList candidates,PuzzleElement puzzleElement, SkyscrapersCell finalCell){
+ if(candidates.size() == 1){
+ if(((SkyscrapersCell) candidates.get(0).getPuzzleElement(puzzleElement)).getType() == SkyscrapersType.Number) {
+ if (candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()) {
+ return null;
+ }
+ return ": Wrong number in the cell.";
+ }
+ return ": No case for this cell.";
+ }
+ return ": This cell is not forced.";
+ }
+
+ private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
+ SkyscrapersBoard emptyCase = board.copy();
+ emptyCase.getPuzzleElement(cell).setData(0);
+ DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
+ if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
+ System.out.println("no contradiction ln");
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
+ SkyscrapersBoard modBoard = (SkyscrapersBoard) node.getBoard().copy();
+ System.out.println(modBoard.getPuzzleElements().size());
+ for (PuzzleElement element : modBoard.getPuzzleElements()) {
+ System.out.println("123");
+ SkyscrapersCell cell = (SkyscrapersCell) element;
+ if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
+ //cell.setData(SkyscrapersType.BULB.value);
+ modBoard.addModifiedData(cell);
+ }
+ }
+ System.out.println(modBoard.getModifiedData().isEmpty());
+ if (modBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return modBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleNumberBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleNumberDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleNumberBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleNumberDirectRule.java
index 7a4a7210a..85a5068c6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleNumberBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleNumberDirectRule.java
@@ -1,99 +1,99 @@
-package edu.rpi.legup.puzzle.skyscrapers.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersBoard;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
-
-import java.util.ArrayList;
-
-public class LastVisibleNumberBasicRule extends BasicRule {
-
- public LastVisibleNumberBasicRule() {
- super("SKYS-BASC-0005", "Last Visible Number",
- "There is only one number for this cell that does not create a visibility contradiction",
- "edu/rpi/legup/images/skyscrapers/rules/OneEdge.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 index of the 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) {
- //last number for cell based upon preemptive visibility rules
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
- SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
- SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
- SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
- if (initCell.getType() != SkyscrapersType.UNKNOWN || finalCell.getType() != SkyscrapersType.Number) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must transition from unknown to number";
- }
-
- //set all rules used by case rule to false except for dupe, get all cases
- boolean dupeTemp = initialBoard.getDupeFlag();
- boolean viewTemp = initialBoard.getViewFlag();
- initialBoard.setDupeFlag(false);
- initialBoard.setViewFlag(true);
- NumberForCellCaseRule caseRule = new NumberForCellCaseRule();
- ArrayList candidates = caseRule.getCases(initialBoard,puzzleElement);
- initialBoard.setDupeFlag(dupeTemp);
- initialBoard.setViewFlag(viewTemp);
-
- //check if given value is the only remaining value
- if(candidates.size() == 1){
- if(candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()){
- return null;
- }
- return super.getInvalidUseOfRuleMessage() + ": Wrong number in the cell.";
- }
- return super.getInvalidUseOfRuleMessage() + ":This cell is not forced.";
- }
-
- private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
- SkyscrapersBoard emptyCase = board.copy();
- emptyCase.getPuzzleElement(cell).setData(0);
- DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
- if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
- System.out.println("no contradiction ln");
- return true;
- }
- return false;
- }
-
- /**
- * 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
- SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
- System.out.println(lightUpBoard.getPuzzleElements().size());
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- System.out.println("123");
- SkyscrapersCell cell = (SkyscrapersCell) element;
- if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
- //cell.setData(SkyscrapersType.BULB.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.skyscrapers.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.skyscrapers.SkyscrapersBoard;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
+
+import java.util.ArrayList;
+
+public class LastVisibleNumberDirectRule extends DirectRule {
+
+ public LastVisibleNumberDirectRule() {
+ super("SKYS-BASC-0005", "Last Visible Number",
+ "There is only one number for this cell that does not create a visibility contradiction",
+ "edu/rpi/legup/images/skyscrapers/rules/OneEdge.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 index of the 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) {
+ //last number for cell based upon preemptive visibility rules
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
+ SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
+ SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
+ SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (initCell.getType() != SkyscrapersType.UNKNOWN || finalCell.getType() != SkyscrapersType.Number) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must transition from unknown to number";
+ }
+
+ //set all rules used by case rule to false except for dupe, get all cases
+ boolean dupeTemp = initialBoard.getDupeFlag();
+ boolean viewTemp = initialBoard.getViewFlag();
+ initialBoard.setDupeFlag(false);
+ initialBoard.setViewFlag(true);
+ NumberForCellCaseRule caseRule = new NumberForCellCaseRule();
+ ArrayList candidates = caseRule.getCases(initialBoard,puzzleElement);
+ initialBoard.setDupeFlag(dupeTemp);
+ initialBoard.setViewFlag(viewTemp);
+
+ //check if given value is the only remaining value
+ if(candidates.size() == 1){
+ if(candidates.get(0).getPuzzleElement(puzzleElement).getData() == finalCell.getData()){
+ return null;
+ }
+ return super.getInvalidUseOfRuleMessage() + ": Wrong number in the cell.";
+ }
+ return super.getInvalidUseOfRuleMessage() + ":This cell is not forced.";
+ }
+
+ private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
+ SkyscrapersBoard emptyCase = board.copy();
+ emptyCase.getPuzzleElement(cell).setData(0);
+ DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
+ if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
+ System.out.println("no contradiction ln");
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
+ SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
+ System.out.println(lightUpBoard.getPuzzleElements().size());
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ System.out.println("123");
+ SkyscrapersCell cell = (SkyscrapersCell) element;
+ if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
+ //cell.setData(SkyscrapersType.BULB.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
index 3bea76813..2b07cbb45 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
@@ -1,103 +1,100 @@
-package edu.rpi.legup.puzzle.skyscrapers.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersBoard;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
-import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
-
-import java.awt.Point;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-public class NEdgeBasicRule extends BasicRule {
-
- public NEdgeBasicRule() {
- super("SKYS-BASC-0004", "N Edge",
- "If the maximum number appears on an edge, the row or column��s numbers appear in ascending order, starting at that edge.",
- "edu/rpi/legup/images/skyscrapers/rules/NEdge.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 index of the 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
- SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
- SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
- SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == SkyscrapersType.UNKNOWN && finalCell.getType() == SkyscrapersType.Number)) {
- return super.getInvalidUseOfRuleMessage() + ": Modified cells must be number";
- }
-
- SkyscrapersBoard emptyCase = initialBoard.copy();
- emptyCase.getPuzzleElement(finalCell).setData(0);
- Point loc = finalCell.getLocation();
- int max = initialBoard.getHeight();
-
- if (initialBoard.getWestClues().get(loc.y).getData() == max && finalCell.getData() == loc.x + 1) {
- return null;
- }
- if (initialBoard.getEastClues().get(loc.y).getData() == max && finalCell.getData() == max - loc.x) {
- return null;
- }
- if (initialBoard.getNorthClues().get(loc.x).getData() == max && finalCell.getData() == loc.y + 1) {
- return null;
- }
- if (initialBoard.getSouthClues().get(loc.x).getData() == max && finalCell.getData() == max - loc.y) {
- return null;
- }
-
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced.";
-
- }
-
- private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
- SkyscrapersBoard emptyCase = board.copy();
- emptyCase.getPuzzleElement(cell).setData(0);
- DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
- if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
- System.out.println("no contradiction ln");
- return true;
- }
- return false;
- }
-
- /**
- * 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) {
- SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
- SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
- System.out.println(lightUpBoard.getPuzzleElements().size());
- for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
- System.out.println("123");
- SkyscrapersCell cell = (SkyscrapersCell) element;
- if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
- //cell.setData(SkyscrapersType.BULB.value);
- lightUpBoard.addModifiedData(cell);
- }
- }
- if (lightUpBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return lightUpBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.skyscrapers.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.skyscrapers.SkyscrapersBoard;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersCell;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
+
+import java.awt.Point;
+
+public class NEdgeDirectRule extends DirectRule {
+
+ public NEdgeDirectRule() {
+ super("SKYS-BASC-0004", "N Edge",
+ "If the maximum number appears on an edge, the row or column��s numbers appear in ascending order, starting at that edge.",
+ "edu/rpi/legup/images/skyscrapers/rules/NEdge.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 index of the 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) transition.getParents().get(0).getBoard();
+ SkyscrapersCell initCell = (SkyscrapersCell) initialBoard.getPuzzleElement(puzzleElement);
+ SkyscrapersBoard finalBoard = (SkyscrapersBoard) transition.getBoard();
+ SkyscrapersCell finalCell = (SkyscrapersCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == SkyscrapersType.UNKNOWN && finalCell.getType() == SkyscrapersType.Number)) {
+ return super.getInvalidUseOfRuleMessage() + ": Modified cells must be number";
+ }
+
+ SkyscrapersBoard emptyCase = initialBoard.copy();
+ emptyCase.getPuzzleElement(finalCell).setData(0);
+ Point loc = finalCell.getLocation();
+ int max = initialBoard.getHeight();
+
+ if (initialBoard.getWestClues().get(loc.y).getData() == max && finalCell.getData() == loc.x + 1) {
+ return null;
+ }
+ if (initialBoard.getEastClues().get(loc.y).getData() == max && finalCell.getData() == max - loc.x) {
+ return null;
+ }
+ if (initialBoard.getNorthClues().get(loc.x).getData() == max && finalCell.getData() == loc.y + 1) {
+ return null;
+ }
+ if (initialBoard.getSouthClues().get(loc.x).getData() == max && finalCell.getData() == max - loc.y) {
+ return null;
+ }
+
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced.";
+
+ }
+
+ private boolean isForced(SkyscrapersBoard board, SkyscrapersCell cell) {
+ SkyscrapersBoard emptyCase = board.copy();
+ emptyCase.getPuzzleElement(cell).setData(0);
+ DuplicateNumberContradictionRule duplicate = new DuplicateNumberContradictionRule();
+ if (duplicate.checkContradictionAt(emptyCase, cell) == null) {
+ System.out.println("no contradiction ln");
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ SkyscrapersBoard initialBoard = (SkyscrapersBoard) node.getBoard();
+ SkyscrapersBoard lightUpBoard = (SkyscrapersBoard) node.getBoard().copy();
+ System.out.println(lightUpBoard.getPuzzleElements().size());
+ for (PuzzleElement element : lightUpBoard.getPuzzleElements()) {
+ System.out.println("123");
+ SkyscrapersCell cell = (SkyscrapersCell) element;
+ if (cell.getType() == SkyscrapersType.UNKNOWN && isForced(initialBoard, cell)) {
+ //cell.setData(SkyscrapersType.BULB.value);
+ lightUpBoard.addModifiedData(cell);
+ }
+ }
+ if (lightUpBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return lightUpBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/skyscrapers_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/skyscrapers_reference_sheet.txt
index d5ea4d0b8..21492fb0b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/skyscrapers_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/skyscrapers_reference_sheet.txt
@@ -1,9 +1,9 @@
RULE LIST:
- SKYS-BASC-0001 : LastVisibleNumberBasicRule
- SKYS-BASC-0002 : LastSingularCellBasicRule
- SKYS-BASC-0003 : LastSingularNumberBasicRule
- SKYS-BASC-0004 : NEdgeBasicRule
- SKYS-BASC-0005 : LastVisibleNumberBasicRule
+ SKYS-BASC-0001 : LastVisibleNumberDirectRule
+ SKYS-BASC-0002 : LastSingularCellDirectRule
+ SKYS-BASC-0003 : LastSingularNumberDirectRule
+ SKYS-BASC-0004 : NEdgeDirectRule
+ SKYS-BASC-0005 : LastVisibleNumberDirectRule
SKYS-CONT-0001 : DuplicateNumbersContradictionRule
SKYS-CONT-0002 : ExceedingVisibilityContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java
similarity index 93%
rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java
index 658a7386c..0be30fa36 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/AdvancedDeductionDirectRule.java
@@ -1,96 +1,96 @@
-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.BasicRule;
-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 AdvancedDeductionBasicRule extends BasicRule {
-
- public AdvancedDeductionBasicRule() {
- 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;
- }
-}
+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/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java
index 6766772cd..51d963247 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastCellForNumberDirectRule.java
@@ -1,93 +1,93 @@
-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.BasicRule;
-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 LastCellForNumberBasicRule extends BasicRule {
- public LastCellForNumberBasicRule() {
- 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);
- if (cell.getData() == 0) {
- return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index";
- }
-
- int size = initialBoard.getSize();
-
- 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()) {
- contains = true;
- break;
- }
- }
- if (!contains) {
- return null;
- }
- }
- if (row.size() == size - 1) {
- contains = false;
- for (SudokuCell c : row) {
- if (cell.getData() == c.getData()) {
- contains = true;
- break;
- }
- }
- if (!contains) {
- return null;
- }
- }
- if (col.size() == size - 1) {
- contains = false;
- for (SudokuCell c : col) {
- if (cell.getData() == c.getData()) {
- contains = true;
- break;
- }
- }
- if (!contains) {
- return null;
- }
- }
- 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;
- }
-}
+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);
+ if (cell.getData() == 0) {
+ return super.getInvalidUseOfRuleMessage() + ": Cell is not forced at this index";
+ }
+
+ int size = initialBoard.getSize();
+
+ 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()) {
+ contains = true;
+ break;
+ }
+ }
+ if (!contains) {
+ return null;
+ }
+ }
+ if (row.size() == size - 1) {
+ contains = false;
+ for (SudokuCell c : row) {
+ if (cell.getData() == c.getData()) {
+ contains = true;
+ break;
+ }
+ }
+ if (!contains) {
+ return null;
+ }
+ }
+ if (col.size() == size - 1) {
+ contains = false;
+ for (SudokuCell c : col) {
+ if (cell.getData() == c.getData()) {
+ contains = true;
+ break;
+ }
+ }
+ if (!contains) {
+ return null;
+ }
+ }
+ 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/LastNumberForCellBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java
similarity index 92%
rename from src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java
index 95ae503cd..28e64ce7b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/LastNumberForCellDirectRule.java
@@ -1,77 +1,77 @@
-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.BasicRule;
-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 LastNumberForCellBasicRule extends BasicRule {
-
- public LastNumberForCellBasicRule() {
- 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();
-
- int index = puzzleElement.getIndex();
- int groupSize = initialBoard.getWidth();
- int groupDim = (int) Math.sqrt(groupSize);
- int rowIndex = index / groupSize;
- int colIndex = index % groupSize;
- int groupNum = rowIndex / groupDim * groupDim + colIndex % groupDim;
- HashSet numbers = new HashSet<>();
- for (int i = 1; i <= groupSize; i++) {
- numbers.add(i);
- }
- 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);
- numbers.remove(cell.getData());
- }
- for (int i = 0; i < groupSize; i++) {
- SudokuCell cell = initialBoard.getCell(rowIndex, i);
- numbers.remove(cell.getData());
- }
- 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";
- }
- }
- 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;
- }
-}
+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();
+
+ int index = puzzleElement.getIndex();
+ int groupSize = initialBoard.getWidth();
+ int groupDim = (int) Math.sqrt(groupSize);
+ int rowIndex = index / groupSize;
+ int colIndex = index % groupSize;
+ int groupNum = rowIndex / groupDim * groupDim + colIndex % groupDim;
+ HashSet numbers = new HashSet<>();
+ for (int i = 1; i <= groupSize; i++) {
+ numbers.add(i);
+ }
+ 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);
+ numbers.remove(cell.getData());
+ }
+ for (int i = 0; i < groupSize; i++) {
+ SudokuCell cell = initialBoard.getCell(rowIndex, i);
+ numbers.remove(cell.getData());
+ }
+ 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";
+ }
+ }
+ 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/sudoku/rules/sudoku_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/sudoku/rules/sudoku_reference_sheet.txt
index 4b17b705a..a8635330d 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,6 +1,6 @@
-SUDO-BASC-0001 : AdvancedDeductionBasicRule
-SUDO-BASC-0002 : LastCellForNumberBasicRule
-SUDO-BASC-0003 : LastNumberForCellBasicRule
+SUDO-BASC-0001 : AdvancedDeductionDirectRule
+SUDO-BASC-0002 : LastCellForNumberDirectRule
+SUDO-BASC-0003 : LastNumberForCellDirectRule
SUDO-CONT-0001 : NoSolutionContradictionRule
SUDO-CONT-0002 : RepeatedNumberContradictionRule
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
index 38d39424e..f57602114 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
@@ -1,86 +1,86 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-
-import java.util.List;
-
-public class EmptyFieldBasicRule extends BasicRule {
- public EmptyFieldBasicRule() {
- super("TREE-BASC-0001", "Empty Field",
- "Blank cells not adjacent to an unlinked tree are grass.",
- "edu/rpi/legup/images/treetent/noTreesAround.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) {
- if (puzzleElement instanceof TreeTentLine) {
- return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule";
- }
- TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
- TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
- TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
- TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(finalCell.getType() == TreeTentType.GRASS && initCell.getType() == TreeTentType.UNKNOWN)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be grass";
- }
-
- if (isForced(finalBoard, finalCell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be empty.";
- }
- }
-
- /**
- * Returns a boolean value based on whether the specified cell has adjacent cells (true - no adjacent, false - has adjacent)
- * @param board the TreeTent board
- * @param cell the specified TreeTent cell
- * @return true - no adjacent, false - has adjacent
- */
- private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
- List adjCells = board.getAdjacent(cell, TreeTentType.TREE);
- return adjCells.isEmpty();
- }
-
- /**
- * 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) {
- TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
- for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
- TreeTentCell cell = (TreeTentCell) element;
- if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.GRASS.value);
- treeTentBoard.addModifiedData(cell);
- }
- }
- if (treeTentBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return treeTentBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.treetent.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.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+import edu.rpi.legup.puzzle.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+
+import java.util.List;
+
+public class EmptyFieldDirectRule extends DirectRule {
+ public EmptyFieldDirectRule() {
+ super("TREE-BASC-0001", "Empty Field",
+ "Blank cells not adjacent to an unlinked tree are grass.",
+ "edu/rpi/legup/images/treetent/noTreesAround.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) {
+ if (puzzleElement instanceof TreeTentLine) {
+ return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule";
+ }
+ TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
+ TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
+ TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
+ TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(finalCell.getType() == TreeTentType.GRASS && initCell.getType() == TreeTentType.UNKNOWN)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be grass";
+ }
+
+ if (isForced(finalBoard, finalCell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be empty.";
+ }
+ }
+
+ /**
+ * Returns a boolean value based on whether the specified cell has adjacent cells (true - no adjacent, false - has adjacent)
+ * @param board the TreeTent board
+ * @param cell the specified TreeTent cell
+ * @return true - no adjacent, false - has adjacent
+ */
+ private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
+ List adjCells = board.getAdjacent(cell, TreeTentType.TREE);
+ return adjCells.isEmpty();
+ }
+
+ /**
+ * 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) {
+ TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
+ for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
+ TreeTentCell cell = (TreeTentCell) element;
+ if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
+ cell.setData(TreeTentType.GRASS.value);
+ treeTentBoard.addModifiedData(cell);
+ }
+ }
+ if (treeTentBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return treeTentBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithGrassBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithGrassDirectRule.java
similarity index 93%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithGrassBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithGrassDirectRule.java
index 745a14c5e..680110cdb 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithGrassBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithGrassDirectRule.java
@@ -1,86 +1,86 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-
-import java.awt.*;
-import java.util.List;
-
-public class FinishWithGrassBasicRule extends BasicRule {
-
- public FinishWithGrassBasicRule() {
- super("TREE-BASC-0002", "Finish with Grass",
- "Grass can be added to finish a row or column that has reached its tent limit.",
- "edu/rpi/legup/images/treetent/finishGrass.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) {
- if (puzzleElement instanceof TreeTentLine) {
- return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule";
- }
- TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
- TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
- TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
- TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(finalCell.getType() == TreeTentType.GRASS && initCell.getType() == TreeTentType.UNKNOWN)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be grass.";
- }
-
- if (isForced(initialBoard, initCell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be grass.";
- }
- }
-
- private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
- Point loc = cell.getLocation();
- List tentsRow = board.getRowCol(loc.y, TreeTentType.TENT, true);
- List tentsCol = board.getRowCol(loc.x, TreeTentType.TENT, false);
-
- return tentsRow.size() >= board.getRowClues().get(loc.y).getData() ||
- tentsCol.size() >= board.getColClues().get(loc.x).getData();
- }
-
- /**
- * 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) {
- TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
- for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
- TreeTentCell cell = (TreeTentCell) element;
- if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.GRASS.value);
- treeTentBoard.addModifiedData(cell);
- }
- }
- if (treeTentBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return treeTentBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.treetent.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.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+import edu.rpi.legup.puzzle.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+
+import java.awt.*;
+import java.util.List;
+
+public class FinishWithGrassDirectRule extends DirectRule {
+
+ public FinishWithGrassDirectRule() {
+ super("TREE-BASC-0002", "Finish with Grass",
+ "Grass can be added to finish a row or column that has reached its tent limit.",
+ "edu/rpi/legup/images/treetent/finishGrass.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) {
+ if (puzzleElement instanceof TreeTentLine) {
+ return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule";
+ }
+ TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
+ TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
+ TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
+ TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(finalCell.getType() == TreeTentType.GRASS && initCell.getType() == TreeTentType.UNKNOWN)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be grass.";
+ }
+
+ if (isForced(initialBoard, initCell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be grass.";
+ }
+ }
+
+ private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
+ Point loc = cell.getLocation();
+ List tentsRow = board.getRowCol(loc.y, TreeTentType.TENT, true);
+ List tentsCol = board.getRowCol(loc.x, TreeTentType.TENT, false);
+
+ return tentsRow.size() >= board.getRowClues().get(loc.y).getData() ||
+ tentsCol.size() >= board.getColClues().get(loc.x).getData();
+ }
+
+ /**
+ * 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) {
+ TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
+ for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
+ TreeTentCell cell = (TreeTentCell) element;
+ if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
+ cell.setData(TreeTentType.GRASS.value);
+ treeTentBoard.addModifiedData(cell);
+ }
+ }
+ if (treeTentBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return treeTentBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithTentsBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithTentsDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithTentsBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithTentsDirectRule.java
index 0937b5edc..b4bf0e119 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithTentsBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/FinishWithTentsDirectRule.java
@@ -1,88 +1,88 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-
-import java.awt.*;
-import java.util.List;
-
-public class FinishWithTentsBasicRule extends BasicRule {
-
- public FinishWithTentsBasicRule() {
- super("TREE-BASC-0003", "Finish with Tents",
- "Tents can be added to finish a row or column that has one open spot per required tent.",
- "edu/rpi/legup/images/treetent/finishTent.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) {
- if (puzzleElement instanceof TreeTentLine) {
- return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule.";
- }
- TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
- TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
- TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
- TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == TreeTentType.UNKNOWN && finalCell.getType() == TreeTentType.TENT)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be a tent.";
- }
-
- if (isForced(initialBoard, initCell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be tent.";
- }
- }
-
- private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
- Point loc = cell.getLocation();
- List tentsRow = board.getRowCol(loc.y, TreeTentType.TENT, true);
- List unknownsRow = board.getRowCol(loc.y, TreeTentType.UNKNOWN, true);
- List tentsCol = board.getRowCol(loc.x, TreeTentType.TENT, false);
- List unknownsCol = board.getRowCol(loc.x, TreeTentType.UNKNOWN, false);
-
- return unknownsRow.size() <= board.getRowClues().get(loc.y).getData() - tentsRow.size() ||
- unknownsCol.size() <= board.getColClues().get(loc.x).getData() - tentsCol.size();
- }
-
- /**
- * 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) {
- TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
- for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
- TreeTentCell cell = (TreeTentCell) element;
- if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.TENT.value);
- treeTentBoard.addModifiedData(cell);
- }
- }
- if (treeTentBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return treeTentBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.treetent.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.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+import edu.rpi.legup.puzzle.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+
+import java.awt.*;
+import java.util.List;
+
+public class FinishWithTentsDirectRule extends DirectRule {
+
+ public FinishWithTentsDirectRule() {
+ super("TREE-BASC-0003", "Finish with Tents",
+ "Tents can be added to finish a row or column that has one open spot per required tent.",
+ "edu/rpi/legup/images/treetent/finishTent.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) {
+ if (puzzleElement instanceof TreeTentLine) {
+ return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule.";
+ }
+ TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
+ TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
+ TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
+ TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == TreeTentType.UNKNOWN && finalCell.getType() == TreeTentType.TENT)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be a tent.";
+ }
+
+ if (isForced(initialBoard, initCell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be tent.";
+ }
+ }
+
+ private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
+ Point loc = cell.getLocation();
+ List tentsRow = board.getRowCol(loc.y, TreeTentType.TENT, true);
+ List unknownsRow = board.getRowCol(loc.y, TreeTentType.UNKNOWN, true);
+ List tentsCol = board.getRowCol(loc.x, TreeTentType.TENT, false);
+ List unknownsCol = board.getRowCol(loc.x, TreeTentType.UNKNOWN, false);
+
+ return unknownsRow.size() <= board.getRowClues().get(loc.y).getData() - tentsRow.size() ||
+ unknownsCol.size() <= board.getColClues().get(loc.x).getData() - tentsCol.size();
+ }
+
+ /**
+ * 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) {
+ TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
+ for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
+ TreeTentCell cell = (TreeTentCell) element;
+ if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
+ cell.setData(TreeTentType.TENT.value);
+ treeTentBoard.addModifiedData(cell);
+ }
+ }
+ if (treeTentBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return treeTentBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/LastCampingSpotBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/LastCampingSpotDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/LastCampingSpotBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/LastCampingSpotDirectRule.java
index cd782a7e7..dd77f3f38 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/LastCampingSpotBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/LastCampingSpotDirectRule.java
@@ -1,103 +1,102 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-
-import java.awt.*;
-import java.util.List;
-
-public class LastCampingSpotBasicRule extends BasicRule {
-
- public LastCampingSpotBasicRule() {
- super("TREE-BASC-0004", "Last Camping Spot",
- "If an unlinked tree is adjacent to only one blank cell and not adjacent to any unlinked tents, the blank cell must be a tent.",
- "edu/rpi/legup/images/treetent/oneTentPosition.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) {
- if (puzzleElement instanceof TreeTentLine) {
- return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule.";
- }
- TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
- TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
- TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
- TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == TreeTentType.UNKNOWN && finalCell.getType() == TreeTentType.TENT)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be a tent.";
- }
-
- if (isForced(finalBoard, finalCell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be tent.";
- }
- }
-
- private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
- List adjTrees = board.getAdjacent(cell, TreeTentType.TREE);
- for (TreeTentCell c : adjTrees) {
- List unkAroundTree = board.getAdjacent(c, TreeTentType.UNKNOWN);
- List tntAroundTree = board.getAdjacent(c, TreeTentType.TENT);
- if (unkAroundTree.size() == 0) {
- if (tntAroundTree.size() == 1) {
- return true;
- }
- else {
- for (TreeTentCell t : tntAroundTree) {
- if (t == cell) {
- continue;
- }
- List treesAroundTents = board.getAdjacent(t, TreeTentType.TREE);
- if (treesAroundTents.size() == 1) {
- return false;
- }
- }
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * 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) {
- TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
- for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
- TreeTentCell cell = (TreeTentCell) element;
- if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.TENT.value);
- treeTentBoard.addModifiedData(cell);
- }
- }
- if (treeTentBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return treeTentBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.treetent.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.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+import edu.rpi.legup.puzzle.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+
+import java.util.List;
+
+public class LastCampingSpotDirectRule extends DirectRule {
+
+ public LastCampingSpotDirectRule() {
+ super("TREE-BASC-0004", "Last Camping Spot",
+ "If an unlinked tree is adjacent to only one blank cell and not adjacent to any unlinked tents, the blank cell must be a tent.",
+ "edu/rpi/legup/images/treetent/oneTentPosition.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) {
+ if (puzzleElement instanceof TreeTentLine) {
+ return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule.";
+ }
+ TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
+ TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
+ TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
+ TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == TreeTentType.UNKNOWN && finalCell.getType() == TreeTentType.TENT)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be a tent.";
+ }
+
+ if (isForced(finalBoard, finalCell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be tent.";
+ }
+ }
+
+ private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
+ List adjTrees = board.getAdjacent(cell, TreeTentType.TREE);
+ for (TreeTentCell c : adjTrees) {
+ List unkAroundTree = board.getAdjacent(c, TreeTentType.UNKNOWN);
+ List tntAroundTree = board.getAdjacent(c, TreeTentType.TENT);
+ if (unkAroundTree.size() == 0) {
+ if (tntAroundTree.size() == 1) {
+ return true;
+ }
+ else {
+ for (TreeTentCell t : tntAroundTree) {
+ if (t == cell) {
+ continue;
+ }
+ List treesAroundTents = board.getAdjacent(t, TreeTentType.TREE);
+ if (treesAroundTents.size() == 1) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 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) {
+ TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
+ for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
+ TreeTentCell cell = (TreeTentCell) element;
+ if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
+ cell.setData(TreeTentType.TENT.value);
+ treeTentBoard.addModifiedData(cell);
+ }
+ }
+ if (treeTentBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return treeTentBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/SurroundTentWithGrassBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/SurroundTentWithGrassDirectRule.java
similarity index 93%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/SurroundTentWithGrassBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/SurroundTentWithGrassDirectRule.java
index 806724038..9304fd79f 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/SurroundTentWithGrassBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/SurroundTentWithGrassDirectRule.java
@@ -1,82 +1,82 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-
-import java.util.List;
-
-public class SurroundTentWithGrassBasicRule extends BasicRule {
-
- public SurroundTentWithGrassBasicRule() {
- super("TREE-BASC-0005", "Surround Tent with Grass",
- "Blank cells adjacent or diagonal to a tent are grass.",
- "edu/rpi/legup/images/treetent/aroundTent.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) {
- if (puzzleElement instanceof TreeTentLine) {
- return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule.";
- }
- TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
- TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
- TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
- TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
- if (!(initCell.getType() == TreeTentType.UNKNOWN && finalCell.getType() == TreeTentType.GRASS)) {
- return super.getInvalidUseOfRuleMessage() + ": This cell must be a tent.";
- }
-
- if (isForced(initialBoard, initCell)) {
- return null;
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be tent.";
- }
- }
-
- private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
- List tents = board.getAdjacent(cell, TreeTentType.TENT);
- tents.addAll(board.getDiagonals(cell, TreeTentType.TENT));
- return !tents.isEmpty();
- }
-
- /**
- * 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) {
- TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
- for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
- TreeTentCell cell = (TreeTentCell) element;
- if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.GRASS.value);
- treeTentBoard.addModifiedData(cell);
- }
- }
- if (treeTentBoard.getModifiedData().isEmpty()) {
- return null;
- }
- else {
- return treeTentBoard;
- }
- }
-}
+package edu.rpi.legup.puzzle.treetent.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.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+import edu.rpi.legup.puzzle.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+
+import java.util.List;
+
+public class SurroundTentWithGrassDirectRule extends DirectRule {
+
+ public SurroundTentWithGrassDirectRule() {
+ super("TREE-BASC-0005", "Surround Tent with Grass",
+ "Blank cells adjacent or diagonal to a tent are grass.",
+ "edu/rpi/legup/images/treetent/aroundTent.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) {
+ if (puzzleElement instanceof TreeTentLine) {
+ return super.getInvalidUseOfRuleMessage() + ": Line is not valid for this rule.";
+ }
+ TreeTentBoard initialBoard = (TreeTentBoard) transition.getParents().get(0).getBoard();
+ TreeTentCell initCell = (TreeTentCell) initialBoard.getPuzzleElement(puzzleElement);
+ TreeTentBoard finalBoard = (TreeTentBoard) transition.getBoard();
+ TreeTentCell finalCell = (TreeTentCell) finalBoard.getPuzzleElement(puzzleElement);
+ if (!(initCell.getType() == TreeTentType.UNKNOWN && finalCell.getType() == TreeTentType.GRASS)) {
+ return super.getInvalidUseOfRuleMessage() + ": This cell must be a tent.";
+ }
+
+ if (isForced(initialBoard, initCell)) {
+ return null;
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This cell is not forced to be tent.";
+ }
+ }
+
+ private boolean isForced(TreeTentBoard board, TreeTentCell cell) {
+ List tents = board.getAdjacent(cell, TreeTentType.TENT);
+ tents.addAll(board.getDiagonals(cell, TreeTentType.TENT));
+ return !tents.isEmpty();
+ }
+
+ /**
+ * 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) {
+ TreeTentBoard treeTentBoard = (TreeTentBoard) node.getBoard().copy();
+ for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
+ TreeTentCell cell = (TreeTentCell) element;
+ if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
+ cell.setData(TreeTentType.GRASS.value);
+ treeTentBoard.addModifiedData(cell);
+ }
+ }
+ if (treeTentBoard.getModifiedData().isEmpty()) {
+ return null;
+ }
+ else {
+ return treeTentBoard;
+ }
+ }
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TentForTreeBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TentForTreeDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/TentForTreeBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/TentForTreeDirectRule.java
index 0f1c7d607..03a83e516 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TentForTreeBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TentForTreeDirectRule.java
@@ -1,124 +1,124 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-
-import java.util.ArrayList;
-
-import java.util.List;
-
-public class TentForTreeBasicRule extends BasicRule {
-
- public TentForTreeBasicRule() {
- super("TREE-BASC-0006", "Tent for Tree",
- "If only one unlinked tent and no blank cells are adjacent to an unlinked tree, the unlinked tree must link to the unlinked tent.",
- "edu/rpi/legup/images/treetent/NewTreeLink.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) {
- if (!(puzzleElement instanceof TreeTentLine)) {
- return super.getInvalidUseOfRuleMessage() + ": Lines must be created for this rule.";
- }
- TreeTentBoard board = (TreeTentBoard) transition.getBoard();
- TreeTentLine line = (TreeTentLine) board.getPuzzleElement(puzzleElement);
- TreeTentCell tree, tent;
- if (line.getC1().getType() == TreeTentType.TREE && line.getC2().getType() == TreeTentType.TENT) {
- tree = line.getC1();
- tent = line.getC2();
- }
- else {
- if (line.getC2().getType() == TreeTentType.TREE && line.getC1().getType() == TreeTentType.TENT) {
- tree = line.getC2();
- tent = line.getC1();
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This line must connect a tree to a tent.";
- }
- }
- int forced = isForced(board, tree, tent, line);
- if (forced == 1) {
- return null;
- }
- else {
- if (forced == -1) {
- return super.getInvalidUseOfRuleMessage() + ": This tree already has a link";
- }
- else {
- if (forced == -2) {
- return super.getInvalidUseOfRuleMessage() + ": This tent already has a link";
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This tree and tent don't need to be linked.";
- }
- }
- }
- }
-
- private Integer isForced(TreeTentBoard board, TreeTentCell tree, TreeTentCell tent, TreeTentLine line) {
- List adjTents = board.getAdjacent(tree, TreeTentType.TENT);
- adjTents.remove(tent);
- List lines = board.getLines();
- lines.remove(line);
- for (TreeTentLine l : lines) {
- ArrayList toRemove = new ArrayList<>();
- if (l.getC1().getLocation().equals(tree.getLocation()) || l.getC2().getLocation().equals(tree.getLocation())) {
- return -2;
- }
- for (TreeTentCell c : adjTents) {
- if (l.getC1().getLocation().equals(c.getLocation())) {
- if (l.getC2().getLocation().equals(tree.getLocation())) {
- return -1;
- }
- toRemove.add(c);
-
- }
- else {
- if (l.getC2().getLocation().equals(c.getLocation())) {
- if (l.getC1().getLocation().equals(tree.getLocation())) {
- return -1;
- }
- toRemove.add(c);
- }
- }
- }
- for (TreeTentCell c : toRemove) {
- adjTents.remove(c);
- }
- toRemove.clear();
- }
- if (adjTents.size() == 0) {
- return 1;
- }
- else {
- return 0;
- }
- }
-
- /**
- * 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.treetent.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.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+import edu.rpi.legup.puzzle.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+
+import java.util.ArrayList;
+
+import java.util.List;
+
+public class TentForTreeDirectRule extends DirectRule {
+
+ public TentForTreeDirectRule() {
+ super("TREE-BASC-0006", "Tent for Tree",
+ "If only one unlinked tent and no blank cells are adjacent to an unlinked tree, the unlinked tree must link to the unlinked tent.",
+ "edu/rpi/legup/images/treetent/NewTreeLink.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) {
+ if (!(puzzleElement instanceof TreeTentLine)) {
+ return super.getInvalidUseOfRuleMessage() + ": Lines must be created for this rule.";
+ }
+ TreeTentBoard board = (TreeTentBoard) transition.getBoard();
+ TreeTentLine line = (TreeTentLine) board.getPuzzleElement(puzzleElement);
+ TreeTentCell tree, tent;
+ if (line.getC1().getType() == TreeTentType.TREE && line.getC2().getType() == TreeTentType.TENT) {
+ tree = line.getC1();
+ tent = line.getC2();
+ }
+ else {
+ if (line.getC2().getType() == TreeTentType.TREE && line.getC1().getType() == TreeTentType.TENT) {
+ tree = line.getC2();
+ tent = line.getC1();
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This line must connect a tree to a tent.";
+ }
+ }
+ int forced = isForced(board, tree, tent, line);
+ if (forced == 1) {
+ return null;
+ }
+ else {
+ if (forced == -1) {
+ return super.getInvalidUseOfRuleMessage() + ": This tree already has a link";
+ }
+ else {
+ if (forced == -2) {
+ return super.getInvalidUseOfRuleMessage() + ": This tent already has a link";
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This tree and tent don't need to be linked.";
+ }
+ }
+ }
+ }
+
+ private Integer isForced(TreeTentBoard board, TreeTentCell tree, TreeTentCell tent, TreeTentLine line) {
+ List adjTents = board.getAdjacent(tree, TreeTentType.TENT);
+ adjTents.remove(tent);
+ List lines = board.getLines();
+ lines.remove(line);
+ for (TreeTentLine l : lines) {
+ ArrayList toRemove = new ArrayList<>();
+ if (l.getC1().getLocation().equals(tree.getLocation()) || l.getC2().getLocation().equals(tree.getLocation())) {
+ return -2;
+ }
+ for (TreeTentCell c : adjTents) {
+ if (l.getC1().getLocation().equals(c.getLocation())) {
+ if (l.getC2().getLocation().equals(tree.getLocation())) {
+ return -1;
+ }
+ toRemove.add(c);
+
+ }
+ else {
+ if (l.getC2().getLocation().equals(c.getLocation())) {
+ if (l.getC1().getLocation().equals(tree.getLocation())) {
+ return -1;
+ }
+ toRemove.add(c);
+ }
+ }
+ }
+ for (TreeTentCell c : toRemove) {
+ adjTents.remove(c);
+ }
+ toRemove.clear();
+ }
+ if (adjTents.size() == 0) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ }
+
+ /**
+ * 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/treetent/rules/TreeForTentBasicRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TreeForTentDirectRule.java
similarity index 94%
rename from src/main/java/edu/rpi/legup/puzzle/treetent/rules/TreeForTentBasicRule.java
rename to src/main/java/edu/rpi/legup/puzzle/treetent/rules/TreeForTentDirectRule.java
index 2d8690c58..63d43e9a4 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TreeForTentBasicRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/TreeForTentDirectRule.java
@@ -1,122 +1,122 @@
-package edu.rpi.legup.puzzle.treetent.rules;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import edu.rpi.legup.model.gameboard.Board;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import edu.rpi.legup.model.rules.BasicRule;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
-import edu.rpi.legup.puzzle.treetent.TreeTentLine;
-import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
-import edu.rpi.legup.puzzle.treetent.TreeTentType;
-import edu.rpi.legup.puzzle.treetent.TreeTentCell;
-
-public class TreeForTentBasicRule extends BasicRule {
- public TreeForTentBasicRule() {
- super("TREE-BASC-0007", "Tree for Tent",
- "If only one unlinked tree is adjacent to an unlinked tent, the unlinked tent must link to the unlinked tree.",
- "edu/rpi/legup/images/treetent/NewTentLink.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) {
- if (!(puzzleElement instanceof TreeTentLine)) {
- return super.getInvalidUseOfRuleMessage() + ": Lines must be created for this rule.";
- }
- TreeTentBoard board = (TreeTentBoard) transition.getBoard();
- TreeTentLine line = (TreeTentLine) board.getPuzzleElement(puzzleElement);
- TreeTentCell tree, tent;
- if (line.getC1().getType() == TreeTentType.TREE && line.getC2().getType() == TreeTentType.TENT) {
- tree = line.getC1();
- tent = line.getC2();
- }
- else {
- if (line.getC2().getType() == TreeTentType.TREE && line.getC1().getType() == TreeTentType.TENT) {
- tree = line.getC2();
- tent = line.getC1();
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This line must connect a tree to a tent.";
- }
- }
- int forced = isForced(board, tree, tent, line);
- if (forced == 1) {
- return null;
- }
- else {
- if (forced == -1) {
- return super.getInvalidUseOfRuleMessage() + ": This tent already has a link";
- }
- else {
- if (forced == -2) {
- return super.getInvalidUseOfRuleMessage() + ": This tree already has a link";
- }
- else {
- return super.getInvalidUseOfRuleMessage() + ": This tree and tent don't need to be linked.";
- }
- }
- }
- }
-
- private Integer isForced(TreeTentBoard board, TreeTentCell tree, TreeTentCell tent, TreeTentLine line) {
- List adjTrees = board.getAdjacent(tent, TreeTentType.TREE);
- adjTrees.remove(tree);
- List lines = board.getLines();
- lines.remove(line);
- for (TreeTentLine l : lines) {
- ArrayList toRemove = new ArrayList<>();
- if (l.getC1().getLocation().equals(tree.getLocation()) || l.getC2().getLocation().equals(tree.getLocation())) {
- return -2;
- }
- for (TreeTentCell c : adjTrees) {
- if (l.getC1().getLocation().equals(c.getLocation())) {
- if (l.getC2().getLocation().equals(tent.getLocation())) {
- return -1;
- }
- toRemove.add(c);
-
- }
- else {
- if (l.getC2().getLocation().equals(c.getLocation())) {
- if (l.getC1().getLocation().equals(tent.getLocation())) {
- return -1;
- }
- toRemove.add(c);
- }
- }
- }
- for (TreeTentCell c : toRemove) {
- adjTrees.remove(c);
- }
- toRemove.clear();
- }
- if (adjTrees.size() == 0) {
- return 1;
- }
- else {
- return 0;
- }
- }
-
- /**
- * 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.treetent.rules;
+
+import java.util.List;
+import java.util.ArrayList;
+
+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.treetent.TreeTentLine;
+import edu.rpi.legup.puzzle.treetent.TreeTentBoard;
+import edu.rpi.legup.puzzle.treetent.TreeTentType;
+import edu.rpi.legup.puzzle.treetent.TreeTentCell;
+
+public class TreeForTentDirectRule extends DirectRule {
+ public TreeForTentDirectRule() {
+ super("TREE-BASC-0007", "Tree for Tent",
+ "If only one unlinked tree is adjacent to an unlinked tent, the unlinked tent must link to the unlinked tree.",
+ "edu/rpi/legup/images/treetent/NewTentLink.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) {
+ if (!(puzzleElement instanceof TreeTentLine)) {
+ return super.getInvalidUseOfRuleMessage() + ": Lines must be created for this rule.";
+ }
+ TreeTentBoard board = (TreeTentBoard) transition.getBoard();
+ TreeTentLine line = (TreeTentLine) board.getPuzzleElement(puzzleElement);
+ TreeTentCell tree, tent;
+ if (line.getC1().getType() == TreeTentType.TREE && line.getC2().getType() == TreeTentType.TENT) {
+ tree = line.getC1();
+ tent = line.getC2();
+ }
+ else {
+ if (line.getC2().getType() == TreeTentType.TREE && line.getC1().getType() == TreeTentType.TENT) {
+ tree = line.getC2();
+ tent = line.getC1();
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This line must connect a tree to a tent.";
+ }
+ }
+ int forced = isForced(board, tree, tent, line);
+ if (forced == 1) {
+ return null;
+ }
+ else {
+ if (forced == -1) {
+ return super.getInvalidUseOfRuleMessage() + ": This tent already has a link";
+ }
+ else {
+ if (forced == -2) {
+ return super.getInvalidUseOfRuleMessage() + ": This tree already has a link";
+ }
+ else {
+ return super.getInvalidUseOfRuleMessage() + ": This tree and tent don't need to be linked.";
+ }
+ }
+ }
+ }
+
+ private Integer isForced(TreeTentBoard board, TreeTentCell tree, TreeTentCell tent, TreeTentLine line) {
+ List adjTrees = board.getAdjacent(tent, TreeTentType.TREE);
+ adjTrees.remove(tree);
+ List lines = board.getLines();
+ lines.remove(line);
+ for (TreeTentLine l : lines) {
+ ArrayList toRemove = new ArrayList<>();
+ if (l.getC1().getLocation().equals(tree.getLocation()) || l.getC2().getLocation().equals(tree.getLocation())) {
+ return -2;
+ }
+ for (TreeTentCell c : adjTrees) {
+ if (l.getC1().getLocation().equals(c.getLocation())) {
+ if (l.getC2().getLocation().equals(tent.getLocation())) {
+ return -1;
+ }
+ toRemove.add(c);
+
+ }
+ else {
+ if (l.getC2().getLocation().equals(c.getLocation())) {
+ if (l.getC1().getLocation().equals(tent.getLocation())) {
+ return -1;
+ }
+ toRemove.add(c);
+ }
+ }
+ }
+ for (TreeTentCell c : toRemove) {
+ adjTrees.remove(c);
+ }
+ toRemove.clear();
+ }
+ if (adjTrees.size() == 0) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ }
+
+ /**
+ * 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/treetent/rules/treetent_reference_sheet.txt b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/treetent_reference_sheet.txt
index c05f12924..d1adc7654 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/treetent_reference_sheet.txt
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/treetent_reference_sheet.txt
@@ -1,10 +1,10 @@
-TREE-BASC-0001 : EmptyFieldBasicRule
-TREE-BASC-0002 : FinishWithGrassBasicRule
-TREE-BASC-0003 : FinishWithTentsBasicRule
-TREE-BASC-0004 : LastCampingSpotBasicRule
-TREE-BASC-0005 : SurroundTentWithGrassBasicRule
-TREE-BASC-0006 : TentForTreeBasicRule
-TREE-BASC-0007 : TreeForTentBasicRule
+TREE-BASC-0001 : EmptyFieldDirectRule
+TREE-BASC-0002 : FinishWithGrassDirectRule
+TREE-BASC-0003 : FinishWithTentsDirectRule
+TREE-BASC-0004 : LastCampingSpotDirectRule
+TREE-BASC-0005 : SurroundTentWithGrassDirectRule
+TREE-BASC-0006 : TentForTreeDirectRule
+TREE-BASC-0007 : TreeForTentDirectRule
TREE-CONT-0001 : NoTentForTreeContradictionRule
TREE-CONT-0002 : NoTreeForTentContradictionRule
diff --git a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
index 2bae648b2..de8a0f7e4 100644
--- a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
@@ -205,7 +205,7 @@ private JScrollPane createPuzzleTab(Puzzle puzzle) {
contentPane.add(createLeftLabel("Basic Rules"));
contentPane.add(createLineSeparator());
contentPane.add(Box.createRigidArea(new Dimension(0, 5)));
- for (Rule rule : puzzle.getBasicRules()) {
+ for (Rule rule : puzzle.getDirectRules()) {
JPanel ruleRow = createRuleRow(rule);
contentPane.add(ruleRow);
contentPane.add(Box.createRigidArea(new Dimension(0, 5)));
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index e661a4336..c97416437 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -711,7 +711,7 @@ public void setPuzzleView(Puzzle puzzle) {
puzzle.addTreeListener(treePanel.getTreeView());
puzzle.addBoardListener(puzzle.getBoardView());
- ruleFrame.getBasicRulePanel().setRules(puzzle.getBasicRules());
+ ruleFrame.getDirectRulePanel().setRules(puzzle.getDirectRules());
ruleFrame.getCasePanel().setRules(puzzle.getCaseRules());
ruleFrame.getContradictionPanel().setRules(puzzle.getContradictionRules());
//ruleFrame.getSearchPanel().setRules(puzzle.getContradictionRules());
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/BasicRulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
similarity index 65%
rename from src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/BasicRulePanel.java
rename to src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
index 4e9bbd62a..e12bc7081 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/BasicRulePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
@@ -1,22 +1,22 @@
-package edu.rpi.legup.ui.proofeditorui.rulesview;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import javax.swing.ImageIcon;
-
-public class BasicRulePanel extends RulePanel {
- private static final Logger LOGGER = LogManager.getLogger(BasicRulePanel.class.getName());
-
- /**
- * BasicRulePanel Constructor creates a basic rule panel
- *
- * @param ruleFrame rule frame that this basic rule panel is contained in
- */
- BasicRulePanel(RuleFrame ruleFrame) {
- super(ruleFrame);
- this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Basic Rules.gif"));
- this.name = "Basic Rules";
- this.toolTip = "Basic Rules";
- }
+package edu.rpi.legup.ui.proofeditorui.rulesview;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import javax.swing.ImageIcon;
+
+public class DirectRulePanel extends RulePanel {
+ private static final Logger LOGGER = LogManager.getLogger(DirectRulePanel.class.getName());
+
+ /**
+ * DirectRulePanel Constructor creates a basic rule panel
+ *
+ * @param ruleFrame rule frame that this basic rule panel is contained in
+ */
+ DirectRulePanel(RuleFrame ruleFrame) {
+ super(ruleFrame);
+ this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Basic Rules.gif"));
+ this.name = "Basic Rules";
+ this.toolTip = "Basic Rules";
+ }
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java
index d3e3799f9..73f8b9104 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java
@@ -19,7 +19,7 @@ public class RuleFrame extends JPanel {
private static final String htmlHead = "";
private static final String htmlTail = "";
- private BasicRulePanel basicRulePanel;
+ private DirectRulePanel DirectRulePanel;
private ContradictionRulePanel contradictionPanel;
private CaseRulePanel casePanel;
@@ -48,10 +48,10 @@ protected boolean shouldRotateTabRuns(int i) {
this.status = new JLabel();
this.buttonGroup = new ButtonGroup();
- basicRulePanel = new BasicRulePanel(this);
- JScrollPane newbrp = new JScrollPane(basicRulePanel);
+ DirectRulePanel = new DirectRulePanel(this);
+ JScrollPane newbrp = new JScrollPane(DirectRulePanel);
newbrp.getVerticalScrollBar().setUnitIncrement(16);
- tabbedPane.addTab(basicRulePanel.getName(), basicRulePanel.getIcon(), newbrp, basicRulePanel.getToolTip());
+ tabbedPane.addTab(DirectRulePanel.getName(), DirectRulePanel.getIcon(), newbrp, DirectRulePanel.getToolTip());
casePanel = new CaseRulePanel(this);
JScrollPane newcp = new JScrollPane(casePanel);
@@ -90,7 +90,7 @@ public ButtonGroup getButtonGroup() {
}
public void setSelectionByRule(Rule rule) {
- basicRulePanel.setSelectionByRule(rule);
+ DirectRulePanel.setSelectionByRule(rule);
casePanel.setSelectionByRule(rule);
contradictionPanel.setSelectionByRule(rule);
@@ -136,7 +136,7 @@ public void setStatus(boolean check, String text) {
* @param puzzle edu.rpi.legup.puzzle game
*/
public void setRules(Puzzle puzzle) {
- basicRulePanel.setRules(puzzle.getBasicRules());
+ DirectRulePanel.setRules(puzzle.getDirectRules());
contradictionPanel.setRules(puzzle.getContradictionRules());
casePanel.setRules(puzzle.getCaseRules());
@@ -164,8 +164,8 @@ public JTabbedPane getTabbedPane() {
return tabbedPane;
}
- public BasicRulePanel getBasicRulePanel() {
- return basicRulePanel;
+ public DirectRulePanel getDirectRulePanel() {
+ return DirectRulePanel;
}
public CaseRulePanel getCasePanel() {
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
index 78a07cdda..f0deab1d6 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
@@ -85,7 +85,7 @@ public void setRules(List extends Rule> rules) {
public void searchForRule(Puzzle puzzle, String ruleName) {
List> allrules = new ArrayList>(3);
- allrules.add(0, puzzle.getBasicRules());
+ allrules.add(0, puzzle.getDirectRules());
allrules.add(1, puzzle.getCaseRules());
allrules.add(2, puzzle.getContradictionRules());
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
index 5cea77d8f..4bfbbd69f 100644
--- a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
@@ -4,7 +4,7 @@
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
-public class EmptyCellinLightBasicRuleTest {
+public class EmptyCellinLightDirectRuleTest {
private static LightUp lightUp;
@BeforeClass
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
index cbec500f6..7596a4bbc 100644
--- a/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
@@ -4,7 +4,7 @@
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
-public class EmptyCornersBasicRuleTest {
+public class EmptyCornersDirectRuleTest {
private static LightUp lightUp;
@BeforeClass
diff --git a/src/test/java/puzzles/lightup/rules/FinishWithBulbsBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/FinishWithBulbsBasicRuleTest.java
index 2f27b4d14..56c381d1f 100644
--- a/src/test/java/puzzles/lightup/rules/FinishWithBulbsBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/FinishWithBulbsBasicRuleTest.java
@@ -4,7 +4,7 @@
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
-public class FinishWithBulbsBasicRuleTest {
+public class FinishWithBulbsDirectRuleTest {
private static LightUp lightUp;
@BeforeClass
diff --git a/src/test/java/puzzles/lightup/rules/FinishWithEmptyBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/FinishWithEmptyBasicRuleTest.java
index 833c64eb9..a5195b2ce 100644
--- a/src/test/java/puzzles/lightup/rules/FinishWithEmptyBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/FinishWithEmptyBasicRuleTest.java
@@ -4,7 +4,7 @@
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
-public class FinishWithEmptyBasicRuleTest {
+public class FinishWithEmptyDirectRuleTest {
private static LightUp lightUp;
@BeforeClass
diff --git a/src/test/java/puzzles/lightup/rules/MustLightBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/MustLightBasicRuleTest.java
index db983aa11..a9ae7c718 100644
--- a/src/test/java/puzzles/lightup/rules/MustLightBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/MustLightBasicRuleTest.java
@@ -4,7 +4,7 @@
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
-public class MustLightBasicRuleTest {
+public class MustLightDirectRuleTest {
private static LightUp lightUp;
@BeforeClass
diff --git a/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java
similarity index 84%
rename from src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java
index ae40ba6cb..66c797be2 100644
--- a/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java
@@ -1,154 +1,154 @@
-package puzzles.nurikabe.rules;
-
-//import javafx.scene.layout.Pane;
-
-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 edu.rpi.legup.puzzle.nurikabe.rules.BlackBetweenRegionsBasicRule;
-import edu.rpi.legup.save.InvalidFileFormatException;
-
-import java.awt.*;
-
-public class BlackBetweenRegionsBasicRuleTest {
-
- private static final BlackBetweenRegionsBasicRule RULE = new BlackBetweenRegionsBasicRule();
- private static Nurikabe nurikabe;
-
- @BeforeClass
- public static void setUp() {
- MockGameBoardFacade.getInstance();
- nurikabe = new Nurikabe();
- }
-
- @Test
- public void BlackBetweenRegionsBasicRule_DiagonalBlackBetweenRegions1Test() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/DiagonalBlackBetweenRegions1", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
-
- NurikabeCell cell1 = board.getCell(2, 1);
- cell1.setData(NurikabeType.BLACK.toValue());
- NurikabeCell cell2 = board.getCell(1, 2);
- cell2.setData(NurikabeType.BLACK.toValue());
-
- board.addModifiedData(cell1);
- board.addModifiedData(cell2);
-
- 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())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void BlackBetweenRegionsBasicRule_DiagonalBlackBetweenRegions2Test() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/DiagonalBlackBetweenRegions2", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
-
- NurikabeCell cell1 = board.getCell(1, 1);
- cell1.setData(NurikabeType.BLACK.toValue());
- NurikabeCell cell2 = board.getCell(2, 2);
- cell2.setData(NurikabeType.BLACK.toValue());
-
- board.addModifiedData(cell1);
- board.addModifiedData(cell2);
-
- 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())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void BlackBetweenRegionsBasicRule_HorizontalBlackBetweenRegionsTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/HorizontalBlackBetweenRegions", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
-
- NurikabeCell cell = board.getCell(1, 1);
- cell.setData(NurikabeType.BLACK.toValue());
-
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void BlackBetweenRegionsBasicRule_VerticalBlackBetweenRegionsTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/VerticalBlackBetweenRegions", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
-
- NurikabeCell cell = board.getCell(1, 1);
- cell.setData(NurikabeType.BLACK.toValue());
-
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-}
+package puzzles.nurikabe.rules;
+
+//import javafx.scene.layout.Pane;
+
+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 edu.rpi.legup.puzzle.nurikabe.rules.BlackBetweenRegionsDirectRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
+import java.awt.*;
+
+public class BlackBetweenRegionsDirectRuleTest {
+
+ private static final BlackBetweenRegionsDirectRule RULE = new BlackBetweenRegionsDirectRule();
+ private static Nurikabe nurikabe;
+
+ @BeforeClass
+ public static void setUp() {
+ MockGameBoardFacade.getInstance();
+ nurikabe = new Nurikabe();
+ }
+
+ @Test
+ public void BlackBetweenRegionsDirectRule_DiagonalBlackBetweenRegions1Test() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/DiagonalBlackBetweenRegions1", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+
+ NurikabeCell cell1 = board.getCell(2, 1);
+ cell1.setData(NurikabeType.BLACK.toValue());
+ NurikabeCell cell2 = board.getCell(1, 2);
+ cell2.setData(NurikabeType.BLACK.toValue());
+
+ board.addModifiedData(cell1);
+ board.addModifiedData(cell2);
+
+ 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())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void BlackBetweenRegionsDirectRule_DiagonalBlackBetweenRegions2Test() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/DiagonalBlackBetweenRegions2", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+
+ NurikabeCell cell1 = board.getCell(1, 1);
+ cell1.setData(NurikabeType.BLACK.toValue());
+ NurikabeCell cell2 = board.getCell(2, 2);
+ cell2.setData(NurikabeType.BLACK.toValue());
+
+ board.addModifiedData(cell1);
+ board.addModifiedData(cell2);
+
+ 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())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void BlackBetweenRegionsDirectRule_HorizontalBlackBetweenRegionsTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/HorizontalBlackBetweenRegions", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+
+ NurikabeCell cell = board.getCell(1, 1);
+ cell.setData(NurikabeType.BLACK.toValue());
+
+ board.addModifiedData(cell);
+
+ 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(cell.getLocation())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void BlackBetweenRegionsBasicRule_VerticalBlackBetweenRegionsTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/VerticalBlackBetweenRegions", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+
+ NurikabeCell cell = board.getCell(1, 1);
+ cell.setData(NurikabeType.BLACK.toValue());
+
+ board.addModifiedData(cell);
+
+ 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(cell.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/java/puzzles/nurikabe/rules/CornerBlackBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/CornerBlackDirectRuleTest.java
similarity index 79%
rename from src/test/java/puzzles/nurikabe/rules/CornerBlackBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/CornerBlackDirectRuleTest.java
index b0b198e2c..2b23754f3 100644
--- a/src/test/java/puzzles/nurikabe/rules/CornerBlackBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/CornerBlackDirectRuleTest.java
@@ -1,52 +1,45 @@
-package puzzles.nurikabe.rules;
-
-import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
-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.rules.CornerBlackBasicRule;
-import edu.rpi.legup.save.InvalidFileFormatException;
-
-import java.awt.*;
-
-public class CornerBlackBasicRuleTest {
-
- private static final CornerBlackBasicRule RULE = new CornerBlackBasicRule();
- private static Nurikabe nurikabe;
-
- @BeforeClass
- public static void setUp() {
- MockGameBoardFacade.getInstance();
- nurikabe = new Nurikabe();
- }
-
- @Test
- public void CornerBlackContradictionRule_SimpleCornerBlackTest() throws InvalidFileFormatException {
-// TestUtilities.importTestBoard("puzzles/nurikabe/rules/TooFewSpacesContradictionRule/TwoSurroundBlack", nurikabe);
-// TreeNode rootNode = nurikabe.getTree().getRootNode();
-// TreeTransition transition = rootNode.getChildren().get(0);
-// transition.setRule(RULE);
-//
-// transition.getBoard().getModifiedData().clear();
-//
-// Assert.assertNull(RULE.checkRule(transition));
-//
-// NurikabeBoard board = (NurikabeBoard)transition.getBoard();
-// Point location = new Point(1, 1);
-// 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(location)) {
-// Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
-// } else {
-// Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
-// }
-// }
-// }
- }
-}
+package puzzles.nurikabe.rules;
+
+import legup.MockGameBoardFacade;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import edu.rpi.legup.puzzle.nurikabe.Nurikabe;
+import edu.rpi.legup.puzzle.nurikabe.rules.CornerBlackDirectRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
+public class CornerBlackDirectRuleTest {
+
+ private static final CornerBlackDirectRule RULE = new CornerBlackDirectRule();
+ private static Nurikabe nurikabe;
+
+ @BeforeClass
+ public static void setUp() {
+ MockGameBoardFacade.getInstance();
+ nurikabe = new Nurikabe();
+ }
+
+ @Test
+ public void CornerBlackContradictionRule_SimpleCornerBlackTest() throws InvalidFileFormatException {
+// TestUtilities.importTestBoard("puzzles/nurikabe/rules/TooFewSpacesContradictionRule/TwoSurroundBlack", nurikabe);
+// TreeNode rootNode = nurikabe.getTree().getRootNode();
+// TreeTransition transition = rootNode.getChildren().get(0);
+// transition.setRule(RULE);
+//
+// transition.getBoard().getModifiedData().clear();
+//
+// Assert.assertNull(RULE.checkRule(transition));
+//
+// NurikabeBoard board = (NurikabeBoard)transition.getBoard();
+// Point location = new Point(1, 1);
+// 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(location)) {
+// Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+// } else {
+// Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+// }
+// }
+// }
+ }
+}
diff --git a/src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java
index 46bd73bce..5ad57f01b 100644
--- a/src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java
@@ -11,7 +11,7 @@
import edu.rpi.legup.puzzle.nurikabe.NurikabeBoard;
import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
-import edu.rpi.legup.puzzle.nurikabe.rules.FillinBlackBasicRule;
+import edu.rpi.legup.puzzle.nurikabe.rules.FillinBlackDirectRule;
import edu.rpi.legup.save.InvalidFileFormatException;
import java.awt.*;
diff --git a/src/test/java/puzzles/nurikabe/rules/FillinWhiteBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/FillinWhiteDirectRuleTest.java
similarity index 68%
rename from src/test/java/puzzles/nurikabe/rules/FillinWhiteBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/FillinWhiteDirectRuleTest.java
index 7e6e92950..dbc664a15 100644
--- a/src/test/java/puzzles/nurikabe/rules/FillinWhiteBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/FillinWhiteDirectRuleTest.java
@@ -1,55 +1,46 @@
-package puzzles.nurikabe.rules;
-
-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 edu.rpi.legup.puzzle.nurikabe.rules.FillinWhiteBasicRule;
-import edu.rpi.legup.save.InvalidFileFormatException;
-
-import java.awt.*;
-
-public class FillinWhiteBasicRuleTest {
- private static final FillinWhiteBasicRule RULE = new FillinWhiteBasicRule();
- private static Nurikabe nurikabe;
-
- @BeforeClass
- public static void setUp() {
- MockGameBoardFacade.getInstance();
- nurikabe = new Nurikabe();
- }
-
- @Test
- public void FillinWhiteBasicRule_UnknownSurroundWhiteTest() throws InvalidFileFormatException {
-// TestUtilities.importTestBoard("puzzles/nurikabe/rules/FillinWhiteBasicRule/UnknownSurroundWhite", nurikabe);
-// TreeNode rootNode = nurikabe.getTree().getRootNode();
-// TreeTransition transition = rootNode.getChildren().get(0);
-// transition.setRule(RULE);
-//
-// NurikabeBoard board = (NurikabeBoard) transition.getBoard();
-// NurikabeCell cell = board.getCell(1,1);
-// cell.setData(NurikabeType.WHITE.toValue());
-// board.addModifiedData(cell);
-//
-// Assert.assertNull(RULE.checkRule(transition));
-//
-// Point location = new Point(1, 1);
-// 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(location)) {
-// Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
-// } else {
-// Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
-// }
-// }
-// }
- }
-}
+package puzzles.nurikabe.rules;
+
+import legup.MockGameBoardFacade;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import edu.rpi.legup.puzzle.nurikabe.Nurikabe;
+import edu.rpi.legup.puzzle.nurikabe.rules.FillinWhiteDirectRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
+public class FillinWhiteDirectRuleTest {
+ private static final FillinWhiteDirectRule RULE = new FillinWhiteDirectRule();
+ private static Nurikabe nurikabe;
+
+ @BeforeClass
+ public static void setUp() {
+ MockGameBoardFacade.getInstance();
+ nurikabe = new Nurikabe();
+ }
+
+ @Test
+ public void FillinWhiteDirectRule_UnknownSurroundWhiteTest() throws InvalidFileFormatException {
+// TestUtilities.importTestBoard("puzzles/nurikabe/rules/FillinWhiteDirectRule/UnknownSurroundWhite", nurikabe);
+// TreeNode rootNode = nurikabe.getTree().getRootNode();
+// TreeTransition transition = rootNode.getChildren().get(0);
+// transition.setRule(RULE);
+//
+// NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+// NurikabeCell cell = board.getCell(1,1);
+// cell.setData(NurikabeType.WHITE.toValue());
+// board.addModifiedData(cell);
+//
+// Assert.assertNull(RULE.checkRule(transition));
+//
+// Point location = new Point(1, 1);
+// 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(location)) {
+// Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+// } else {
+// Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+// }
+// }
+// }
+ }
+}
diff --git a/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java
similarity index 89%
rename from src/test/java/puzzles/nurikabe/rules/PreventBlackSquareBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java
index b14dc4c43..d8e0e6e77 100644
--- a/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java
@@ -1,137 +1,137 @@
-package puzzles.nurikabe.rules;
-
-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 edu.rpi.legup.puzzle.nurikabe.rules.PreventBlackSquareBasicRule;
-import edu.rpi.legup.save.InvalidFileFormatException;
-
-import java.awt.*;
-
-public class PreventBlackSquareBasicRuleTest {
-
- private static final PreventBlackSquareBasicRule RULE = new PreventBlackSquareBasicRule();
- private static Nurikabe nurikabe;
-
- @BeforeClass
- public static void setUp() {
- MockGameBoardFacade.getInstance();
- nurikabe = new Nurikabe();
- }
-
- @Test
- public void PreventBlackSquareBasicRule_BottomLeftWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell = board.getCell(0, 1);
- cell.setData(NurikabeType.WHITE.toValue());
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void PreventBlackSquareBasicRule_BottomRightWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell = board.getCell(1, 1);
- cell.setData(NurikabeType.WHITE.toValue());
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void PreventBlackSquareBasicRule_TopLeftWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell = board.getCell(0, 0);
- cell.setData(NurikabeType.WHITE.toValue());
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void PreventBlackSquareBasicRule_TopRightWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell = board.getCell(1, 0);
- cell.setData(NurikabeType.WHITE.toValue());
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-}
+package puzzles.nurikabe.rules;
+
+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 edu.rpi.legup.puzzle.nurikabe.rules.PreventBlackSquareDirectRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
+import java.awt.*;
+
+public class PreventBlackSquareDirectRuleTest {
+
+ private static final PreventBlackSquareDirectRule RULE = new PreventBlackSquareDirectRule();
+ private static Nurikabe nurikabe;
+
+ @BeforeClass
+ public static void setUp() {
+ MockGameBoardFacade.getInstance();
+ nurikabe = new Nurikabe();
+ }
+
+ @Test
+ public void PreventBlackSquareDirectRule_BottomLeftWhiteBlackSquareTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareDirectRule/BottomLeftWhiteBlackSquare", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell = board.getCell(0, 1);
+ cell.setData(NurikabeType.WHITE.toValue());
+ board.addModifiedData(cell);
+
+ 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(cell.getLocation())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void PreventBlackSquareDirectRule_BottomRightWhiteBlackSquareTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell = board.getCell(1, 1);
+ cell.setData(NurikabeType.WHITE.toValue());
+ board.addModifiedData(cell);
+
+ 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(cell.getLocation())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void PreventBlackSquareBasicRule_TopLeftWhiteBlackSquareTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell = board.getCell(0, 0);
+ cell.setData(NurikabeType.WHITE.toValue());
+ board.addModifiedData(cell);
+
+ 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(cell.getLocation())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void PreventBlackSquareBasicRule_TopRightWhiteBlackSquareTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell = board.getCell(1, 0);
+ cell.setData(NurikabeType.WHITE.toValue());
+ board.addModifiedData(cell);
+
+ 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(cell.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/java/puzzles/nurikabe/rules/SurroundRegionBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/SurroundRegionDirectRuleTest.java
similarity index 84%
rename from src/test/java/puzzles/nurikabe/rules/SurroundRegionBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/SurroundRegionDirectRuleTest.java
index c1ffe679a..ce89daea6 100644
--- a/src/test/java/puzzles/nurikabe/rules/SurroundRegionBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/SurroundRegionDirectRuleTest.java
@@ -1,96 +1,96 @@
-package puzzles.nurikabe.rules;
-
-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 edu.rpi.legup.puzzle.nurikabe.rules.SurroundRegionBasicRule;
-import edu.rpi.legup.save.InvalidFileFormatException;
-
-import java.awt.*;
-
-public class SurroundRegionBasicRuleTest {
-
- private static final SurroundRegionBasicRule RULE = new SurroundRegionBasicRule();
- private static Nurikabe nurikabe;
-
- @BeforeClass
- public static void setUp() {
- MockGameBoardFacade.getInstance();
- nurikabe = new Nurikabe();
- }
-
- @Test
- public void SurroundRegionBasicRule_SurroundRegionBlackTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/SurroundRegionBasicRule/SurroundRegionBlack", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell1 = board.getCell(1, 0);
- cell1.setData(NurikabeType.BLACK.toValue());
- board.addModifiedData(cell1);
- NurikabeCell cell2 = board.getCell(0, 1);
- cell2.setData(NurikabeType.BLACK.toValue());
- board.addModifiedData(cell2);
- NurikabeCell cell3 = board.getCell(2, 1);
- cell3.setData(NurikabeType.BLACK.toValue());
- board.addModifiedData(cell3);
- NurikabeCell cell4 = board.getCell(1, 2);
- cell4.setData(NurikabeType.BLACK.toValue());
- board.addModifiedData(cell4);
-
- 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()) || point.equals(cell4.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void SurroundRegionBasicRule_SurroundRegionBlackInCornerTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/SurroundRegionBasicRule/SurroundRegionBlackInCorner", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- transition.setRule(RULE);
-
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- NurikabeCell cell1 = board.getCell(1, 0);
- cell1.setData(NurikabeType.BLACK.toValue());
- board.addModifiedData(cell1);
- NurikabeCell cell2 = board.getCell(0, 1);
- cell2.setData(NurikabeType.BLACK.toValue());
- board.addModifiedData(cell2);
-
- 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())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-}
+package puzzles.nurikabe.rules;
+
+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 edu.rpi.legup.puzzle.nurikabe.rules.SurroundRegionDirectRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
+import java.awt.*;
+
+public class SurroundRegionDirectRuleTest {
+
+ private static final SurroundRegionDirectRule RULE = new SurroundRegionDirectRule();
+ private static Nurikabe nurikabe;
+
+ @BeforeClass
+ public static void setUp() {
+ MockGameBoardFacade.getInstance();
+ nurikabe = new Nurikabe();
+ }
+
+ @Test
+ public void SurroundRegionDirectRule_SurroundRegionBlackTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/SurroundRegionDirectRule/SurroundRegionBlack", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell1 = board.getCell(1, 0);
+ cell1.setData(NurikabeType.BLACK.toValue());
+ board.addModifiedData(cell1);
+ NurikabeCell cell2 = board.getCell(0, 1);
+ cell2.setData(NurikabeType.BLACK.toValue());
+ board.addModifiedData(cell2);
+ NurikabeCell cell3 = board.getCell(2, 1);
+ cell3.setData(NurikabeType.BLACK.toValue());
+ board.addModifiedData(cell3);
+ NurikabeCell cell4 = board.getCell(1, 2);
+ cell4.setData(NurikabeType.BLACK.toValue());
+ board.addModifiedData(cell4);
+
+ 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()) || point.equals(cell4.getLocation())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void SurroundRegionDirectRule_SurroundRegionBlackInCornerTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/SurroundRegionDirectRule/SurroundRegionBlackInCorner", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ NurikabeCell cell1 = board.getCell(1, 0);
+ cell1.setData(NurikabeType.BLACK.toValue());
+ board.addModifiedData(cell1);
+ NurikabeCell cell2 = board.getCell(0, 1);
+ cell2.setData(NurikabeType.BLACK.toValue());
+ board.addModifiedData(cell2);
+
+ 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())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+}
diff --git a/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java
similarity index 90%
rename from src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java
index 8b17115da..88810d8d7 100644
--- a/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java
@@ -1,77 +1,77 @@
-package puzzles.nurikabe.rules;
-
-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 edu.rpi.legup.puzzle.nurikabe.rules.WhiteBottleNeckBasicRule;
-import edu.rpi.legup.save.InvalidFileFormatException;
-
-import java.awt.*;
-
-public class WhiteBottleNeckBasicRuleTest {
-
- private static final WhiteBottleNeckBasicRule RULE = new WhiteBottleNeckBasicRule();
- private static Nurikabe nurikabe;
-
- @BeforeClass
- public static void setUp() {
- MockGameBoardFacade.getInstance();
- nurikabe = new Nurikabe();
- }
-
- @Test
- public void WhiteBottleNeckBasicRule_SimpleWhiteBottleNeckTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/SimpleWhiteBottleNeck", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- transition.setRule(RULE);
-
- NurikabeCell cell = board.getCell(2, 1);
- cell.setData(NurikabeType.WHITE.toValue());
- board.addModifiedData(cell);
-
- 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(cell.getLocation())) {
- Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- else {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
- }
-
- @Test
- public void WhiteBottleNeckBasicRule_NurikabeBoard1Test() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/NurikabeBoard1", nurikabe);
- TreeNode rootNode = nurikabe.getTree().getRootNode();
- TreeTransition transition = rootNode.getChildren().get(0);
- NurikabeBoard board = (NurikabeBoard) transition.getBoard();
- transition.setRule(RULE);
-
- NurikabeCell cell = board.getCell(0, 0);
- cell.setData(NurikabeType.WHITE.toValue());
- board.addModifiedData(cell);
-
- Assert.assertNotNull(RULE.checkRule(transition));
-
- for (int i = 0; i < board.getHeight(); i++) {
- for (int k = 0; k < board.getWidth(); k++) {
- Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
- }
- }
- }
-}
+package puzzles.nurikabe.rules;
+
+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 edu.rpi.legup.puzzle.nurikabe.rules.WhiteBottleNeckDirectRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
+import java.awt.*;
+
+public class WhiteBottleNeckDirectRuleTest {
+
+ private static final WhiteBottleNeckDirectRule RULE = new WhiteBottleNeckDirectRule();
+ private static Nurikabe nurikabe;
+
+ @BeforeClass
+ public static void setUp() {
+ MockGameBoardFacade.getInstance();
+ nurikabe = new Nurikabe();
+ }
+
+ @Test
+ public void WhiteBottleNeckBasicRule_SimpleWhiteBottleNeckTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/SimpleWhiteBottleNeck", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ transition.setRule(RULE);
+
+ NurikabeCell cell = board.getCell(2, 1);
+ cell.setData(NurikabeType.WHITE.toValue());
+ board.addModifiedData(cell);
+
+ 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(cell.getLocation())) {
+ Assert.assertNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+ }
+
+ @Test
+ public void WhiteBottleNeckBasicRule_NurikabeBoard1Test() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/NurikabeBoard1", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ transition.setRule(RULE);
+
+ NurikabeCell cell = board.getCell(0, 0);
+ cell.setData(NurikabeType.WHITE.toValue());
+ board.addModifiedData(cell);
+
+ Assert.assertNotNull(RULE.checkRule(transition));
+
+ for (int i = 0; i < board.getHeight(); i++) {
+ for (int k = 0; k < board.getWidth(); k++) {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+}
From c673d4bdff69d3b8103746e3140b914cc69f267f Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 27 Jan 2023 20:28:26 -0500
Subject: [PATCH 005/148] changed all file names that have "Basic Rules" to
"Direct Rules"
---
...va => FinishWithShipsDirectRuleTests.java} | 6 +++---
...va => EmptyCellinLightDirectRuleTest.java} | 0
...t.java => EmptyCornersDirectRuleTest.java} | 0
...ava => FinishWithBulbsDirectRuleTest.java} | 0
...ava => FinishWithEmptyDirectRuleTest.java} | 0
...Test.java => MustLightDirectRuleTest.java} | 0
.../BlackBetweenRegionsDirectRuleTest.java | 4 ++--
...ava => BlackBottleNeckDirectRuleTest.java} | 19 +++++--------------
...st.java => FillinBlackDirectRuleTest.java} | 8 ++++----
.../PreventBlackSquareDirectRuleTest.java | 10 +++++-----
.../rules/WhiteBottleNeckDirectRuleTest.java | 8 ++++----
...micTest.java => DirectRuleAtomicTest.java} | 2 +-
12 files changed, 24 insertions(+), 33 deletions(-)
rename src/test/java/puzzles/battleship/rules/{FinishWithShipsBasicRuleTests.java => FinishWithShipsDirectRuleTests.java} (94%)
rename src/test/java/puzzles/lightup/rules/{EmptyCellinLightBasicRuleTest.java => EmptyCellinLightDirectRuleTest.java} (100%)
rename src/test/java/puzzles/lightup/rules/{EmptyCornersBasicRuleTest.java => EmptyCornersDirectRuleTest.java} (100%)
rename src/test/java/puzzles/lightup/rules/{FinishWithBulbsBasicRuleTest.java => FinishWithBulbsDirectRuleTest.java} (100%)
rename src/test/java/puzzles/lightup/rules/{FinishWithEmptyBasicRuleTest.java => FinishWithEmptyDirectRuleTest.java} (100%)
rename src/test/java/puzzles/lightup/rules/{MustLightBasicRuleTest.java => MustLightDirectRuleTest.java} (100%)
rename src/test/java/puzzles/nurikabe/rules/{BlackBottleNeckBasicRuleTest.java => BlackBottleNeckDirectRuleTest.java} (67%)
rename src/test/java/puzzles/nurikabe/rules/{FillinBlackBasicRuleTest.java => FillinBlackDirectRuleTest.java} (86%)
rename src/test/java/puzzles/shorttruthtable/rules/{BasicRuleAtomicTest.java => DirectRuleAtomicTest.java} (59%)
diff --git a/src/test/java/puzzles/battleship/rules/FinishWithShipsBasicRuleTests.java b/src/test/java/puzzles/battleship/rules/FinishWithShipsDirectRuleTests.java
similarity index 94%
rename from src/test/java/puzzles/battleship/rules/FinishWithShipsBasicRuleTests.java
rename to src/test/java/puzzles/battleship/rules/FinishWithShipsDirectRuleTests.java
index 89d52b909..ac7e8cb8e 100644
--- a/src/test/java/puzzles/battleship/rules/FinishWithShipsBasicRuleTests.java
+++ b/src/test/java/puzzles/battleship/rules/FinishWithShipsDirectRuleTests.java
@@ -10,9 +10,9 @@
import edu.rpi.legup.puzzle.battleship.rules.*;
import edu.rpi.legup.save.InvalidFileFormatException;
-public class FinishWithShipsBasicRuleTests {
- private static final FinishWithShipsBasicRule RULE
- = new FinishWithShipsBasicRule();
+public class FinishWithShipsDirectRuleTests {
+ private static final FinishWithShipsDirectRule RULE
+ = new FinishWithShipsDirectRule();
private static Battleship battleship;
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCellinLightDirectRuleTest.java
similarity index 100%
rename from src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
rename to src/test/java/puzzles/lightup/rules/EmptyCellinLightDirectRuleTest.java
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCornersDirectRuleTest.java
similarity index 100%
rename from src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
rename to src/test/java/puzzles/lightup/rules/EmptyCornersDirectRuleTest.java
diff --git a/src/test/java/puzzles/lightup/rules/FinishWithBulbsBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/FinishWithBulbsDirectRuleTest.java
similarity index 100%
rename from src/test/java/puzzles/lightup/rules/FinishWithBulbsBasicRuleTest.java
rename to src/test/java/puzzles/lightup/rules/FinishWithBulbsDirectRuleTest.java
diff --git a/src/test/java/puzzles/lightup/rules/FinishWithEmptyBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/FinishWithEmptyDirectRuleTest.java
similarity index 100%
rename from src/test/java/puzzles/lightup/rules/FinishWithEmptyBasicRuleTest.java
rename to src/test/java/puzzles/lightup/rules/FinishWithEmptyDirectRuleTest.java
diff --git a/src/test/java/puzzles/lightup/rules/MustLightBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/MustLightDirectRuleTest.java
similarity index 100%
rename from src/test/java/puzzles/lightup/rules/MustLightBasicRuleTest.java
rename to src/test/java/puzzles/lightup/rules/MustLightDirectRuleTest.java
diff --git a/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java b/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java
index 66c797be2..b32ce23ce 100644
--- a/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRuleTest.java
@@ -124,8 +124,8 @@ public void BlackBetweenRegionsDirectRule_HorizontalBlackBetweenRegionsTest() th
}
@Test
- public void BlackBetweenRegionsBasicRule_VerticalBlackBetweenRegionsTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/VerticalBlackBetweenRegions", nurikabe);
+ public void BlackBetweenRegionsDirectRule_VerticalBlackBetweenRegionsTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/VerticalBlackBetweenRegions", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
diff --git a/src/test/java/puzzles/nurikabe/rules/BlackBottleNeckBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/BlackBottleNeckDirectRuleTest.java
similarity index 67%
rename from src/test/java/puzzles/nurikabe/rules/BlackBottleNeckBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/BlackBottleNeckDirectRuleTest.java
index f630d02b5..45ed97030 100644
--- a/src/test/java/puzzles/nurikabe/rules/BlackBottleNeckBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/BlackBottleNeckDirectRuleTest.java
@@ -1,24 +1,15 @@
package puzzles.nurikabe.rules;
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 edu.rpi.legup.puzzle.nurikabe.rules.BlackBottleNeckBasicRule;
+import edu.rpi.legup.puzzle.nurikabe.rules.BlackBottleNeckDirectRule;
import edu.rpi.legup.save.InvalidFileFormatException;
-import java.awt.*;
+public class BlackBottleNeckDirectRuleTest {
-public class BlackBottleNeckBasicRuleTest {
-
- private static final BlackBottleNeckBasicRule RULE = new BlackBottleNeckBasicRule();
+ private static final BlackBottleNeckDirectRule RULE = new BlackBottleNeckDirectRule();
private static Nurikabe nurikabe;
@BeforeClass
@@ -28,8 +19,8 @@ public static void setUp() {
}
@Test
- public void BlackBottleNeckBasicRule_TwoSurroundBlackTest() throws InvalidFileFormatException {
-// TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBottleNeckBasicRule/SimpleBlackBottleNeck", nurikabe);
+ public void BlackBottleNeckDirectRule_TwoSurroundBlackTest() throws InvalidFileFormatException {
+// TestUtilities.importTestBoard("puzzles/nurikabe/rules/BlackBottleNeckDirectRule/SimpleBlackBottleNeck", nurikabe);
// TreeNode rootNode = nurikabe.getTree().getRootNode();
// TreeTransition transition = rootNode.getChildren().get(0);
// transition.setRule(RULE);
diff --git a/src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java b/src/test/java/puzzles/nurikabe/rules/FillinBlackDirectRuleTest.java
similarity index 86%
rename from src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java
rename to src/test/java/puzzles/nurikabe/rules/FillinBlackDirectRuleTest.java
index 5ad57f01b..a1c8f58bc 100644
--- a/src/test/java/puzzles/nurikabe/rules/FillinBlackBasicRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/FillinBlackDirectRuleTest.java
@@ -16,9 +16,9 @@
import java.awt.*;
-public class FillinBlackBasicRuleTest {
+public class FillinBlackDirectRuleTest {
- private static final FillinBlackBasicRule RULE = new FillinBlackBasicRule();
+ private static final FillinBlackDirectRule RULE = new FillinBlackDirectRule();
private static Nurikabe nurikabe;
@BeforeClass
@@ -28,8 +28,8 @@ public static void setUp() {
}
@Test
- public void FillinBlackBasicRule_UnknownSurroundBlackTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/FillinBlackBasicRule/UnknownSurroundBlack", nurikabe);
+ public void FillinBlackDirectRule_UnknownSurroundBlackTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/FillinBlackDirectRule/UnknownSurroundBlack", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
diff --git a/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java b/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java
index d8e0e6e77..6d0b72063 100644
--- a/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/PreventBlackSquareDirectRuleTest.java
@@ -56,7 +56,7 @@ public void PreventBlackSquareDirectRule_BottomLeftWhiteBlackSquareTest() throws
@Test
public void PreventBlackSquareDirectRule_BottomRightWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare", nurikabe);
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareDirectRule/BottomRightWhiteBlackSquare", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
@@ -82,8 +82,8 @@ public void PreventBlackSquareDirectRule_BottomRightWhiteBlackSquareTest() throw
}
@Test
- public void PreventBlackSquareBasicRule_TopLeftWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare", nurikabe);
+ public void PreventBlackSquareDirectRule_TopLeftWhiteBlackSquareTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareDirectRule/TopLeftWhiteBlackSquare", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
@@ -109,8 +109,8 @@ public void PreventBlackSquareBasicRule_TopLeftWhiteBlackSquareTest() throws Inv
}
@Test
- public void PreventBlackSquareBasicRule_TopRightWhiteBlackSquareTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare", nurikabe);
+ public void PreventBlackSquareDirectRule_TopRightWhiteBlackSquareTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/PreventBlackSquareDirectRule/TopRightWhiteBlackSquare", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
diff --git a/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java b/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java
index 88810d8d7..79f2a3804 100644
--- a/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/WhiteBottleNeckDirectRuleTest.java
@@ -28,8 +28,8 @@ public static void setUp() {
}
@Test
- public void WhiteBottleNeckBasicRule_SimpleWhiteBottleNeckTest() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/SimpleWhiteBottleNeck", nurikabe);
+ public void WhiteBottleNeckDirectRule_SimpleWhiteBottleNeckTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckDirectRule/SimpleWhiteBottleNeck", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
NurikabeBoard board = (NurikabeBoard) transition.getBoard();
@@ -55,8 +55,8 @@ public void WhiteBottleNeckBasicRule_SimpleWhiteBottleNeckTest() throws InvalidF
}
@Test
- public void WhiteBottleNeckBasicRule_NurikabeBoard1Test() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/NurikabeBoard1", nurikabe);
+ public void WhiteBottleNeckDirectRule_NurikabeBoard1Test() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/WhiteBottleNeckDirectRule/NurikabeBoard1", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
NurikabeBoard board = (NurikabeBoard) transition.getBoard();
diff --git a/src/test/java/puzzles/shorttruthtable/rules/BasicRuleAtomicTest.java b/src/test/java/puzzles/shorttruthtable/rules/DirectRuleAtomicTest.java
similarity index 59%
rename from src/test/java/puzzles/shorttruthtable/rules/BasicRuleAtomicTest.java
rename to src/test/java/puzzles/shorttruthtable/rules/DirectRuleAtomicTest.java
index c06af20e9..81991fa46 100644
--- a/src/test/java/puzzles/shorttruthtable/rules/BasicRuleAtomicTest.java
+++ b/src/test/java/puzzles/shorttruthtable/rules/DirectRuleAtomicTest.java
@@ -1,6 +1,6 @@
package puzzles.shorttruthtable.rules;
-class BasicRuleAtomicTest {
+class DirectRuleAtomicTest {
}
\ No newline at end of file
From 9c02fc0f1a60b42b59b3f45bd22c7438cc73cc24 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 27 Jan 2023 20:51:25 -0500
Subject: [PATCH 006/148] changed the UI texts where rules are labeled "Basic
Rules" to "Direct Rules"
---
bin/main/edu/rpi/legup/legup/main_window.fxml | 2 +-
.../java/edu/rpi/legup/history/ValidateDirectRuleCommand.java | 2 +-
src/main/java/edu/rpi/legup/model/Puzzle.java | 4 ++--
src/main/java/edu/rpi/legup/ui/PreferencesDialog.java | 2 +-
.../rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java | 4 ++--
src/main/resources/edu/rpi/legup/legup/main_window.fxml | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/bin/main/edu/rpi/legup/legup/main_window.fxml b/bin/main/edu/rpi/legup/legup/main_window.fxml
index 6719c9220..88f01babd 100644
--- a/bin/main/edu/rpi/legup/legup/main_window.fxml
+++ b/bin/main/edu/rpi/legup/legup/main_window.fxml
@@ -52,7 +52,7 @@
-
+
diff --git a/src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java b/src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java
index a0c4855cf..61babe883 100644
--- a/src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java
+++ b/src/main/java/edu/rpi/legup/history/ValidateDirectRuleCommand.java
@@ -19,7 +19,7 @@ public class ValidateDirectRuleCommand extends PuzzleCommand {
private DirectRule newRule;
/**
- * ValidateBasicRuleCommand Constructor creates a command for verifying a basic rule
+ * ValidateDesireRuleCommand Constructor creates a command for verifying a basic rule
*
* @param selection selection of tree elements
* @param rule basic rule
diff --git a/src/main/java/edu/rpi/legup/model/Puzzle.java b/src/main/java/edu/rpi/legup/model/Puzzle.java
index b21dcfd2d..f64fc5bb6 100644
--- a/src/main/java/edu/rpi/legup/model/Puzzle.java
+++ b/src/main/java/edu/rpi/legup/model/Puzzle.java
@@ -325,7 +325,7 @@ public String getName() {
}
/**
- * Gets the list of basic rules
+ * Gets the list of direct rules
*
* @return list of basic rules
*/
@@ -343,7 +343,7 @@ public List getNonPlaceableElements() {
/**
- * Sets the list of basic rules
+ * Sets the list of direct rules
*
* @param directRules list of basic rules
*/
diff --git a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
index de8a0f7e4..535e632f8 100644
--- a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
@@ -202,7 +202,7 @@ private JScrollPane createPuzzleTab(Puzzle puzzle) {
contentPane.add(createLeftLabel("Rules"));
contentPane.add(createLineSeparator());
- contentPane.add(createLeftLabel("Basic Rules"));
+ contentPane.add(createLeftLabel("Direct Rules"));
contentPane.add(createLineSeparator());
contentPane.add(Box.createRigidArea(new Dimension(0, 5)));
for (Rule rule : puzzle.getDirectRules()) {
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
index e12bc7081..d473f302e 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
@@ -16,7 +16,7 @@ public class DirectRulePanel extends RulePanel {
DirectRulePanel(RuleFrame ruleFrame) {
super(ruleFrame);
this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Basic Rules.gif"));
- this.name = "Basic Rules";
- this.toolTip = "Basic Rules";
+ this.name = "Direct Rules";
+ this.toolTip = "Direct Rules";
}
}
\ No newline at end of file
diff --git a/src/main/resources/edu/rpi/legup/legup/main_window.fxml b/src/main/resources/edu/rpi/legup/legup/main_window.fxml
index 6719c9220..88f01babd 100644
--- a/src/main/resources/edu/rpi/legup/legup/main_window.fxml
+++ b/src/main/resources/edu/rpi/legup/legup/main_window.fxml
@@ -52,7 +52,7 @@
-
+
From cf3d3a08746ca0a71923f036392f8336b382fb88 Mon Sep 17 00:00:00 2001
From: Jun Song <40209659+Acewvrs@users.noreply.github.com>
Date: Fri, 27 Jan 2023 21:05:10 -0500
Subject: [PATCH 007/148] Renaming "Basic Rules" to "Direct Rules"
Changed UI texts, file and function names that have "Basic Rules" in it to "Direct Rules."
---
src/main/java/edu/rpi/legup/legup.iml | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 src/main/java/edu/rpi/legup/legup.iml
diff --git a/src/main/java/edu/rpi/legup/legup.iml b/src/main/java/edu/rpi/legup/legup.iml
new file mode 100644
index 000000000..908ca0644
--- /dev/null
+++ b/src/main/java/edu/rpi/legup/legup.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From dbc78e6b8026c6cc732f1315c71415992129489b Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Fri, 27 Jan 2023 21:31:53 -0500
Subject: [PATCH 008/148] Seemingly Fixed (BasicRule_Generic)
---
.../rules/basic/BasicRule_Generic.java | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java
index 4d1385e87..1bad10bf4 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRule_Generic.java
@@ -6,6 +6,7 @@
import edu.rpi.legup.model.tree.TreeNode;
import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.lightup.LightUpBoard;
import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableBoard;
import edu.rpi.legup.puzzle.shorttruthtable.ShortTruthTableCell;
import edu.rpi.legup.model.rules.ContradictionRule;
@@ -24,29 +25,31 @@ public BasicRule_Generic(String ruleID, String ruleName, String description, Str
public String checkRuleRawAt(TreeTransition transition, PuzzleElement element) {
// Check that the puzzle element is not unknown
- ShortTruthTableBoard board = (ShortTruthTableBoard) transition.getBoard();
- ShortTruthTableCell cell = (ShortTruthTableCell) board.getPuzzleElement(element);
+ ShortTruthTableBoard parentBoard = (ShortTruthTableBoard) transition.getParents().get(0).getBoard();
+ ShortTruthTableBoard finalBoard = (ShortTruthTableBoard) transition.getBoard();
+ ShortTruthTableCell parentCell = (ShortTruthTableCell) parentBoard.getPuzzleElement(element);
+ ShortTruthTableCell finalCell = (ShortTruthTableCell) finalBoard.getPuzzleElement(element);
- if (!cell.isAssigned()) {
+ if (!finalCell.isAssigned()) {
return super.getInvalidUseOfRuleMessage() + ": Only assigned cells are allowed for basic rules";
}
// Strategy: Negate the modified cell and check if there is a contradiction. If there is one, then the
// original statement must be true. If there isn't one, then the original statement must be false.
- ShortTruthTableBoard modifiedBoard = board.copy();
+ ShortTruthTableBoard modifiedBoard = parentBoard.copy();
PuzzleElement checkElement =
this.ELIMINATION_RULE
- ? cell.getStatementReference().getParentStatement().getCell()
+ ? parentCell.getStatementReference().getParentStatement().getCell()
: element;
ShortTruthTableCell checkCell =
this.ELIMINATION_RULE
- ? (ShortTruthTableCell) modifiedBoard.getCell(cell.getX(), cell.getY())
+ ? (ShortTruthTableCell) modifiedBoard.getCell(parentCell.getX(), parentCell.getY())
: (ShortTruthTableCell) modifiedBoard.getPuzzleElement(element);
- checkCell.setType(checkCell.getType().getNegation());
+ checkCell.setType(finalCell.getType().getNegation());
String contradictionMessage = CORRESPONDING_CONTRADICTION_RULE.checkContradictionAt(modifiedBoard, checkElement);
if (contradictionMessage == null) { // A contradiction exists in the modified statement; this is good!
From d19f4005335e3097bbb933decec15e757469e047 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 31 Jan 2023 10:34:19 -0500
Subject: [PATCH 009/148] changed the names of folders under 'test' directory,
so they use the term "Direct Rules" instead of "Basic Rules"
---
.../HorizontalValidBoard | 0
.../DiagonalBlackBetweenRegions1 | 0
.../DiagonalBlackBetweenRegions2 | 0
.../HorizontalBlackBetweenRegions | 0
.../VerticalBlackBetweenRegions | 0
.../SimpleBlackBottleNeck | 0
.../SimpleCornerBlack | 0
.../UnknownSurroundBlack | 0
.../UnknownSurroundWhite | 0
.../BottomLeftWhiteBlackSquare | 0
.../BottomRightWhiteBlackSquare | 0
.../TopLeftWhiteBlackSquare | 0
.../TopRightWhiteBlackSquare | 0
.../SurroundRegionBlack | 0
.../SurroundRegionBlackInCorner | 0
.../NurikabeBoard1 | 0
.../SimpleWhiteBottleNeck | 0
17 files changed, 0 insertions(+), 0 deletions(-)
rename src/test/resources/puzzles/battleship/rules/{FinishWithShipsBasicRule => FinishWithShipsDirectRule}/HorizontalValidBoard (100%)
rename src/test/resources/puzzles/nurikabe/rules/{BlackBetweenRegionsBasicRule => BlackBetweenRegionsDirectRule}/DiagonalBlackBetweenRegions1 (100%)
rename src/test/resources/puzzles/nurikabe/rules/{BlackBetweenRegionsBasicRule => BlackBetweenRegionsDirectRule}/DiagonalBlackBetweenRegions2 (100%)
rename src/test/resources/puzzles/nurikabe/rules/{BlackBetweenRegionsBasicRule => BlackBetweenRegionsDirectRule}/HorizontalBlackBetweenRegions (100%)
rename src/test/resources/puzzles/nurikabe/rules/{BlackBetweenRegionsBasicRule => BlackBetweenRegionsDirectRule}/VerticalBlackBetweenRegions (100%)
rename src/test/resources/puzzles/nurikabe/rules/{BlackBottleNeckBasicRule => BlackBottleNeckDirectRule}/SimpleBlackBottleNeck (100%)
rename src/test/resources/puzzles/nurikabe/rules/{CornerBlackBasicRule => CornerBlackDirectRule}/SimpleCornerBlack (100%)
rename src/test/resources/puzzles/nurikabe/rules/{FillinBlackBasicRule => FillinBlackDirectRule}/UnknownSurroundBlack (100%)
rename src/test/resources/puzzles/nurikabe/rules/{FillinWhiteBasicRule => FillinWhiteDirectRule}/UnknownSurroundWhite (100%)
rename src/test/resources/puzzles/nurikabe/rules/{PreventBlackSquareBasicRule => PreventBlackSquareDirectRule}/BottomLeftWhiteBlackSquare (100%)
rename src/test/resources/puzzles/nurikabe/rules/{PreventBlackSquareBasicRule => PreventBlackSquareDirectRule}/BottomRightWhiteBlackSquare (100%)
rename src/test/resources/puzzles/nurikabe/rules/{PreventBlackSquareBasicRule => PreventBlackSquareDirectRule}/TopLeftWhiteBlackSquare (100%)
rename src/test/resources/puzzles/nurikabe/rules/{PreventBlackSquareBasicRule => PreventBlackSquareDirectRule}/TopRightWhiteBlackSquare (100%)
rename src/test/resources/puzzles/nurikabe/rules/{SurroundRegionBasicRule => SurroundRegionDirectRule}/SurroundRegionBlack (100%)
rename src/test/resources/puzzles/nurikabe/rules/{SurroundRegionBasicRule => SurroundRegionDirectRule}/SurroundRegionBlackInCorner (100%)
rename src/test/resources/puzzles/nurikabe/rules/{WhiteBottleNeckBasicRule => WhiteBottleNeckDirectRule}/NurikabeBoard1 (100%)
rename src/test/resources/puzzles/nurikabe/rules/{WhiteBottleNeckBasicRule => WhiteBottleNeckDirectRule}/SimpleWhiteBottleNeck (100%)
diff --git a/src/test/resources/puzzles/battleship/rules/FinishWithShipsBasicRule/HorizontalValidBoard b/src/test/resources/puzzles/battleship/rules/FinishWithShipsDirectRule/HorizontalValidBoard
similarity index 100%
rename from src/test/resources/puzzles/battleship/rules/FinishWithShipsBasicRule/HorizontalValidBoard
rename to src/test/resources/puzzles/battleship/rules/FinishWithShipsDirectRule/HorizontalValidBoard
diff --git a/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/DiagonalBlackBetweenRegions1 b/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/DiagonalBlackBetweenRegions1
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/DiagonalBlackBetweenRegions1
rename to src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/DiagonalBlackBetweenRegions1
diff --git a/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/DiagonalBlackBetweenRegions2 b/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/DiagonalBlackBetweenRegions2
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/DiagonalBlackBetweenRegions2
rename to src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/DiagonalBlackBetweenRegions2
diff --git a/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/HorizontalBlackBetweenRegions b/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/HorizontalBlackBetweenRegions
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/HorizontalBlackBetweenRegions
rename to src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/HorizontalBlackBetweenRegions
diff --git a/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/VerticalBlackBetweenRegions b/src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/VerticalBlackBetweenRegions
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsBasicRule/VerticalBlackBetweenRegions
rename to src/test/resources/puzzles/nurikabe/rules/BlackBetweenRegionsDirectRule/VerticalBlackBetweenRegions
diff --git a/src/test/resources/puzzles/nurikabe/rules/BlackBottleNeckBasicRule/SimpleBlackBottleNeck b/src/test/resources/puzzles/nurikabe/rules/BlackBottleNeckDirectRule/SimpleBlackBottleNeck
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/BlackBottleNeckBasicRule/SimpleBlackBottleNeck
rename to src/test/resources/puzzles/nurikabe/rules/BlackBottleNeckDirectRule/SimpleBlackBottleNeck
diff --git a/src/test/resources/puzzles/nurikabe/rules/CornerBlackBasicRule/SimpleCornerBlack b/src/test/resources/puzzles/nurikabe/rules/CornerBlackDirectRule/SimpleCornerBlack
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/CornerBlackBasicRule/SimpleCornerBlack
rename to src/test/resources/puzzles/nurikabe/rules/CornerBlackDirectRule/SimpleCornerBlack
diff --git a/src/test/resources/puzzles/nurikabe/rules/FillinBlackBasicRule/UnknownSurroundBlack b/src/test/resources/puzzles/nurikabe/rules/FillinBlackDirectRule/UnknownSurroundBlack
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/FillinBlackBasicRule/UnknownSurroundBlack
rename to src/test/resources/puzzles/nurikabe/rules/FillinBlackDirectRule/UnknownSurroundBlack
diff --git a/src/test/resources/puzzles/nurikabe/rules/FillinWhiteBasicRule/UnknownSurroundWhite b/src/test/resources/puzzles/nurikabe/rules/FillinWhiteDirectRule/UnknownSurroundWhite
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/FillinWhiteBasicRule/UnknownSurroundWhite
rename to src/test/resources/puzzles/nurikabe/rules/FillinWhiteDirectRule/UnknownSurroundWhite
diff --git a/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare b/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/BottomLeftWhiteBlackSquare
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomLeftWhiteBlackSquare
rename to src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/BottomLeftWhiteBlackSquare
diff --git a/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare b/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/BottomRightWhiteBlackSquare
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/BottomRightWhiteBlackSquare
rename to src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/BottomRightWhiteBlackSquare
diff --git a/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare b/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/TopLeftWhiteBlackSquare
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopLeftWhiteBlackSquare
rename to src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/TopLeftWhiteBlackSquare
diff --git a/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare b/src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/TopRightWhiteBlackSquare
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareBasicRule/TopRightWhiteBlackSquare
rename to src/test/resources/puzzles/nurikabe/rules/PreventBlackSquareDirectRule/TopRightWhiteBlackSquare
diff --git a/src/test/resources/puzzles/nurikabe/rules/SurroundRegionBasicRule/SurroundRegionBlack b/src/test/resources/puzzles/nurikabe/rules/SurroundRegionDirectRule/SurroundRegionBlack
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/SurroundRegionBasicRule/SurroundRegionBlack
rename to src/test/resources/puzzles/nurikabe/rules/SurroundRegionDirectRule/SurroundRegionBlack
diff --git a/src/test/resources/puzzles/nurikabe/rules/SurroundRegionBasicRule/SurroundRegionBlackInCorner b/src/test/resources/puzzles/nurikabe/rules/SurroundRegionDirectRule/SurroundRegionBlackInCorner
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/SurroundRegionBasicRule/SurroundRegionBlackInCorner
rename to src/test/resources/puzzles/nurikabe/rules/SurroundRegionDirectRule/SurroundRegionBlackInCorner
diff --git a/src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/NurikabeBoard1 b/src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckDirectRule/NurikabeBoard1
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/NurikabeBoard1
rename to src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckDirectRule/NurikabeBoard1
diff --git a/src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/SimpleWhiteBottleNeck b/src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckDirectRule/SimpleWhiteBottleNeck
similarity index 100%
rename from src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckBasicRule/SimpleWhiteBottleNeck
rename to src/test/resources/puzzles/nurikabe/rules/WhiteBottleNeckDirectRule/SimpleWhiteBottleNeck
From 099bb435dfb3f9ed406b1d82f6c7c75121a3ffc6 Mon Sep 17 00:00:00 2001
From: Nicholas
Date: Tue, 31 Jan 2023 15:40:01 -0500
Subject: [PATCH 010/148] Testing Flatlaf On Dev
---
build.gradle | 1 +
src/main/java/edu/rpi/legup/ui/LegupUI.java | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 60ad09695..3a392bac5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,6 +16,7 @@ sourceCompatibility = 1.8
dependencies {
implementation 'org.jetbrains:annotations:20.1.0'
implementation 'org.jetbrains:annotations:20.1.0'
+ compile 'com.formdev:flatlaf:3.0'
compile project(':legup-update')
compile 'com.google.firebase:firebase-admin:6.3.0'
compile 'org.apache.httpcomponents:httpclient:4.5.1'
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index f12f45a70..7ec9bded8 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -9,6 +9,7 @@
import javax.swing.*;
+import com.formdev.flatlaf.FlatLightLaf;
import edu.rpi.legup.app.GameBoardFacade;
import edu.rpi.legup.app.LegupPreferences;
import edu.rpi.legup.ui.lookandfeel.LegupLookAndFeel;
@@ -49,7 +50,7 @@ public LegupUI() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try {
- UIManager.setLookAndFeel(new LegupLookAndFeel());
+ UIManager.setLookAndFeel(new FlatLightLaf());
}
catch (UnsupportedLookAndFeelException e) {
System.err.println("Not supported ui look and feel");
From b3f0ca16486d7380e69fe586a7287408cc49cc7c Mon Sep 17 00:00:00 2001
From: charlestian23
Date: Thu, 2 Feb 2023 16:58:39 -0500
Subject: [PATCH 011/148] Renamed icon file
---
src/main/java/edu/rpi/legup/ui/LegupUI.java | 5 +----
.../ui/proofeditorui/rulesview/DirectRulePanel.java | 2 +-
.../elementsview/NonPlaceableElementPanel.java | 2 +-
.../elementsview/PlaceableElementPanel.java | 2 +-
.../Legup/{Basic Rules.gif => Direct Rules.gif} | Bin
5 files changed, 4 insertions(+), 7 deletions(-)
rename src/main/resources/edu/rpi/legup/images/Legup/{Basic Rules.gif => Direct Rules.gif} (100%)
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index f12f45a70..48f042028 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -2,7 +2,6 @@
import java.awt.*;
import java.awt.event.*;
-import java.io.*;
import java.security.InvalidParameterException;
import java.util.Objects;
@@ -14,8 +13,6 @@
import edu.rpi.legup.ui.lookandfeel.LegupLookAndFeel;
import edu.rpi.legup.ui.boardview.BoardView;
import edu.rpi.legup.ui.proofeditorui.treeview.TreePanel;
-import edu.rpi.legupupdate.Update;
-import edu.rpi.legupupdate.UpdateProgress;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -61,7 +58,7 @@ public LegupUI() {
displayPanel(0);
setIconImage(new ImageIcon(Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResource(
- "edu/rpi/legup/images/Legup/Basic Rules.gif"))).getImage());
+ "edu/rpi/legup/images/Legup/Direct Rules.gif"))).getImage());
if (LegupPreferences.getInstance().getUserPref(LegupPreferences.START_FULL_SCREEN).equals(Boolean.toString(true))) {
setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
index d473f302e..3d0672525 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/DirectRulePanel.java
@@ -15,7 +15,7 @@ public class DirectRulePanel extends RulePanel {
*/
DirectRulePanel(RuleFrame ruleFrame) {
super(ruleFrame);
- this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Basic Rules.gif"));
+ this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Direct Rules.gif"));
this.name = "Direct Rules";
this.toolTip = "Direct Rules";
}
diff --git a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/NonPlaceableElementPanel.java b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/NonPlaceableElementPanel.java
index 3dba14c42..7920f564c 100644
--- a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/NonPlaceableElementPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/NonPlaceableElementPanel.java
@@ -5,7 +5,7 @@
public class NonPlaceableElementPanel extends ElementPanel {
public NonPlaceableElementPanel(ElementFrame elementFrame) {
super(elementFrame);
- this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Basic Rules.gif"));
+ this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Direct Rules.gif"));
this.name = "Non-Placeable Elements";
this.toolTip = "Non-Placeable Elements";
}
diff --git a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/PlaceableElementPanel.java b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/PlaceableElementPanel.java
index 8ef7e2d49..1fa8eabfb 100644
--- a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/PlaceableElementPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/PlaceableElementPanel.java
@@ -5,7 +5,7 @@
public class PlaceableElementPanel extends ElementPanel {
public PlaceableElementPanel(ElementFrame elementFrame) {
super(elementFrame);
- this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Basic Rules.gif"));
+ this.icon = new ImageIcon(ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/Direct Rules.gif"));
this.name = "Placeable Elements";
this.toolTip = "Placeable Elements";
}
diff --git a/src/main/resources/edu/rpi/legup/images/Legup/Basic Rules.gif b/src/main/resources/edu/rpi/legup/images/Legup/Direct Rules.gif
similarity index 100%
rename from src/main/resources/edu/rpi/legup/images/Legup/Basic Rules.gif
rename to src/main/resources/edu/rpi/legup/images/Legup/Direct Rules.gif
From 14a93815642a61b2234e0ad5a002522295766324 Mon Sep 17 00:00:00 2001
From: sravan parakala
Date: Fri, 3 Feb 2023 16:32:12 -0500
Subject: [PATCH 012/148] changed 'Atomic Rule' to 'True or False' and changed
case/Atomic.png to a new image
---
.../rules/basic/BasicRuleAtomic.java | 2 +-
.../rules/caserule/CaseRuleAtomic.java | 2 +-
.../ruleimages/case/Atomic.png | Bin 3033 -> 2165 bytes
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java
index df90efadf..d581cf128 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/BasicRuleAtomic.java
@@ -5,7 +5,7 @@
public class BasicRuleAtomic extends BasicRule_Generic {
public BasicRuleAtomic() {
- super("STTT-BASC-0001", "Atomic Rule",
+ super("STTT-BASC-0001", "True or False",
"All identical atoms have the same T/F value",
"Atomic",
new ContradictionRuleAtomic(),
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule/CaseRuleAtomic.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule/CaseRuleAtomic.java
index 0fa1e2214..9b2ef7fea 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule/CaseRuleAtomic.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule/CaseRuleAtomic.java
@@ -18,7 +18,7 @@ public class CaseRuleAtomic extends CaseRule_Generic {
public CaseRuleAtomic() {
super("STTT-CASE-0002", "Atomic",
- "Atomic Case",
+ "True or False",
"Each unknown cell must either be true or false");
System.out.println("Case Rule T/F constructor");
}
diff --git a/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages/case/Atomic.png b/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages/case/Atomic.png
index f5cbdeb5f2319c05526fdad9ecb7cd4cd95fb2ea..f336002783210d28144c51636d2a4ab7e61ba252 100644
GIT binary patch
literal 2165
zcmXw*eNYtV9mk*NakpVtX>ehYGDJ^ZWZ0ug9DCZ38;vdlxSjYJOdgE
zras3@FqG(VC=iu+L6AMf>*-{WN(0-*I2Rja=l1jY
zeV@1AU;BYQFDsId=K%nbRyD%`04yd?Q3N99+kI&nIH-
z(|>%8CCs_hl@$O8mGpuCTsNl*fC%22VbQ9}Zl3#WOKFJjH5+H5%R^Ia5Sm43|pMub`a;u*riz
z*Dx=IXNabkxKt|}%0=UaP-w-AHQX=xW{IXm?uyEWvd|+3^tRwz8n#JcURL4-*G$p$
z3^%xw_h6E^aS+W&gwPKztBOrF
zOhQx}Z?0uB4x!RKR9grGiSUje%<|$G4IfsOSlLLFOfyB_ueeYqd&P#nDS*{p+^pfZ
zB~!BKdzK63uvZl1D1_r)d_%*9k`IXCR8F_BsVW+^!<`KH3FHUsM;q)x_yai=D
z;D8tRX*gH%nZ@ugIX#!HN=KuGaCQq8b+FcpGj;I5YAn-mn&eEDjrBq>UJO4g1WjUi
z7FW{ByXM2w4mjM3_xOPjTqc%uGCq{k3gX3*c4qQ#*Karc
z&Z?lsuOtfwl&C?cJm@PJEp
zHz#4c=3L5|;>EaZ6rr-GTEOcLw?)E1&B<`47sSE+Ow@k9Gzaa-XBSJb+lPu~@$BXIC&Kbx)T;tkH#Q4Or0nuA
z_V@XOxlrpuLssyGZoDigFUi3=#_r`eCPJ+T?NdR6->49j-^!EqjQwMN`8?RKu)`8u
zn9km61?N6N@2ViD!2Pv^&+5h;3A279MKJbi;T5Q)jo+38`)w?#9Vvqx?s?t>&-AY*
zZwF$JV8$4EwV#Z)+YXa4={H3R3U8WD$3T&6f|Gj^>8L#BRj~ZkKO+I;7X?T#_6@R1
zu;44AHx>tp9@6OivL2FlDV;f`q1>q^FLvkhx~tNiw%N
zCO~xE7j$lwn;gKLxtr)Qp^NC~ul`7MX)8@%93wize1vGrn4cUVA)2J4Mz2u4L=On{RFKFwS67l^^9j;9
zlmBI^55GdRBaJrtMjp{Ve3@wd-%g@OQyoNSZ!IRe<2|a^XAzzKk5xqX{hX$Q-&1|l
zO4BtO(c(6`L*@l~pJlhm_RckPHr+l>zXYa!yYE*IrKJ38_`RV;&gW86o<5V;QG3o9YJ46IyEU*?>JY=hiu@P~&L!3WhJe1Wn?$jNUsI;j|GRo<=x1q&CH4`3h*?rUi|Nk?h&^`*VH^V%BjKU|
z*ggUlNOa{)$ao>T^P}JpCY2uw3&en35@d?U{|CzY7HWrtAfip6tzcj#H=^2YpxksvDqXe?RL<^EV-g+A7TD36bh
za6ouwa;r~}lbxNr2;uTW048QQQZP>Tc9y2rmX;<2>`W@4a719s=kB1gB|wXSC*V!+
z<|cScPg5(RDS=3^0!QL3TXJnM4;;3H{lD~OU5&8;7IZq1#urNv(GIz2rqwsWVKb+h
zV+dc~;~0#*(nNNEj3g2y6d|1O0GK0B3%Hv>#Ryjt$riz69w;&iB6GQXK<5q&7#}`Q
z0E;jNn_wY^K)?|2rq+g^+eQY$!0)%S#LdQtlg;0sLE7NHNW(_1@RxxFb~7@t2*5_c
zeOxKv@Np@@0q|E&e
zl!t*D<0s<6-f0=}eU@eCv>oGmXCD1G6F0g>YSy;o?r(STyVdn}?+DmaWq{
zGFKhaTmv!pB+si1>r&gBVqSU1J;ULW!Ggtvw3|i)iI#ah9qjPfv(mBGjqR7FV!h$G
z=7~t#yxcJEMui5c#t4ZzD%e0vFrL3b^KTe6#q{Jkb^k(f*eEF;#X^5gtiDwHms6+G
z>(-{Grk0kLzOuT%{pr)EIhmQX6AZ{Oo~&>+>(=q(YxWdUj=8VZ*0bnGXlpVG3k&1#
z*EKiy8$1hU-ujWEv+G)ARh5Oc^`Y$S>-;f?qS29&^hphf?0cJsPARRZc-pRI?=d(y
zsIRYo#P!LtjMdk0Y}T)3Wg+qLt38SsrRFQr9Ew_lsw!}`{-Z#zsj2DBo2sr5TOyHC
zyqj8BU0ppjHC0
zgVoYH{czxTW;@#hn}Y}hmR44}K?@fyyl~;d?%MY$S2!LT-!Dnk)Y58I++v)am$#CU
zy1KR2@!gVS3R!rjv9a;|d2312$cWHD1428igtbJUC@wC(bV=JoC=yAfQi^4!KC9L(
ze#w$0(K~mxTJ-kz{;(mzuOwmf%I@xNb>12c`<|Yjt`N(_RE6xU{Cr;@pR|)8c%`Mv
z#(N7(N~F!r&GW9SY|Y+M?x2-Wwy5wV@9K?_q!KAQMF*`P!ZI{8e5P=M;e>bXls31t
zv??!OzFevIM-!vx!$_91y-e)t=GLn0ai`{#`mbdrJH74f6tAvjH&BLI_4V~$US3MQ
zO2)wmGCV%6>EXV0tIPPFvILm!=2oP3{rdGfJyoyULqkL3EiDb3qvl~rAP|Ve-#r$s8E$#I4zQk*lJYwGvTwzm0ZIIafd+gd2;tSM
zSEHk*{@TfuN~zSJaOhmH#Rri6p}f4kbuST;IV?Cm2ar{qX4fHN6oRSFc)i37L$sE%kJ6GpD!l`TVY~E_3>g6CINc
zZ7NVE>0RQcM(ePa+GI(g&K`_2sX^(7x&<-bdx<>uygz;Y_aHZFSi%6tyV
z*4Cl>$!OH%fKJ5Y8s3h}zBBTv_aA77FZtq((j7I&bQ%UD)@lDl+q&J?_vFcwQGvP<
zlj(3J^X8&$EFYh~V+$07vGsR*M`NlJ-hLlcMMTdR^*Fs08ohY+ic#Da`;=scp1*Kc
zQXAKQ*SlUX%CYnw!CBCbheKmySH`aE;Bg3DSFUUb3kxHY$-ch%R7mG8^X0pnj+9ht
z;hp$_%jeG3)z|CX)K;P0e=*YJrmeX?X!`LxL&s@-zm7To$1?gzO$};dHT!+LlfoR?
O8@ZFcEA=GBFYyo2&&e|Y
From 9a5be2369c2eb38cd594e4b88bd739666014c3d0 Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Fri, 3 Feb 2023 17:28:03 -0500
Subject: [PATCH 013/148] Merge 2
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 5 +++++
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 4 ++++
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 1 +
3 files changed, 10 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 3eba9a3de..23fd2b11b 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -47,6 +47,10 @@ public class HomePanel extends LegupPanel {
@Override
public void actionPerformed(ActionEvent e) {
Object[] items = legupUI.getProofEditor().promptPuzzle();
+ if (items == null) {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
+ return;
+ }
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
legupUI.displayPanel(1);
@@ -59,6 +63,7 @@ public void actionPerformed(ActionEvent e) {
public void actionPerformed(ActionEvent e) {
Object[] items = legupUI.getPuzzleEditor().promptPuzzle();
if (items == null) {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
return;
}
String fileName = (String) items[0];
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index c97416437..a62563e7b 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -377,6 +377,10 @@ public Object[] promptPuzzle() {
fileName = fileDialog.getDirectory() + File.separator + fileDialog.getFile();
puzzleFile = new File(fileName);
}
+ else {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
+ return null;
+ }
return new Object[]{fileName, puzzleFile};
}
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 7e178be4b..f474d3074 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -313,6 +313,7 @@ public Object[] promptPuzzle() {
puzzleFile = new File(fileName);
}
else {
+ // The attempt to prompt a puzzle ended gracefully (cancel)
return null;
}
From 3b6da757cb2309311497d31975791d2e72a5dcce Mon Sep 17 00:00:00 2001
From: David <67387813+ChickoonLord@users.noreply.github.com>
Date: Fri, 3 Feb 2023 17:31:17 -0500
Subject: [PATCH 014/148] [FIXED BUG]
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 3eba9a3de..fddf0bd82 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -63,6 +63,19 @@ public void actionPerformed(ActionEvent e) {
}
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
+ String parentFolderName = puzzleFile.getParentFile().getParent();
+ System.out.println("Puzzle Parent Folder: "+parentFolderName);
+ String[] editablePuzzles = GameBoardFacade.getInstance().getConfig().getFileCreationEnabledPuzzles().toArray(new String[0]);
+ boolean isEditablePuzzle = false;
+ for (int i = 0; i < editablePuzzles.length; i++) {
+ if (parentFolderName.toLowerCase().contains(editablePuzzles[i].toLowerCase())) {
+ isEditablePuzzle = true;
+ }
+ }
+ if (!isEditablePuzzle){
+ System.out.println("Puzzle type is uneditable");
+ return;
+ }
legupUI.displayPanel(2);
legupUI.getPuzzleEditor().loadPuzzle(fileName, puzzleFile);
}
From 139d32f2ed4f5c8a22322b0e2fee01b3790c3d0d Mon Sep 17 00:00:00 2001
From: David <67387813+ChickoonLord@users.noreply.github.com>
Date: Fri, 3 Feb 2023 20:37:53 -0500
Subject: [PATCH 015/148] Fixed bug that lets you edit editable puzzle
---
.../java/edu/rpi/legup/app/GameBoardFacade.java | 12 ++++++++++++
src/main/java/edu/rpi/legup/ui/HomePanel.java | 13 -------------
.../java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 2 +-
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
index 9c3f64ea0..97753dd0f 100644
--- a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
+++ b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
@@ -227,6 +227,18 @@ public void loadPuzzleEditor(InputStream inputStream) throws InvalidFileFormatEx
if (qualifiedClassName == null) {
throw new InvalidFileFormatException("Puzzle creation error: cannot find puzzle with that name");
}
+ String[] editablePuzzles = GameBoardFacade.getInstance().getConfig().getFileCreationEnabledPuzzles().toArray(new String[0]);
+ boolean isEditablePuzzle = false;
+ for (int i = 0; i < editablePuzzles.length; i++) {
+ if (qualifiedClassName.contains(editablePuzzles[i])) {
+ isEditablePuzzle = true;
+ break;
+ }
+ }
+ if (!isEditablePuzzle){
+ LOGGER.error("Puzzle is not editable");
+ throw new InvalidFileFormatException("Puzzle is not editable");
+ }
LOGGER.debug("Loading " + qualifiedClassName);
Class> c = Class.forName(qualifiedClassName);
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index fddf0bd82..3eba9a3de 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -63,19 +63,6 @@ public void actionPerformed(ActionEvent e) {
}
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
- String parentFolderName = puzzleFile.getParentFile().getParent();
- System.out.println("Puzzle Parent Folder: "+parentFolderName);
- String[] editablePuzzles = GameBoardFacade.getInstance().getConfig().getFileCreationEnabledPuzzles().toArray(new String[0]);
- boolean isEditablePuzzle = false;
- for (int i = 0; i < editablePuzzles.length; i++) {
- if (parentFolderName.toLowerCase().contains(editablePuzzles[i].toLowerCase())) {
- isEditablePuzzle = true;
- }
- }
- if (!isEditablePuzzle){
- System.out.println("Puzzle type is uneditable");
- return;
- }
legupUI.displayPanel(2);
legupUI.getPuzzleEditor().loadPuzzle(fileName, puzzleFile);
}
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 7e178be4b..1196da111 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -335,7 +335,7 @@ public void loadPuzzle(String fileName, File puzzleFile) {
}
catch (InvalidFileFormatException e) {
LOGGER.error(e.getMessage());
- JOptionPane.showMessageDialog(null, "File does not exist or it cannot be read", "Error", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null, "File does not exist, cannot be read, or cannot be edited", "Error", JOptionPane.ERROR_MESSAGE);
loadPuzzle();
}
}
From 424a38cfa904c5642209109e6877903198eaf5b1 Mon Sep 17 00:00:00 2001
From: David <67387813+ChickoonLord@users.noreply.github.com>
Date: Fri, 3 Feb 2023 20:41:53 -0500
Subject: [PATCH 016/148] Fix bug #331 cleanup and comments
---
src/main/java/edu/rpi/legup/app/GameBoardFacade.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
index 97753dd0f..72a36efa3 100644
--- a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
+++ b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
@@ -227,7 +227,8 @@ public void loadPuzzleEditor(InputStream inputStream) throws InvalidFileFormatEx
if (qualifiedClassName == null) {
throw new InvalidFileFormatException("Puzzle creation error: cannot find puzzle with that name");
}
- String[] editablePuzzles = GameBoardFacade.getInstance().getConfig().getFileCreationEnabledPuzzles().toArray(new String[0]);
+ //Check if puzzle is a "FileCreationEnabled" puzzle (meaning it is editable).
+ String[] editablePuzzles = config.getFileCreationEnabledPuzzles().toArray(new String[0]);
boolean isEditablePuzzle = false;
for (int i = 0; i < editablePuzzles.length; i++) {
if (qualifiedClassName.contains(editablePuzzles[i])) {
@@ -239,6 +240,7 @@ public void loadPuzzleEditor(InputStream inputStream) throws InvalidFileFormatEx
LOGGER.error("Puzzle is not editable");
throw new InvalidFileFormatException("Puzzle is not editable");
}
+ //If it is editable, start loading it
LOGGER.debug("Loading " + qualifiedClassName);
Class> c = Class.forName(qualifiedClassName);
From fde31c0c2ab7b34148f56c9ff44044706668a626 Mon Sep 17 00:00:00 2001
From: sravan parakala
Date: Sat, 4 Feb 2023 13:47:24 -0500
Subject: [PATCH 017/148] Update Atomic.png
---
.../ruleimages/case/Atomic.png | Bin 2165 -> 2206 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages/case/Atomic.png b/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages/case/Atomic.png
index f336002783210d28144c51636d2a4ab7e61ba252..832e0cd7799fd49ede828166d5b9472c33c83b39 100644
GIT binary patch
literal 2206
zcmXw5eNYo;9^QT3y>3>~1q??Om6Z>f6$h#UsUmC^K|nqNY()?-_C!!Arla;!&hs{L
zr4_Bj4~}XXy5iRck;dV4EVZ)C%}`Gn#Hn-QC%LKk(Ze%V+v}Xx-tWDc`y_5B$oStigc)lgJG?F3j&+mhs
zBlpGNva+sDY+17gEJnjdTo$&f3M{_jMr^6xFN39P-$}68T{5=xRO8A|h5uPn-^P~M
z9K2s*#sh5mHU>YrrSvrhp)Gh>%kmZsN~Yqn@Gn;2GW!_bFRODUcII8fb8537ZyNBkrVd}k
z&h{C&tNzw840`{FLH9@}20eE%*#7=mv`-np@#%Lujp`p`D94%i@B*caam+YAk?{f`
zd`ae?vzU=qcH11PE|=aOOO0pKX~F2+QPdZTe(FG_CUSa_Yn7^0>c$Mo2$TJ3yq0cu
zW;3+~bURONIe`j8(5+(ELle2gYb;llM%n+4B&G-sg&S^SBciAmN6<$mGG8|qtIA~A
zpD&3Y3IRw-Hit`0Tppbjj5>>5E>+nt+v9m{ra8QTiOZsgA}P58%?U=AZLa4GnWP(D
zRY9`9P7*&55?!3}3b%Q1?5~a)#Wc8-gT;2|f?!
zakE`9RM$y##YFD*iocPJT*0GqzCG-Hp6WV+ybL)}7n3EUPVjiR#1{5`G&Oh>tv8Ve
zba9bbCs*gGg*t^?TKbRn+eaMn?g`y
zk*il#-jcP2yqz%X1&p(mT^LDS$fO%Mw70~StSUQXEtK~&=GrXAd5C=xMP10E%R^9=
zhAK_u)neCxs+`otO_K3DVYr7;1VESs(1K)QR6S{b925Qic2W^E}+Qvyp@QPR(I%6_f3As3l$^A=uq0E2SoD
zieQiu+_z&72lpKjOXcgtQ_ekER#HsX4@>8ACL6Y#y$fH*{>`eEXtqz~^;|kUo5?LE
z2SVHpvhojA3pe{GNw!_ABZQC3pe@bZbq%%UGOUdpiluIPiBQJ6K`mtF}CV6(VK9!5^KwYz`GM$)cva*6vF8SJ7UmF*H0e&1O#QMT7D$QBtmn^MUI$tmOD)ieznS_U%gQU&Um=Jl$uZlk
zvAktBYx|gMlW0AY87Lty2fO=arAf6%o3%JTJd4(sGXpj0*alxYXrzZ64F!fnLN?&0gY(segiC
zOji9f&Gt~qae(zr;m;S)BTZbz5j38~q?M4#(Nv#}{3)7B*NNL9?ull5jTC5MeQ)zN
zawLrsh&BJ@bYff2CPpSM-d+eq`t7&i{qwrtBC|63#0>AJl35pP%==0eY5(4Nl7<|s
ze+5(O^;8gEeG~zbIcI}F^1PuDBr!o58VYpQLxV+o2Xgm54h6|y4`cs~8Q>3`_yLB_
z)lVR0QjrBxj>_0C#(*<%#n+fFjR(3$p9;ETG52J`(B39W6j-zgq_M4=eG4
zau_Ta`PohWe7P%IVGXGy!*L3=((&^XV3qaxa0ueM1+c#7&SS7%dU^-;Jm`2A0y-^o
zL9(+g1Y*huAYE(g2Z>(07KTmJ!hr4_fOPFIB&Pp$7n}$*{k6APR=H
z55{2l;(0j?%Nuxztz3d1aiAUdZ)%1U8osv!B;)=nkR-pq03Mg}xxlk$&-@z+_@S`>VfDpVvwoR*v-R_UV>SGzAaXJbmUc^a_kRI^
Cb?p`a
literal 2165
zcmXw*eNYtV9mk*NakpVtX>ehYGDJ^ZWZ0ug9DCZ38;vdlxSjYJOdgE
zras3@FqG(VC=iu+L6AMf>*-{WN(0-*I2Rja=l1jY
zeV@1AU;BYQFDsId=K%nbRyD%`04yd?Q3N99+kI&nIH-
z(|>%8CCs_hl@$O8mGpuCTsNl*fC%22VbQ9}Zl3#WOKFJjH5+H5%R^Ia5Sm43|pMub`a;u*riz
z*Dx=IXNabkxKt|}%0=UaP-w-AHQX=xW{IXm?uyEWvd|+3^tRwz8n#JcURL4-*G$p$
z3^%xw_h6E^aS+W&gwPKztBOrF
zOhQx}Z?0uB4x!RKR9grGiSUje%<|$G4IfsOSlLLFOfyB_ueeYqd&P#nDS*{p+^pfZ
zB~!BKdzK63uvZl1D1_r)d_%*9k`IXCR8F_BsVW+^!<`KH3FHUsM;q)x_yai=D
z;D8tRX*gH%nZ@ugIX#!HN=KuGaCQq8b+FcpGj;I5YAn-mn&eEDjrBq>UJO4g1WjUi
z7FW{ByXM2w4mjM3_xOPjTqc%uGCq{k3gX3*c4qQ#*Karc
z&Z?lsuOtfwl&C?cJm@PJEp
zHz#4c=3L5|;>EaZ6rr-GTEOcLw?)E1&B<`47sSE+Ow@k9Gzaa-XBSJb+lPu~@$BXIC&Kbx)T;tkH#Q4Or0nuA
z_V@XOxlrpuLssyGZoDigFUi3=#_r`eCPJ+T?NdR6->49j-^!EqjQwMN`8?RKu)`8u
zn9km61?N6N@2ViD!2Pv^&+5h;3A279MKJbi;T5Q)jo+38`)w?#9Vvqx?s?t>&-AY*
zZwF$JV8$4EwV#Z)+YXa4={H3R3U8WD$3T&6f|Gj^>8L#BRj~ZkKO+I;7X?T#_6@R1
zu;44AHx>tp9@6OivL2FlDV;f`q1>q^FLvkhx~tNiw%N
zCO~xE7j$lwn;gKLxtr)Qp^NC~ul`7MX)8@%93wize1vGrn4cUVA)2J4Mz2u4L=On{RFKFwS67l^^9j;9
zlmBI^55GdRBaJrtMjp{Ve3@wd-%g@OQyoNSZ!IRe<2|a^XAzzKk5xqX{hX$Q-&1|l
zO4BtO(c(6`L*@l~pJlhm_RckPHr+l>zXYa!yYE*IrKJ38_`RV;&gW86o<5V;Q
Date: Sun, 5 Feb 2023 11:47:18 -0500
Subject: [PATCH 018/148] Add FlatLaf license reference
---
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c59342248..5b80048ec 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
```
+
+The look and feel of LEGUP uses [FlatLaf](https://github.com/JFormDesigner/FlatLaf), which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
-Some of the icons used in Legup were taken from or derived from the icons found on https://fonts.google.com/icons, which
-is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
+Some of the icons used in Legup were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
From 782d09b9cd83894b99b8a9004e55e10eb8adb321 Mon Sep 17 00:00:00 2001
From: David <67387813+ChickoonLord@users.noreply.github.com>
Date: Tue, 7 Feb 2023 16:52:46 -0500
Subject: [PATCH 019/148] Failing to open file sends you back to home screen
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 1 -
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 23fd2b11b..396ecd64a 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -68,7 +68,6 @@ public void actionPerformed(ActionEvent e) {
}
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
- legupUI.displayPanel(2);
legupUI.getPuzzleEditor().loadPuzzle(fileName, puzzleFile);
}
};
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index f8dcfa4fe..7d3447bd7 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -330,11 +330,13 @@ public void loadPuzzle() {
public void loadPuzzle(String fileName, File puzzleFile) {
if (puzzleFile != null && puzzleFile.exists()) {
try {
+ legupUI.displayPanel(2);
GameBoardFacade.getInstance().loadPuzzleEditor(fileName);
String puzzleName = GameBoardFacade.getInstance().getPuzzleModule().getName();
frame.setTitle(puzzleName + " - " + puzzleFile.getName());
}
catch (InvalidFileFormatException e) {
+ legupUI.displayPanel(0);
LOGGER.error(e.getMessage());
JOptionPane.showMessageDialog(null, "File does not exist, cannot be read, or cannot be edited", "Error", JOptionPane.ERROR_MESSAGE);
loadPuzzle();
From dd33db62e3076e70b94c962da50a7c174c69db27 Mon Sep 17 00:00:00 2001
From: David <67387813+ChickoonLord@users.noreply.github.com>
Date: Tue, 7 Feb 2023 17:06:03 -0500
Subject: [PATCH 020/148] Failing to open puzzle proof file sends you back to
home
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 1 -
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 396ecd64a..8cc78afda 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -53,7 +53,6 @@ public void actionPerformed(ActionEvent e) {
}
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
- legupUI.displayPanel(1);
legupUI.getProofEditor().loadPuzzle(fileName, puzzleFile);
}
};
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index a62563e7b..541e44658 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -395,11 +395,13 @@ public void loadPuzzle() {
public void loadPuzzle(String fileName, File puzzleFile) {
if (puzzleFile != null && puzzleFile.exists()) {
try {
+ legupUI.displayPanel(1);
GameBoardFacade.getInstance().loadPuzzle(fileName);
String puzzleName = GameBoardFacade.getInstance().getPuzzleModule().getName();
frame.setTitle(puzzleName + " - " + puzzleFile.getName());
}
catch (InvalidFileFormatException e) {
+ legupUI.displayPanel(0);
LOGGER.error(e.getMessage());
if (e.getMessage().contains("Proof Tree construction error: could not find rule by ID")) { // TO DO: make error message not hardcoded
JOptionPane.showMessageDialog(null, "This file runs on an outdated version of Legup\nand is not compatible with the current version.", "Error", JOptionPane.ERROR_MESSAGE);
From f96486d768de838e88df1ad49e2e31c87d35019f Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 7 Feb 2023 17:18:28 -0500
Subject: [PATCH 021/148] changed SkyscrapersCell class to use its own
respective class type, SkyScrapersType instead of int. modified the files
initializing/utilizing SkyscrapersCell to use SkyScrapersType.
---
.../puzzle/skyscrapers/SkyscrapersCell.java | 9 +++++----
.../skyscrapers/SkyscrapersCellFactory.java | 2 +-
.../skyscrapers/SkyscrapersController.java | 14 ++++++++------
.../skyscrapers/SkyscrapersElementView.java | 2 +-
.../puzzle/skyscrapers/SkyscrapersExporter.java | 2 +-
.../puzzle/skyscrapers/SkyscrapersImporter.java | 4 ++--
.../puzzle/skyscrapers/SkyscrapersType.java | 16 ++++++++++++++++
.../ExceedingVisibilityContradictionRule.java | 16 ++++++++--------
.../InsufficientVisibilityContradictionRule.java | 16 ++++++++--------
.../rules/LastSingularCellDirectRule.java | 4 ++--
.../rules/LastVisibleCellDirectRule.java | 4 ++--
.../skyscrapers/rules/NEdgeDirectRule.java | 8 ++++----
.../PreemptiveVisibilityContradictionRule.java | 4 ++--
.../rules/UnresolvedNumberContradictionRule.java | 4 ++--
.../edu/rpi/legup/puzzle/sudoku/SudokuCell.java | 1 +
15 files changed, 63 insertions(+), 43 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java
index 74d753666..1cd0e35f5 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java
@@ -4,23 +4,24 @@
import java.awt.*;
-public class SkyscrapersCell extends GridCell {
+public class SkyscrapersCell extends GridCell {
private int max;
- public SkyscrapersCell(int valueInt, Point location, int size) {
- super(valueInt, location);
+ public SkyscrapersCell(SkyscrapersType value, Point location, int size) {
+ super(value, location);
this.max = size;
}
public SkyscrapersType getType() {
switch (data) {
- case 0:
+ case UNKNOWN:
return SkyscrapersType.UNKNOWN;
default:
return SkyscrapersType.Number;
}
}
+
public int getMax() {
return max;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java
index b6329aac2..6f0c6edfd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java
@@ -39,7 +39,7 @@ public PuzzleElement importCell(Node node, Board board) throws InvalidFileFormat
throw new InvalidFileFormatException("TreeTent Factory: cell unknown value");
}
- SkyscrapersCell cell = new SkyscrapersCell(value, new Point(x, y), width);
+ SkyscrapersCell cell = new SkyscrapersCell(SkyscrapersType.convertToSkyType(value), new Point(x, y), width);
cell.setIndex(y * height + x);
return cell;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java
index 0558213ab..c97bf7ba6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java
@@ -97,20 +97,22 @@ public void mouseReleased(MouseEvent e) {
public void changeCell(MouseEvent e, PuzzleElement element) {
SkyscrapersCell cell = (SkyscrapersCell) element;
if (e.getButton() == MouseEvent.BUTTON1) {
- if (cell.getData() < cell.getMax()) {
- cell.setData(cell.getData() + 1);
+ if (cell.getData().value < cell.getMax()) {
+ int num = cell.getData().value + 1;
+ cell.setData(cell.getData().convertToSkyType(num));
}
else {
- cell.setData(0);
+ cell.setData(SkyscrapersType.UNKNOWN);
}
}
else {
if (e.getButton() == MouseEvent.BUTTON3) {
- if (cell.getData() > 0) {
- cell.setData(cell.getData() - 1);
+ if (cell.getData().value > 0) {
+ int num = cell.getData().value - 1;
+ cell.setData(cell.getData().convertToSkyType(num));
}
else {
- cell.setData(cell.getMax());
+ cell.setData(cell.getData().convertToSkyType(cell.getMax()));
}
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java
index 533437d67..f55fc5a64 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java
@@ -23,7 +23,7 @@ public void drawElement(Graphics2D graphics2D) {
graphics2D.drawRect(location.x, location.y, size.width, size.height);
SkyscrapersCell cell = (SkyscrapersCell) puzzleElement;
- int val = cell.getData();
+ int val = cell.getData().value;
if (val != 0) {
graphics2D.setColor(FONT_COLOR);
graphics2D.setFont(FONT);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java
index dac09bd16..60803a635 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java
@@ -21,7 +21,7 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {
org.w3c.dom.Element cellsElement = newDocument.createElement("cells");
for (PuzzleElement puzzleElement : board.getPuzzleElements()) {
SkyscrapersCell cell = (SkyscrapersCell) puzzleElement;
- if (cell.getData() != 0) {
+ if (cell.getData().value != 0) {
org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, puzzleElement);
cellsElement.appendChild(cellElement);
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java
index c4c909172..95098c7e3 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java
@@ -63,7 +63,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int i = 0; i < elementDataList.getLength(); i++) {
SkyscrapersCell cell = (SkyscrapersCell) puzzle.getFactory().importCell(elementDataList.item(i), skyscrapersBoard);
Point loc = cell.getLocation();
- if (cell.getData() != 0) {
+ if (cell.getData().value != 0) {
cell.setModifiable(false);
cell.setGiven(true);
}
@@ -73,7 +73,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
if (skyscrapersBoard.getCell(x, y) == null) {
- SkyscrapersCell cell = new SkyscrapersCell(0, new Point(x, y), size);
+ SkyscrapersCell cell = new SkyscrapersCell(SkyscrapersType.UNKNOWN, new Point(x, y), size);
cell.setIndex(y * size + x);
cell.setModifiable(true);
skyscrapersBoard.setCell(x, y, cell);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
index 1fdd668c1..ca0e76564 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
@@ -8,4 +8,20 @@ public enum SkyscrapersType {
SkyscrapersType(int value) {
this.value = value;
}
+
+ public static SkyscrapersType convertToSkyType(int num) {
+ if (num == 0) return UNKNOWN;
+ else if (num == 1) return Number;
+ else if (num == 2) return ANY;
+ else if (num == -1) return CLUE_NORTH;
+ else if (num == -2) return CLUE_EAST;
+ else if (num == -3) return CLUE_SOUTH;
+ else if (num == -4) return CLUE_WEST;
+ else {
+ //throw new Exception("conversion from int to SkyscapersType cannot be done; int must be within the range: -4 to 2");
+ // conversion from int to SkyscapersType cannot be done; int must be within the range: -4 to 2"
+ assert (false);
+ return UNKNOWN;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java
index ef8f72711..8f24609cc 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java
@@ -48,10 +48,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
if(row.size()==skyscrapersboard.getWidth()){
//from west border
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -64,10 +64,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//from east border
Collections.reverse(row);
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -84,10 +84,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
count = 0;
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -101,10 +101,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
Collections.reverse(col);
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java
index fb3764a2b..5b6b09f80 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java
@@ -48,10 +48,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
if(row.size()==skyscrapersboard.getWidth()){
//from west border
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -64,10 +64,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//from east border
Collections.reverse(row);
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -84,10 +84,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
count = 0;
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -101,10 +101,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
Collections.reverse(col);
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
index 327030e4b..23885724c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
@@ -44,8 +44,8 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
initialBoard.setDupeFlag(true);
initialBoard.setViewFlag(false);
CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
- ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
- ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
+ ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData().value);
+ ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData().value);
initialBoard.setDupeFlag(dupeTemp);
initialBoard.setViewFlag(viewTemp);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
index 57b724cd6..a72400a1b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
@@ -45,8 +45,8 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
initialBoard.setDupeFlag(false);
initialBoard.setViewFlag(true);
CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
- ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
- ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
+ ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData().value);
+ ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData().value);
initialBoard.setDupeFlag(dupeTemp);
initialBoard.setViewFlag(viewTemp);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
index 2b07cbb45..081b0b064 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
@@ -43,16 +43,16 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
Point loc = finalCell.getLocation();
int max = initialBoard.getHeight();
- if (initialBoard.getWestClues().get(loc.y).getData() == max && finalCell.getData() == loc.x + 1) {
+ if (initialBoard.getWestClues().get(loc.y).getData() == max && finalCell.getData().value == loc.x + 1) {
return null;
}
- if (initialBoard.getEastClues().get(loc.y).getData() == max && finalCell.getData() == max - loc.x) {
+ if (initialBoard.getEastClues().get(loc.y).getData() == max && finalCell.getData().value == max - loc.x) {
return null;
}
- if (initialBoard.getNorthClues().get(loc.x).getData() == max && finalCell.getData() == loc.y + 1) {
+ if (initialBoard.getNorthClues().get(loc.x).getData() == max && finalCell.getData().value == loc.y + 1) {
return null;
}
- if (initialBoard.getSouthClues().get(loc.x).getData() == max && finalCell.getData() == max - loc.y) {
+ if (initialBoard.getSouthClues().get(loc.x).getData() == max && finalCell.getData().value == max - loc.y) {
return null;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java
index 1d96b3ed6..435271e08 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java
@@ -62,7 +62,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//don't do anything if already in row
boolean exists = false;
for(SkyscrapersCell c : temp.getRowCol(loc.y,SkyscrapersType.Number,true)){
- if(c.getData()==num) {
+ if(c.getData().value==num) {
exists = true;
break;
}
@@ -102,7 +102,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//don't do anything if already in col
boolean exists = false;
for(SkyscrapersCell c : temp.getRowCol(loc.x,SkyscrapersType.Number,false)){
- if(c.getData()==num) {
+ if(c.getData().value==num) {
exists = true;
break;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java
index e3b27a777..7a4da0372 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java
@@ -43,7 +43,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//isn't already present
boolean exists = false;
for(SkyscrapersCell presentCell : skyscrapersBoard.getRowCol(loc.y,SkyscrapersType.Number,true)) {
- if (presentCell.getData() == num) {
+ if (presentCell.getData().value == num) {
exists = true;
break;
}
@@ -59,7 +59,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//same process as for row
exists = false;
for(SkyscrapersCell presentCell : skyscrapersBoard.getRowCol(loc.x,SkyscrapersType.Number,false)) {
- if(presentCell.getData() == num) {
+ if(presentCell.getData().value == num) {
exists = true;
break;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
index 6e13d70dc..cac5b6209 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
@@ -1,6 +1,7 @@
package edu.rpi.legup.puzzle.sudoku;
import edu.rpi.legup.model.gameboard.GridCell;
+import edu.rpi.legup.puzzle.sudoku.elements.NumberTile;
import java.awt.*;
import java.util.HashSet;
From 925672210f8d43a01ca196f1781e3e2688a9c3ea Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 7 Feb 2023 17:24:19 -0500
Subject: [PATCH 022/148] removed an import line in SudokuCell that was
unnecessarily added
---
src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
index cac5b6209..6e13d70dc 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
@@ -1,7 +1,6 @@
package edu.rpi.legup.puzzle.sudoku;
import edu.rpi.legup.model.gameboard.GridCell;
-import edu.rpi.legup.puzzle.sudoku.elements.NumberTile;
import java.awt.*;
import java.util.HashSet;
From b18b66aaa95b0de8ced86c3584638b04313ff529 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 7 Feb 2023 17:18:28 -0500
Subject: [PATCH 023/148] changed SkyscrapersCell class to use its own
respective class type, SkyScrapersType instead of int. modified the files
initializing/utilizing SkyscrapersCell to use SkyScrapersType.
---
.../puzzle/skyscrapers/SkyscrapersCell.java | 9 +++++----
.../skyscrapers/SkyscrapersCellFactory.java | 2 +-
.../skyscrapers/SkyscrapersController.java | 14 ++++++++------
.../skyscrapers/SkyscrapersElementView.java | 2 +-
.../puzzle/skyscrapers/SkyscrapersExporter.java | 2 +-
.../puzzle/skyscrapers/SkyscrapersImporter.java | 4 ++--
.../puzzle/skyscrapers/SkyscrapersType.java | 16 ++++++++++++++++
.../ExceedingVisibilityContradictionRule.java | 16 ++++++++--------
.../InsufficientVisibilityContradictionRule.java | 16 ++++++++--------
.../rules/LastSingularCellDirectRule.java | 4 ++--
.../rules/LastVisibleCellDirectRule.java | 4 ++--
.../skyscrapers/rules/NEdgeDirectRule.java | 8 ++++----
.../PreemptiveVisibilityContradictionRule.java | 4 ++--
.../rules/UnresolvedNumberContradictionRule.java | 4 ++--
.../edu/rpi/legup/puzzle/sudoku/SudokuCell.java | 1 +
15 files changed, 63 insertions(+), 43 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java
index 74d753666..1cd0e35f5 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCell.java
@@ -4,23 +4,24 @@
import java.awt.*;
-public class SkyscrapersCell extends GridCell {
+public class SkyscrapersCell extends GridCell {
private int max;
- public SkyscrapersCell(int valueInt, Point location, int size) {
- super(valueInt, location);
+ public SkyscrapersCell(SkyscrapersType value, Point location, int size) {
+ super(value, location);
this.max = size;
}
public SkyscrapersType getType() {
switch (data) {
- case 0:
+ case UNKNOWN:
return SkyscrapersType.UNKNOWN;
default:
return SkyscrapersType.Number;
}
}
+
public int getMax() {
return max;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java
index b6329aac2..6f0c6edfd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersCellFactory.java
@@ -39,7 +39,7 @@ public PuzzleElement importCell(Node node, Board board) throws InvalidFileFormat
throw new InvalidFileFormatException("TreeTent Factory: cell unknown value");
}
- SkyscrapersCell cell = new SkyscrapersCell(value, new Point(x, y), width);
+ SkyscrapersCell cell = new SkyscrapersCell(SkyscrapersType.convertToSkyType(value), new Point(x, y), width);
cell.setIndex(y * height + x);
return cell;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java
index 0558213ab..c97bf7ba6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersController.java
@@ -97,20 +97,22 @@ public void mouseReleased(MouseEvent e) {
public void changeCell(MouseEvent e, PuzzleElement element) {
SkyscrapersCell cell = (SkyscrapersCell) element;
if (e.getButton() == MouseEvent.BUTTON1) {
- if (cell.getData() < cell.getMax()) {
- cell.setData(cell.getData() + 1);
+ if (cell.getData().value < cell.getMax()) {
+ int num = cell.getData().value + 1;
+ cell.setData(cell.getData().convertToSkyType(num));
}
else {
- cell.setData(0);
+ cell.setData(SkyscrapersType.UNKNOWN);
}
}
else {
if (e.getButton() == MouseEvent.BUTTON3) {
- if (cell.getData() > 0) {
- cell.setData(cell.getData() - 1);
+ if (cell.getData().value > 0) {
+ int num = cell.getData().value - 1;
+ cell.setData(cell.getData().convertToSkyType(num));
}
else {
- cell.setData(cell.getMax());
+ cell.setData(cell.getData().convertToSkyType(cell.getMax()));
}
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java
index 533437d67..f55fc5a64 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersElementView.java
@@ -23,7 +23,7 @@ public void drawElement(Graphics2D graphics2D) {
graphics2D.drawRect(location.x, location.y, size.width, size.height);
SkyscrapersCell cell = (SkyscrapersCell) puzzleElement;
- int val = cell.getData();
+ int val = cell.getData().value;
if (val != 0) {
graphics2D.setColor(FONT_COLOR);
graphics2D.setFont(FONT);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java
index dac09bd16..60803a635 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersExporter.java
@@ -21,7 +21,7 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {
org.w3c.dom.Element cellsElement = newDocument.createElement("cells");
for (PuzzleElement puzzleElement : board.getPuzzleElements()) {
SkyscrapersCell cell = (SkyscrapersCell) puzzleElement;
- if (cell.getData() != 0) {
+ if (cell.getData().value != 0) {
org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, puzzleElement);
cellsElement.appendChild(cellElement);
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java
index c4c909172..95098c7e3 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersImporter.java
@@ -63,7 +63,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int i = 0; i < elementDataList.getLength(); i++) {
SkyscrapersCell cell = (SkyscrapersCell) puzzle.getFactory().importCell(elementDataList.item(i), skyscrapersBoard);
Point loc = cell.getLocation();
- if (cell.getData() != 0) {
+ if (cell.getData().value != 0) {
cell.setModifiable(false);
cell.setGiven(true);
}
@@ -73,7 +73,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
if (skyscrapersBoard.getCell(x, y) == null) {
- SkyscrapersCell cell = new SkyscrapersCell(0, new Point(x, y), size);
+ SkyscrapersCell cell = new SkyscrapersCell(SkyscrapersType.UNKNOWN, new Point(x, y), size);
cell.setIndex(y * size + x);
cell.setModifiable(true);
skyscrapersBoard.setCell(x, y, cell);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
index 1fdd668c1..ca0e76564 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
@@ -8,4 +8,20 @@ public enum SkyscrapersType {
SkyscrapersType(int value) {
this.value = value;
}
+
+ public static SkyscrapersType convertToSkyType(int num) {
+ if (num == 0) return UNKNOWN;
+ else if (num == 1) return Number;
+ else if (num == 2) return ANY;
+ else if (num == -1) return CLUE_NORTH;
+ else if (num == -2) return CLUE_EAST;
+ else if (num == -3) return CLUE_SOUTH;
+ else if (num == -4) return CLUE_WEST;
+ else {
+ //throw new Exception("conversion from int to SkyscapersType cannot be done; int must be within the range: -4 to 2");
+ // conversion from int to SkyscapersType cannot be done; int must be within the range: -4 to 2"
+ assert (false);
+ return UNKNOWN;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java
index ef8f72711..8f24609cc 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/ExceedingVisibilityContradictionRule.java
@@ -48,10 +48,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
if(row.size()==skyscrapersboard.getWidth()){
//from west border
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -64,10 +64,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//from east border
Collections.reverse(row);
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -84,10 +84,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
count = 0;
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -101,10 +101,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
Collections.reverse(col);
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java
index fb3764a2b..5b6b09f80 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/InsufficientVisibilityContradictionRule.java
@@ -48,10 +48,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
if(row.size()==skyscrapersboard.getWidth()){
//from west border
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -64,10 +64,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//from east border
Collections.reverse(row);
for(SkyscrapersCell c : row){
- if (c.getData() > max) {
+ if (c.getData().value > max) {
System.out.print(c.getData());
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -84,10 +84,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
count = 0;
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
@@ -101,10 +101,10 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
Collections.reverse(col);
for(SkyscrapersCell c : col){
System.out.println(c.getData());
- if (c.getData() > max) {
+ if (c.getData().value > max) {
//System.out.println(cell.getData());
- max = c.getData();
+ max = c.getData().value;
count++;
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
index 327030e4b..23885724c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastSingularCellDirectRule.java
@@ -44,8 +44,8 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
initialBoard.setDupeFlag(true);
initialBoard.setViewFlag(false);
CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
- ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
- ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
+ ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData().value);
+ ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData().value);
initialBoard.setDupeFlag(dupeTemp);
initialBoard.setViewFlag(viewTemp);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
index 57b724cd6..a72400a1b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/LastVisibleCellDirectRule.java
@@ -45,8 +45,8 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
initialBoard.setDupeFlag(false);
initialBoard.setViewFlag(true);
CellForNumberCaseRule caseRule = new CellForNumberCaseRule();
- ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData());
- ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData());
+ ArrayList XCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getWestClues().get(finalCell.getLocation().y),(Integer)finalCell.getData().value);
+ ArrayList YCandidates = caseRule.getCasesFor(initialBoard,initialBoard.getNorthClues().get(finalCell.getLocation().x),(Integer)finalCell.getData().value);
initialBoard.setDupeFlag(dupeTemp);
initialBoard.setViewFlag(viewTemp);
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
index 2b07cbb45..081b0b064 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NEdgeDirectRule.java
@@ -43,16 +43,16 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
Point loc = finalCell.getLocation();
int max = initialBoard.getHeight();
- if (initialBoard.getWestClues().get(loc.y).getData() == max && finalCell.getData() == loc.x + 1) {
+ if (initialBoard.getWestClues().get(loc.y).getData() == max && finalCell.getData().value == loc.x + 1) {
return null;
}
- if (initialBoard.getEastClues().get(loc.y).getData() == max && finalCell.getData() == max - loc.x) {
+ if (initialBoard.getEastClues().get(loc.y).getData() == max && finalCell.getData().value == max - loc.x) {
return null;
}
- if (initialBoard.getNorthClues().get(loc.x).getData() == max && finalCell.getData() == loc.y + 1) {
+ if (initialBoard.getNorthClues().get(loc.x).getData() == max && finalCell.getData().value == loc.y + 1) {
return null;
}
- if (initialBoard.getSouthClues().get(loc.x).getData() == max && finalCell.getData() == max - loc.y) {
+ if (initialBoard.getSouthClues().get(loc.x).getData() == max && finalCell.getData().value == max - loc.y) {
return null;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java
index 1d96b3ed6..435271e08 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/PreemptiveVisibilityContradictionRule.java
@@ -62,7 +62,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//don't do anything if already in row
boolean exists = false;
for(SkyscrapersCell c : temp.getRowCol(loc.y,SkyscrapersType.Number,true)){
- if(c.getData()==num) {
+ if(c.getData().value==num) {
exists = true;
break;
}
@@ -102,7 +102,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//don't do anything if already in col
boolean exists = false;
for(SkyscrapersCell c : temp.getRowCol(loc.x,SkyscrapersType.Number,false)){
- if(c.getData()==num) {
+ if(c.getData().value==num) {
exists = true;
break;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java
index e3b27a777..7a4da0372 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/UnresolvedNumberContradictionRule.java
@@ -43,7 +43,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//isn't already present
boolean exists = false;
for(SkyscrapersCell presentCell : skyscrapersBoard.getRowCol(loc.y,SkyscrapersType.Number,true)) {
- if (presentCell.getData() == num) {
+ if (presentCell.getData().value == num) {
exists = true;
break;
}
@@ -59,7 +59,7 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
//same process as for row
exists = false;
for(SkyscrapersCell presentCell : skyscrapersBoard.getRowCol(loc.x,SkyscrapersType.Number,false)) {
- if(presentCell.getData() == num) {
+ if(presentCell.getData().value == num) {
exists = true;
break;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
index 6e13d70dc..cac5b6209 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
@@ -1,6 +1,7 @@
package edu.rpi.legup.puzzle.sudoku;
import edu.rpi.legup.model.gameboard.GridCell;
+import edu.rpi.legup.puzzle.sudoku.elements.NumberTile;
import java.awt.*;
import java.util.HashSet;
From caf0428d7d46a04825700093fc11b6ef953c8055 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 7 Feb 2023 17:24:19 -0500
Subject: [PATCH 024/148] removed an import line in SudokuCell that was
unnecessarily added
---
src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
index cac5b6209..6e13d70dc 100644
--- a/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/sudoku/SudokuCell.java
@@ -1,7 +1,6 @@
package edu.rpi.legup.puzzle.sudoku;
import edu.rpi.legup.model.gameboard.GridCell;
-import edu.rpi.legup.puzzle.sudoku.elements.NumberTile;
import java.awt.*;
import java.util.HashSet;
From 95128caadc67b0277c850b516628a82e4f305095 Mon Sep 17 00:00:00 2001
From: charlestian23
Date: Fri, 10 Feb 2023 16:13:22 -0500
Subject: [PATCH 025/148] Changed "Legup" to "LEGUP"
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5b80048ec..0567fac4c 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
-Legup (**L**ogic **E**ngine for **G**rid-**U**sing **P**uzzles) is a better way to learn formal logic. It was created by [Dr. Bram van Heuveln](https://science.rpi.edu/itws/faculty/bram-van-heuveln), whose goal for this project is to provide a better interface for students to learn the basic principles of logical reasoning.
+LEGUP (**L**ogic **E**ngine for **G**rid-**U**sing **P**uzzles) is a better way to learn formal logic. It was created by [Dr. Bram van Heuveln](https://science.rpi.edu/itws/faculty/bram-van-heuveln), whose goal for this project is to provide a better interface for students to learn the basic principles of logical reasoning.
> Note: A web version of Legup ([Bram-Hub/LegupWeb](https://github.com/Bram-Hub/LegupWeb)) based on this app version of Legup is actively being developed. However, it is very much in the early stages of development and will not be ready for general use for quite a while. Contributions to both versions of Legup are greatly appreciated. If you are interested in using Legup for educational purposes, please use this app version.
From b78f8ebacf54dd79161df364e43f677eee0e4021 Mon Sep 17 00:00:00 2001
From: charlestian23
Date: Fri, 10 Feb 2023 16:19:34 -0500
Subject: [PATCH 026/148] Update README.md
---
README.md | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/README.md b/README.md
index 0567fac4c..46bdab2e7 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
LEGUP (**L**ogic **E**ngine for **G**rid-**U**sing **P**uzzles) is a better way to learn formal logic. It was created by [Dr. Bram van Heuveln](https://science.rpi.edu/itws/faculty/bram-van-heuveln), whose goal for this project is to provide a better interface for students to learn the basic principles of logical reasoning.
-> Note: A web version of Legup ([Bram-Hub/LegupWeb](https://github.com/Bram-Hub/LegupWeb)) based on this app version of Legup is actively being developed. However, it is very much in the early stages of development and will not be ready for general use for quite a while. Contributions to both versions of Legup are greatly appreciated. If you are interested in using Legup for educational purposes, please use this app version.
+> Note: A web version of LEGUP ([Bram-Hub/LegupWeb](https://github.com/Bram-Hub/LegupWeb)) based on this app version of LEGUP is actively being developed. However, it is very much in the early stages of development and will not be ready for general use for quite a while. Contributions to both versions of LEGUP are greatly appreciated. If you are interested in using LEGUP for educational purposes, please use this app version.
## Table of Contents
- [Background](#background)
@@ -27,40 +27,40 @@ Dr. van Heuveln has taught logic courses on a frequent basis for the past 15 yea
This project brings about the idea that there are more pedagogically effective ways for students to learn the basic and important principles of logical reasoning.
-Legup uses a more visual representation in a more concrete and engaging environment. These and other features of the Legup interface are suspected to have several advantages over more traditional interfaces in terms of learning logic.
+LEGUP uses a more visual representation in a more concrete and engaging environment. These and other features of the LEGUP interface are suspected to have several advantages over more traditional interfaces in terms of learning logic.
## Use Cases
-The Legup interface allows the user to solve different types of grid-based logical puzzles. Probably the best known example of such a puzzle is the popular Sudoku puzzle, but there are many other types of puzzles that are based on the principle of filling in cells of a square or rectangular grid with different kinds of objects. In all cases, the user is provided certain clues that will force a unique configuration of objects in the grid. These types of puzzles are often advertised as "logic puzzles," and are claimed to train one's logical mind as, using deduction, users should be able to infer which object goes where.
+The LEGUP interface allows the user to solve different types of grid-based logical puzzles. Probably the best known example of such a puzzle is the popular Sudoku puzzle, but there are many other types of puzzles that are based on the principle of filling in cells of a square or rectangular grid with different kinds of objects. In all cases, the user is provided certain clues that will force a unique configuration of objects in the grid. These types of puzzles are often advertised as "logic puzzles," and are claimed to train one's logical mind as, using deduction, users should be able to infer which object goes where.
-So, how does the Legup interface differ from online platforms for grid-based games? The most important difference is that the Legup interface requires the user to explicitly indicate their logical reasoning. Thus, solving the puzzle due to some lucky guesses is no longer an option! The interface will congratulate the user less on the fact that the user was able to solve the puzzle, but more on how the user solved the puzzle. This is essential to logic. Logic is not about the truth or the correct or best answer, but about deductive implication and valid inference. What follows from what, and why?
+So, how does the LEGUP interface differ from online platforms for grid-based games? The most important difference is that the LEGUP interface requires the user to explicitly indicate their logical reasoning. Thus, solving the puzzle due to some lucky guesses is no longer an option! The interface will congratulate the user less on the fact that the user was able to solve the puzzle, but more on how the user solved the puzzle. This is essential to logic. Logic is not about the truth or the correct or best answer, but about deductive implication and valid inference. What follows from what, and why?
-Legup also provides a single interface that is capable of supporting many different types of puzzles. Since most of the interface remains the same, however, users wil start to recognize certain similarities between the different puzzles. In particular, since they have to explicitly state their reasoning, users should start to see strong similarities in their logical reasoning patterns from puzzle to puzzle, is the very basis of the abstract logical reasoning principles taught in traditional logic courses. However, rather than being "thrown in the water" with abstract principles based on obscure symbols, users instead are dealing with a concrete, fun, and engaging logic puzzle. As such, Legup aims to give its users a "leg up" when it comes to the understanding of logic.
+LEGUP also provides a single interface that is capable of supporting many different types of puzzles. Since most of the interface remains the same, however, users wil start to recognize certain similarities between the different puzzles. In particular, since they have to explicitly state their reasoning, users should start to see strong similarities in their logical reasoning patterns from puzzle to puzzle, is the very basis of the abstract logical reasoning principles taught in traditional logic courses. However, rather than being "thrown in the water" with abstract principles based on obscure symbols, users instead are dealing with a concrete, fun, and engaging logic puzzle. As such, LEGUP aims to give its users a "leg up" when it comes to the understanding of logic.
## For Educators
-If you are an educator interested in using Legup, go to the [releases page](https://github.com/Bram-Hub/Legup/releases) to download the latest release of Legup. You can have your students download Legup from the same page. Some sample puzzle files can be found in the [puzzle files folder](https://github.com/Bram-Hub/Legup/tree/master/puzzles%20files).
+If you are an educator interested in using LEGUP, go to the [releases page](https://github.com/Bram-Hub/Legup/releases) to download the latest release of LEGUP. You can have your students download LEGUP from the same page. Some sample puzzle files can be found in the [puzzle files folder](https://github.com/Bram-Hub/Legup/tree/master/puzzles%20files).
## For Students
-If you are a student interested in learning the basics of logic, Legup is a great way for you to get started. If your instructor is using Legup in the classroom and you are looking for extra practice, you can reference the sample puzzle files can be found in the [puzzle files folder](https://github.com/Bram-Hub/Legup/tree/master/puzzles%20files) to get more practice.
+If you are a student interested in learning the basics of logic, LEGUP is a great way for you to get started. If your instructor is using LEGUP in the classroom and you are looking for extra practice, you can reference the sample puzzle files can be found in the [puzzle files folder](https://github.com/Bram-Hub/Legup/tree/master/puzzles%20files) to get more practice.
-Additionally, if you are interested in computer science and programming, please consider contributing to Legup! Not only would it a great way to practice logical reasoning, but it is also a great way to dip your toes into open source software and contributing to open source projects.
+Additionally, if you are interested in computer science and programming, please consider contributing to LEGUP! Not only would it a great way to practice logical reasoning, but it is also a great way to dip your toes into open source software and contributing to open source projects.
## Documentation
-Documentation is actively being worked on on the [Legup wiki](https://github.com/Bram-Hub/Legup/wiki).
+Documentation is actively being worked on on the [LEGUP wiki](https://github.com/Bram-Hub/Legup/wiki).
-Documentation is very much in the early stages, and we would greatly appreciate anyone who is willing to help write and structure the documentation. Currently, the priority is to write detailed documentation on how Nurikabe works, as it is the puzzle that is the most developed within Legup.
+Documentation is very much in the early stages, and we would greatly appreciate anyone who is willing to help write and structure the documentation. Currently, the priority is to write detailed documentation on how Nurikabe works, as it is the puzzle that is the most developed within LEGUP.
## Contributing
-All contributions to Legup will be greatly appreciated. Currently, we need the most help in the following areas:
+All contributions to LEGUP will be greatly appreciated. Currently, we need the most help in the following areas:
- Documentation
- Test suites
-Please read our [contribution guidelines](CONTRIBUTING.md) for more detailed guidelines on how to contribute to Legup.
+Please read our [contribution guidelines](CONTRIBUTING.md) for more detailed guidelines on how to contribute to LEGUP.
## License
-Legup is licensed under the GPL-3.0 license, which can be viewed [here](LICENSE).
+LEGUP is licensed under the GPL-3.0 license, which can be viewed [here](LICENSE).
```
-Legup: A Better Way to Learn Formal Logic
-Copyright (C) 2022, the Legup Developers
+LEGUP: A Better Way to Learn Formal Logic
+Copyright (C) 2022, the LEGUP Developers
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -78,4 +78,4 @@ along with this program. If not, see .
The look and feel of LEGUP uses [FlatLaf](https://github.com/JFormDesigner/FlatLaf), which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
-Some of the icons used in Legup were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
+Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
From 99ba8259f14725bb1526615fdca8c3be9b1f610d Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 10 Feb 2023 16:27:03 -0500
Subject: [PATCH 027/148] removed unnecessary comments in convertToSkyType
---
.../java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
index ca0e76564..3abe5de0a 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
@@ -18,9 +18,6 @@ public static SkyscrapersType convertToSkyType(int num) {
else if (num == -3) return CLUE_SOUTH;
else if (num == -4) return CLUE_WEST;
else {
- //throw new Exception("conversion from int to SkyscapersType cannot be done; int must be within the range: -4 to 2");
- // conversion from int to SkyscapersType cannot be done; int must be within the range: -4 to 2"
- assert (false);
return UNKNOWN;
}
}
From 69d6ddf5a7619eecb085effdf43abf7f08203dc0 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 10 Feb 2023 16:33:19 -0500
Subject: [PATCH 028/148] added brackets after if statements to match
checkstyle
---
.../puzzle/skyscrapers/SkyscrapersType.java | 28 ++++++++++++++-----
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
index 3abe5de0a..8b0ef01b1 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
@@ -10,13 +10,27 @@ public enum SkyscrapersType {
}
public static SkyscrapersType convertToSkyType(int num) {
- if (num == 0) return UNKNOWN;
- else if (num == 1) return Number;
- else if (num == 2) return ANY;
- else if (num == -1) return CLUE_NORTH;
- else if (num == -2) return CLUE_EAST;
- else if (num == -3) return CLUE_SOUTH;
- else if (num == -4) return CLUE_WEST;
+ if (num == 0) {
+ return UNKNOWN;
+ }
+ else if (num == 1) {
+ return Number;
+ }
+ else if (num == 2) {
+ return ANY;
+ }
+ else if (num == -1) {
+ return CLUE_NORTH;
+ }
+ else if (num == -2) {
+ return CLUE_EAST;
+ }
+ else if (num == -3) {
+ return CLUE_SOUTH;
+ }
+ else if (num == -4) {
+ return CLUE_WEST;
+ }
else {
return UNKNOWN;
}
From 7b48556602655bacc598f89696a76a8fd7073f90 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 10 Feb 2023 17:18:32 -0500
Subject: [PATCH 029/148] Made MasyuCell use its own custom type, MasyuType.
Added convertToMasyuType() function to convert int into MasyuType.
---
.../edu/rpi/legup/puzzle/masyu/MasyuCell.java | 12 ++++++------
.../legup/puzzle/masyu/MasyuCellFactory.java | 2 +-
.../legup/puzzle/masyu/MasyuController.java | 4 ++--
.../rpi/legup/puzzle/masyu/MasyuExporter.java | 6 ++----
.../rpi/legup/puzzle/masyu/MasyuImporter.java | 4 ++--
.../edu/rpi/legup/puzzle/masyu/MasyuType.java | 19 ++++++++++++++++++-
6 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java
index 1510a3124..1a1fe9e4d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java
@@ -4,21 +4,21 @@
import java.awt.*;
-public class MasyuCell extends GridCell {
+public class MasyuCell extends GridCell {
- public MasyuCell(int value, Point location) {
+ public MasyuCell(MasyuType value, Point location) {
super(value, location);
}
public MasyuType getType() {
switch (data) {
- case 0:
+ case UNKNOWN:
return MasyuType.UNKNOWN;
- case 1:
+ case BLACK:
return MasyuType.BLACK;
- case 2:
+ case WHITE:
return MasyuType.WHITE;
- case 3:
+ case LINE:
return MasyuType.LINE;
default:
return null;
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCellFactory.java
index eb26ce514..27120f097 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCellFactory.java
@@ -41,7 +41,7 @@ public MasyuCell importCell(Node node, Board board) throws InvalidFileFormatExce
throw new InvalidFileFormatException("Masyu Factory: cell unknown value");
}
- MasyuCell cell = new MasyuCell(value, new Point(x, y));
+ MasyuCell cell = new MasyuCell(MasyuType.convertToMasyuType(value), new Point(x, y));
cell.setIndex(y * height + x);
return cell;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuController.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuController.java
index 67894f368..cccdea047 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuController.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuController.java
@@ -88,10 +88,10 @@ public void mouseReleased(MouseEvent e) {
@Override
public void changeCell(MouseEvent e, PuzzleElement data) {
MasyuCell cell = (MasyuCell) data;
- if(cell.getData() == 1 || cell.getData() == 2) {
+ if(cell.getData() == MasyuType.BLACK || cell.getData() == MasyuType.WHITE) {
return;
}
- if(cell.getData() == 0) {
+ if(cell.getData() == MasyuType.UNKNOWN) {
data.setData(3);
}
else {
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuExporter.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuExporter.java
index a5ff7eb6b..471be22f1 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuExporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuExporter.java
@@ -21,10 +21,8 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {
org.w3c.dom.Element cellsElement = newDocument.createElement("cells");
for (PuzzleElement puzzleElement : board.getPuzzleElements()) {
MasyuCell cell = (MasyuCell) puzzleElement;
- if (cell.getData() != -2) {
- org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, puzzleElement);
- cellsElement.appendChild(cellElement);
- }
+ org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, puzzleElement);
+ cellsElement.appendChild(cellElement);
}
boardElement.appendChild(cellsElement);
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuImporter.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuImporter.java
index b17338d21..0f439a780 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuImporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuImporter.java
@@ -67,7 +67,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int i = 0; i < elementDataList.getLength(); i++) {
MasyuCell cell = (MasyuCell) puzzle.getFactory().importCell(elementDataList.item(i), masyuBoard);
Point loc = cell.getLocation();
- if (cell.getData() != 0) {
+ if (cell.getData() != MasyuType.UNKNOWN) {
cell.setModifiable(false);
cell.setGiven(true);
}
@@ -77,7 +77,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (masyuBoard.getCell(x, y) == null) {
- MasyuCell cell = new MasyuCell(0, new Point(x, y));
+ MasyuCell cell = new MasyuCell(MasyuType.UNKNOWN, new Point(x, y));
cell.setIndex(y * height + x);
cell.setModifiable(true);
masyuBoard.setCell(x, y, cell);
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
index fa6abdfb6..72a787bab 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
@@ -1,5 +1,22 @@
package edu.rpi.legup.puzzle.masyu;
+import edu.rpi.legup.puzzle.skyscrapers.SkyscrapersType;
+
public enum MasyuType {
- UNKNOWN, BLACK, WHITE, LINE
+ UNKNOWN, BLACK, WHITE, LINE;
+
+ public static MasyuType convertToMasyuType(int num) {
+ if (num == 0) {
+ return UNKNOWN;
+ } else if (num == 1) {
+ return BLACK;
+ } else if (num == 2) {
+ return WHITE;
+ } else if (num == 3) {
+ return LINE;
+ } else {
+ return UNKNOWN;
+ }
+ }
}
+
From 66fd2fa54a0d9f521721e47153c82a60e4b27428 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 10 Feb 2023 17:22:12 -0500
Subject: [PATCH 030/148] Fixed spacing to match checkStyle
---
.../java/edu/rpi/legup/puzzle/masyu/MasyuType.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
index 72a787bab..7e9bb9f59 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
@@ -8,13 +8,17 @@ public enum MasyuType {
public static MasyuType convertToMasyuType(int num) {
if (num == 0) {
return UNKNOWN;
- } else if (num == 1) {
+ }
+ else if (num == 1) {
return BLACK;
- } else if (num == 2) {
+ }
+ else if (num == 2) {
return WHITE;
- } else if (num == 3) {
+ }
+ else if (num == 3) {
return LINE;
- } else {
+ }
+ else {
return UNKNOWN;
}
}
From 3283ee905a58a2c97f52a37aa6ba3a8ab316c0d7 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 10 Feb 2023 17:37:10 -0500
Subject: [PATCH 031/148] Fixed typos in comments for short truth tables
---
.../ShortTruthTableCellFactory.java | 4 ++--
.../ShortTruthTableController.java | 2 +-
.../ShortTruthTableElementView.java | 2 +-
.../shorttruthtable/ShortTruthTableImporter.java | 2 +-
.../ShortTruthTableStatement.java | 16 ++++------------
5 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableCellFactory.java
index 4c41b5858..0e32eb7cf 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableCellFactory.java
@@ -29,13 +29,13 @@ public ShortTruthTableCell importCell(Node node, Board board) throws InvalidFile
ShortTruthTableBoard sttBoard = (ShortTruthTableBoard) board;
- //get the atributes for the cell
+ //get the attributes for the cell
NamedNodeMap attributeList = node.getAttributes();
int rowIndex = Integer.valueOf(attributeList.getNamedItem("row_index").getNodeValue());
int charIndex = Integer.valueOf(attributeList.getNamedItem("char_index").getNodeValue());
String cellType = attributeList.getNamedItem("type").getNodeValue();
- //modify the appropriet cell
+ //modify the appropriate cell
ShortTruthTableCell cell = (ShortTruthTableCell) sttBoard.getCell(charIndex, rowIndex * 2);
cell.setData(ShortTruthTableCellType.valueOf(cellType));
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableController.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableController.java
index a870f38cd..ccf4e9274 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableController.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableController.java
@@ -12,7 +12,7 @@ public void changeCell(MouseEvent e, PuzzleElement data) {
System.out.println("STTController: Cell change");
- //cast the data to a short truth tablce cell
+ //cast the data to a short truth table cell
ShortTruthTableCell cell = (ShortTruthTableCell) data;
if (e.getButton() == MouseEvent.BUTTON1) {
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java
index b3a04a690..3271efabd 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java
@@ -33,7 +33,7 @@ public ShortTruthTableCell getPuzzleElement() {
@Override
public void drawElement(Graphics2D graphics2D) {
- //get informatino about the cell
+ //get information about the cell
ShortTruthTableCell cell = (ShortTruthTableCell) puzzleElement;
ShortTruthTableCellType type = cell.getData();
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableImporter.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableImporter.java
index c7c2c87c2..347175867 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableImporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableImporter.java
@@ -30,7 +30,7 @@ public ShortTruthTableImporter(ShortTruthTable stt) {
*/
private List getCells(String statement, int y) {
List cells = new ArrayList();
- //go through each char in the statment and make a cell for it
+ //go through each char in the statement and make a cell for it
for (int i = 0; i < statement.length(); i++) {
char c = statement.charAt(i);
ShortTruthTableCell cell = new ShortTruthTableCell(c, ShortTruthTableCellType.getDefaultType(c), new Point(i, y));
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableStatement.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableStatement.java
index d8ad1825d..bb0ffcf08 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableStatement.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableStatement.java
@@ -35,7 +35,7 @@ private ShortTruthTableStatement(String statement, ShortTruthTableStatement pare
this.parentStatement = parent;
- //set the string rep to the statement (include parens incase this is a sub statement)
+ //set the string rep to the statement (include parens in case this is a sub statement)
this.stringRep = statement;
this.cells = new ArrayList(cells);
@@ -58,7 +58,7 @@ private ShortTruthTableStatement(String statement, ShortTruthTableStatement pare
List leftCells = new ArrayList(cells.subList(0, index));
List rightCells = new ArrayList(cells.subList(index + 1, cells.size()));
- //cunstruct substatements if necessary
+ //construct sub-statements if necessary
if (left.length() > 0) {
leftStatement = new ShortTruthTableStatement(left, this, leftCells);
}
@@ -237,21 +237,13 @@ public Set getCellsWithSymbol(char symbol) {
return set;
}
-// public Set getAllCells(){
-// Set set = new HashSet(getLength());
-// set.add(cell);
-// if(leftStatement != null) set.addAll(leftStatement.getAllCells());
-// if(rightStatement != null) set.addAll(rightStatement.getAllCells());
-// return set;
-// }
-
/**
* Returns an array of three elements where [0] is the left
* statement type, [1] is this statement type, and [2] is the
* right statement type. null means either the statement doesn't
* exist or is is an unknown value.
*
- * @return the assigned values to this statement and its substatements
+ * @return the assigned values to this statement and its sub-statements
*/
public ShortTruthTableCellType[] getCellTypePattern() {
//get this type and the right type, they will always be used
@@ -297,7 +289,7 @@ public ShortTruthTableStatement copy() {
for (ShortTruthTableCell c : cells) {
cellsCopy.add(c.copy());
}
- //make a copy of the statement with all of the copied cells
+ //make a copy of the statement with all the copied cells
ShortTruthTableStatement statementCopy = new ShortTruthTableStatement(stringRep, cellsCopy);
//return the new statement
return statementCopy;
From c0db239fdc95b5be6ff9ecddeab7fdbd92e9e0f4 Mon Sep 17 00:00:00 2001
From: David <67387813+DavidColetta@users.noreply.github.com>
Date: Fri, 10 Feb 2023 17:38:44 -0500
Subject: [PATCH 032/148] Pressing ENTER is the same as pressing Go putton in
rule search
---
.../rpi/legup/ui/proofeditorui/rulesview/RulePanel.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
index f0deab1d6..5db7beeb4 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
@@ -8,6 +8,7 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
@@ -204,7 +205,7 @@ public void setSearchBar(Puzzle allPuzzle){
searchBarPanel.add(textField);
searchBarPanel.add(Box.createRigidArea(new Dimension(1, 0)));
JButton findButton = new JButton("Go");
- findButton.addActionListener(new ActionListener() {
+ ActionListener action = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
if (ruleButtons != null) {
@@ -234,7 +235,9 @@ public void actionPerformed(ActionEvent event) {
}
}
- });
+ };
+ textField.addActionListener(action);
+ findButton.addActionListener(action);
searchBarPanel.add(findButton);
}
From b39e4d90b49718ae4c9f5d36c3980b98dd4e5f66 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 14 Feb 2023 16:22:55 -0500
Subject: [PATCH 033/148] refactored getType() function in MasyuCell class to
make it more straightforward
---
.../java/edu/rpi/legup/puzzle/masyu/MasyuCell.java | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java
index 1a1fe9e4d..af32dbfb6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuCell.java
@@ -11,18 +11,7 @@ public MasyuCell(MasyuType value, Point location) {
}
public MasyuType getType() {
- switch (data) {
- case UNKNOWN:
- return MasyuType.UNKNOWN;
- case BLACK:
- return MasyuType.BLACK;
- case WHITE:
- return MasyuType.WHITE;
- case LINE:
- return MasyuType.LINE;
- default:
- return null;
- }
+ return data;
}
@Override
From b6979ab80fe1780a1987b78bc966f34ccf76bc1f Mon Sep 17 00:00:00 2001
From: Jun Song <40209659+Acewvrs@users.noreply.github.com>
Date: Tue, 14 Feb 2023 16:30:21 -0500
Subject: [PATCH 034/148] Update
src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
Co-authored-by: Ivan Ho <41582274+Corppet@users.noreply.github.com>
---
src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
index 7e9bb9f59..94bce1464 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
@@ -6,6 +6,14 @@ public enum MasyuType {
UNKNOWN, BLACK, WHITE, LINE;
public static MasyuType convertToMasyuType(int num) {
+ switch (num)
+ {
+ case 0:
+ return UNKNOWN;
+ case 1:
+ return BLACK;
+ ...
+ }
if (num == 0) {
return UNKNOWN;
}
From 6271c0723673275c42e1b6d1637abe4fe7bd4a85 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 14 Feb 2023 16:31:34 -0500
Subject: [PATCH 035/148] refactored convertToSkyType() function make it use
switch statement instead of a bunch of if-else
---
.../puzzle/skyscrapers/SkyscrapersType.java | 38 ++++++++-----------
1 file changed, 15 insertions(+), 23 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
index 8b0ef01b1..7a394e83f 100644
--- a/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersType.java
@@ -10,29 +10,21 @@ public enum SkyscrapersType {
}
public static SkyscrapersType convertToSkyType(int num) {
- if (num == 0) {
- return UNKNOWN;
- }
- else if (num == 1) {
- return Number;
- }
- else if (num == 2) {
- return ANY;
- }
- else if (num == -1) {
- return CLUE_NORTH;
- }
- else if (num == -2) {
- return CLUE_EAST;
- }
- else if (num == -3) {
- return CLUE_SOUTH;
- }
- else if (num == -4) {
- return CLUE_WEST;
- }
- else {
- return UNKNOWN;
+ switch (num) {
+ case 1:
+ return Number;
+ case 2:
+ return ANY;
+ case -1:
+ return CLUE_NORTH;
+ case -2:
+ return CLUE_EAST;
+ case -3:
+ return CLUE_SOUTH;
+ case -4:
+ return CLUE_WEST;
+ default:
+ return UNKNOWN;
}
}
}
\ No newline at end of file
From 3130dc61d5e65a5ff3e7a83285d4375a63d81ca3 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 14 Feb 2023 16:34:14 -0500
Subject: [PATCH 036/148] refactored convertToMasyuType() function make it use
switch statement instead of a bunch of if-else
---
.../edu/rpi/legup/puzzle/masyu/MasyuType.java | 26 +++++--------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
index 94bce1464..94fbabab9 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
@@ -8,26 +8,14 @@ public enum MasyuType {
public static MasyuType convertToMasyuType(int num) {
switch (num)
{
- case 0:
- return UNKNOWN;
case 1:
- return BLACK;
- ...
- }
- if (num == 0) {
- return UNKNOWN;
- }
- else if (num == 1) {
- return BLACK;
- }
- else if (num == 2) {
- return WHITE;
- }
- else if (num == 3) {
- return LINE;
- }
- else {
- return UNKNOWN;
+ return BLACK;
+ case 2:
+ return WHITE;
+ case 3:
+ return LINE;
+ default:
+ return UNKNOWN;
}
}
}
From 6b3bca607fca43b3eb96155548401f02694e3e30 Mon Sep 17 00:00:00 2001
From: Jun
Date: Tue, 14 Feb 2023 16:51:54 -0500
Subject: [PATCH 037/148] changed the position of the left curly bracket in
convertToMasyuType() to match the checkStyle
---
src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
index 94fbabab9..264350a95 100644
--- a/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/masyu/MasyuType.java
@@ -6,8 +6,7 @@ public enum MasyuType {
UNKNOWN, BLACK, WHITE, LINE;
public static MasyuType convertToMasyuType(int num) {
- switch (num)
- {
+ switch (num) {
case 1:
return BLACK;
case 2:
From 2117964d5971f9b1dcdfdab3f678c645c18e28ce Mon Sep 17 00:00:00 2001
From: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Date: Fri, 17 Feb 2023 10:32:50 -0500
Subject: [PATCH 038/148] Delete result.csv
Removed a file that seems to be the result of running the batch grader. This file does not need to be in the repository.
---
result.csv | 1400 ----------------------------------------------------
1 file changed, 1400 deletions(-)
delete mode 100644 result.csv
diff --git a/result.csv b/result.csv
deleted file mode 100644
index 56c95e73a..000000000
--- a/result.csv
+++ /dev/null
@@ -1,1400 +0,0 @@
-Name,File Name,Puzzle Type,Score,Solved?
-.git,COMMIT_EDITMSG,Invalid,,Ungradeable
-.git,config,Invalid,,Ungradeable
-.git,description,Invalid,,Ungradeable
-.git,FETCH_HEAD,Invalid,,Ungradeable
-.git,HEAD,Invalid,,Ungradeable
-.git/hooks,applypatch-msg.sample,Invalid,,Ungradeable
-.git/hooks,commit-msg.sample,Invalid,,Ungradeable
-.git/hooks,fsmonitor-watchman.sample,Invalid,,Ungradeable
-.git/hooks,post-update.sample,Invalid,,Ungradeable
-.git/hooks,pre-applypatch.sample,Invalid,,Ungradeable
-.git/hooks,pre-commit.sample,Invalid,,Ungradeable
-.git/hooks,pre-merge-commit.sample,Invalid,,Ungradeable
-.git/hooks,pre-push.sample,Invalid,,Ungradeable
-.git/hooks,pre-rebase.sample,Invalid,,Ungradeable
-.git/hooks,pre-receive.sample,Invalid,,Ungradeable
-.git/hooks,prepare-commit-msg.sample,Invalid,,Ungradeable
-.git/hooks,push-to-checkout.sample,Invalid,,Ungradeable
-.git/hooks,update.sample,Invalid,,Ungradeable
-.git,index,Invalid,,Ungradeable
-.git/info,exclude,Invalid,,Ungradeable
-.git/logs,HEAD,Invalid,,Ungradeable
-.git/logs/refs/heads,batch-grader,Invalid,,Ungradeable
-.git/logs/refs/heads,dev,Invalid,,Ungradeable
-.git/logs/refs/heads,dev-my-self,Invalid,,Ungradeable
-.git/logs/refs/heads,master,Invalid,,Ungradeable
-.git/logs/refs/heads,OLD-Kevin,Invalid,,Ungradeable
-.git/logs/refs/heads/pr,315,Invalid,,Ungradeable
-.git/logs/refs/heads/pr,318,Invalid,,Ungradeable
-.git/logs/refs/heads/pr,321,Invalid,,Ungradeable
-.git/logs/refs/heads,test,Invalid,,Ungradeable
-.git/logs/refs/heads,ui-problem-309,Invalid,,Ungradeable
-.git/logs/refs/heads,ui-problem-for-saving-function,Invalid,,Ungradeable
-.git/logs/refs/heads,ui-saving-function,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,222-bug-selecting-a-rule-overlaps-other-rule-tabs,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,264-enhancement-allow-user-to-use-ctrl+shift+z-or-ctrl+y-for-redo,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,apply-button-grey-out-fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,cannotreachpathing,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,dev,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,fix_no_number_contradiction,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,general_algorithm,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,HEAD,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,issue138-stt-save-bugs,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,master,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,mustlightfix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,native-binary-windows,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,new_puzzle-skyscrapers,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-Jacob,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-JavaFxPort,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-Kevin,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-main,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-ManualPuzzleCreation,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-Mariano,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-PuzzleGenerator,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-RippleEffect,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-Sissi,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-Skyscrapers,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,OLD-TreeTent,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,puzzle-editor,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,scroll_speed_fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,shortcuts_issue38_macOS-commands,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,UI-101-issue,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,ui-103-menu-improvements,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,ui-241,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,ui-ctrl-+Y-for-undo,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,UI-Home-panel-preferences-option-does-not-pull-up-preferences-menu,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,UI-problem-for-allow-user-to-use-Ctrl+Shift+Z-or-Ctrl+Y-for-Redo,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,ui-problem-for-the-treeview-zoomfit()-long-term-fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,ui-problem-with-the-fix-the-space-in-perference-menu-and-may-fixed-the-apply,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-19690ao,WhiteBottleNeck_fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-BoZhiDeng,dev,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-BoZhiDeng,HEAD,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-BoZhiDeng,master,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-BoZhiDeng,patch-1,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-BoZhiDeng,patch-2,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,222-bug-selecting-a-rule-overlaps-other-rule-tabs,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,264-enhancement-allow-user-to-use-ctrl+shift+z-or-ctrl+y-for-redo,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,apply-button-grey-out-fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,dev,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,fix_no_number_contradiction,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,general_algorithm,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,HEAD,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,issue138-stt-save-bugs,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,master,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,native-binary-windows,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,new_puzzle-skyscrapers,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-Jacob,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-JavaFxPort,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-Kevin,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-main,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-ManualPuzzleCreation,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-Mariano,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-PuzzleGenerator,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-RippleEffect,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-Sissi,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-Skyscrapers,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,OLD-TreeTent,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,puzzle-editor,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,scroll_speed_fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,shortcuts_issue38_macOS-commands,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,UI-101-issue,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,ui-103-menu-improvements,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,ui-241,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,ui-ctrl-+Y-for-undo,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,UI-Home-panel-preferences-option-does-not-pull-up-preferences-menu,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,UI-problem-for-allow-user-to-use-Ctrl+Shift+Z-or-Ctrl+Y-for-Redo,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,ui-problem-for-the-treeview-zoomfit()-long-term-fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,ui-problem-with-the-fix-the-space-in-perference-menu-and-may-fixed-the-apply,Invalid,,Ungradeable
-.git/logs/refs/remotes/github-desktop-Tripplenut,WhiteBottleNeck_fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,batch-grader,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,dev,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,HEAD,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,master,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,ui-problem-309,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,ui-problem-for-saving-function,Invalid,,Ungradeable
-.git/logs/refs/remotes/origin,ui-saving-function,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,222-bug-selecting-a-rule-overlaps-other-rule-tabs,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,264-enhancement-allow-user-to-use-ctrl+shift+z-or-ctrl+y-for-redo,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,apply-button-grey-out-fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,dev,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,fix_no_number_contradiction,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,general_algorithm,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,HEAD,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,issue138-stt-save-bugs,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,master,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,native-binary-windows,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,new_puzzle-skyscrapers,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-Jacob,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-JavaFxPort,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-Kevin,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-main,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-ManualPuzzleCreation,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-Mariano,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-PuzzleGenerator,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-RippleEffect,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-Sissi,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-Skyscrapers,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,OLD-TreeTent,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,puzzle-editor,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,scroll_speed_fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,shortcuts_issue38_macOS-commands,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,UI-101-issue,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,ui-103-menu-improvements,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,ui-241,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,ui-ctrl-+Y-for-undo,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,UI-Home-panel-preferences-option-does-not-pull-up-preferences-menu,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,UI-problem-for-allow-user-to-use-Ctrl+Shift+Z-or-Ctrl+Y-for-Redo,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,ui-problem-for-the-treeview-zoomfit()-long-term-fix,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,ui-problem-with-the-fix-the-space-in-perference-menu-and-may-fixed-the-apply,Invalid,,Ungradeable
-.git/logs/refs/remotes/upstream,WhiteBottleNeck_fix,Invalid,,Ungradeable
-.git/objects/00,cf7e279cddf819ef194d7d126638e297d63041,Invalid,,Ungradeable
-.git/objects/08,66618ca773aac41fbdcb92a1601855c140d439,Invalid,,Ungradeable
-.git/objects/09,25bb45596ef2399b8bd22e26f29d33a94d8b2d,Invalid,,Ungradeable
-.git/objects/0a,eaba6e2c91e727d4abf15b6fd71f6e25a47784,Invalid,,Ungradeable
-.git/objects/0b,939dc2cdcb1cc373e7cab734022ac660ddecdf,Invalid,,Ungradeable
-.git/objects/0d,150267ac1c3763b0a2a5433b6071a46bb1d8c6,Invalid,,Ungradeable
-.git/objects/0e,88a113d85eac7cc06fc67f38696b89ae36742d,Invalid,,Ungradeable
-.git/objects/0f,4c2848f1a1703d85e1fb2dfa94e27049f6911d,Invalid,,Ungradeable
-.git/objects/10,ca71041db7ecb89e2180a45f781db7ecc30bdc,Invalid,,Ungradeable
-.git/objects/10,e2440dd47553f6e166ecda94963abf8df86847,Invalid,,Ungradeable
-.git/objects/12,233426c664dc7d41ff243cabbf510eeeaad79b,Invalid,,Ungradeable
-.git/objects/14,7869c31dc490d7a3147768f814997f7a6acefb,Invalid,,Ungradeable
-.git/objects/14,a087f15dd1f1a9cf78ef0c58ae2abe5f610448,Invalid,,Ungradeable
-.git/objects/15,10a3124d88b0feae6baa5cc36a325d8934169b,Invalid,,Ungradeable
-.git/objects/16,60734fff83fd845b332fce93291f42cc65c6e0,Invalid,,Ungradeable
-.git/objects/19,0d1f7f6b2d420c2a44690936934e862eb3b630,Invalid,,Ungradeable
-.git/objects/1a,131d10a7ea85921799739ccfec1c2a64e5a667,Invalid,,Ungradeable
-.git/objects/1a,c55713cebdd9e0eaa76946675122c23f4b86a2,Invalid,,Ungradeable
-.git/objects/1a,c5aca0b4de5f917282eb5bfc04cd592eca7a14,Invalid,,Ungradeable
-.git/objects/1b,591feda853c79500da8c558a88489a557feb6d,Invalid,,Ungradeable
-.git/objects/1c,38adf4946b49032c3111ffc7e5fc75e0c82760,Invalid,,Ungradeable
-.git/objects/1f,7d39198c333eedb5da6418e206bc40989f9a24,Invalid,,Ungradeable
-.git/objects/1f,c2b3792803d814875b0067fcdea0f3a318204f,Invalid,,Ungradeable
-.git/objects/21,0dbb597ee5be94b2f683febc455f01528410a9,Invalid,,Ungradeable
-.git/objects/21,f11191156869101c7d51ac8d1f14bd472aae3f,Invalid,,Ungradeable
-.git/objects/22,2b9ba7b3bfdc798fc669e917a6ba4ff31a22c7,Invalid,,Ungradeable
-.git/objects/24,39bbf554fc894f3be14a8d89d7c97dab45d153,Invalid,,Ungradeable
-.git/objects/27,3075adf0d9a0146388c51c2ee1676793a5d132,Invalid,,Ungradeable
-.git/objects/29,612e65c5400686de256146b76dd08dabb8ba8a,Invalid,,Ungradeable
-.git/objects/29,8c0749b8206856fa2767f12bbaecce62dfbe87,Invalid,,Ungradeable
-.git/objects/2b,f8d39ee9f57f68f874e8342bd2e445bd93e021,Invalid,,Ungradeable
-.git/objects/2d,3ff89d53069598bf3e04cec43127b9ed282352,Invalid,,Ungradeable
-.git/objects/2d,87243525bdd7a86cb2c4b1d76a5fe7994e3f30,Invalid,,Ungradeable
-.git/objects/30,9269e24946f7e013d68ca88fb59ef031fabea3,Invalid,,Ungradeable
-.git/objects/31,0d448e73ce3a3d740e89a7cde91aa8cb389e94,Invalid,,Ungradeable
-.git/objects/33,5cb5a2a067bfde5f8df7892ae033a6223e640c,Invalid,,Ungradeable
-.git/objects/33,768cb1d6985c420d69eb5a1c6639b5285fcf39,Invalid,,Ungradeable
-.git/objects/33,ae5da1ed42709532c0f79de2f8d414f1461e22,Invalid,,Ungradeable
-.git/objects/34,e89800ec3df97dbe13ae36774a404453fb5f22,Invalid,,Ungradeable
-.git/objects/36,b4e48cef8a44f98db486c6bf5c79a16736d5bb,Invalid,,Ungradeable
-.git/objects/38,4a9c3f4b6197ded66f1f3e5b16331d3dd34d9f,Invalid,,Ungradeable
-.git/objects/3b,7da7ca6aec896daa191f5b017f962062dd55e7,Invalid,,Ungradeable
-.git/objects/3b,ea768136a7f64184cf5829b830c4394d16c56b,Invalid,,Ungradeable
-.git/objects/3c,6976b9e84f016cf630dbad7f29f3f49982dd52,Invalid,,Ungradeable
-.git/objects/3e,1e37fe94f700c96e4cf9cadd8ca1454aa4908a,Invalid,,Ungradeable
-.git/objects/3e,be14b65832410407d65333f97c1035cabc356c,Invalid,,Ungradeable
-.git/objects/40,1612c60980a4ee5c8c6c96e9e89818f1b386a8,Invalid,,Ungradeable
-.git/objects/41,b1bad955c284b719b476bfbdf411b6ef5fd614,Invalid,,Ungradeable
-.git/objects/41,e01e22112b01f0167927f8278f4b52c5503617,Invalid,,Ungradeable
-.git/objects/42,598f127bf1296f5f88b5d0d8b23a926f887bf7,Invalid,,Ungradeable
-.git/objects/45,da4035a3e60ee3feee3d913227f9d1b5d8b3c0,Invalid,,Ungradeable
-.git/objects/46,1405c6b1d53ce0ce0239bcdf69c7a508fd23a4,Invalid,,Ungradeable
-.git/objects/47,d567092e1cec1a6854deb1427b9ef42cfbc516,Invalid,,Ungradeable
-.git/objects/4a,0399974295ed36fc6f15dac252660a344f56cc,Invalid,,Ungradeable
-.git/objects/4a,0d0c0779097286d1109d33b4eb1549a4ca6403,Invalid,,Ungradeable
-.git/objects/4b,46e56c2cdbce1f852f86509208f381ea891172,Invalid,,Ungradeable
-.git/objects/4d,be37edde3a98fe8d6cd284e2f47243d43d0ad4,Invalid,,Ungradeable
-.git/objects/52,4d9ff291f476a8db51e33f4b8fcb3c8ef3318e,Invalid,,Ungradeable
-.git/objects/53,608604e91953324bc35394e190d518fd322d0e,Invalid,,Ungradeable
-.git/objects/54,0b43da46233aea3f5deb6a3ab4f3e1f3cc784c,Invalid,,Ungradeable
-.git/objects/58,b71dc60f5eb5eaaf7c80a707d8ab3200115075,Invalid,,Ungradeable
-.git/objects/59,cab4b2b3565d3aa68014d3e69a66ec53a99d26,Invalid,,Ungradeable
-.git/objects/5a,8788cb68e39716147357ed093a0f25b42b9a01,Invalid,,Ungradeable
-.git/objects/5c,9427cf0ff06e62deb41d6a813999203462e165,Invalid,,Ungradeable
-.git/objects/5c,c1b6749ab934c0c1c364cbe802a9efaf5e7e9d,Invalid,,Ungradeable
-.git/objects/5d,3d6c813c8ec191891b2a6e05aaaffc7ce5ab7e,Invalid,,Ungradeable
-.git/objects/60,2c130dbf0ac8ed93eedcf6bc3ad3d803ca1b69,Invalid,,Ungradeable
-.git/objects/61,067ee543b15a41e7d3248a22a345c57cae26d0,Invalid,,Ungradeable
-.git/objects/63,7ff4fb23f0c073c53bb469700bdf84259567f8,Invalid,,Ungradeable
-.git/objects/66,143f8a92211d2408f0accf19e7cb4b69884cca,Invalid,,Ungradeable
-.git/objects/66,417b1504bbbf797579719b5634d3f23cfc0780,Invalid,,Ungradeable
-.git/objects/66,fdac6367f6fa3a80b274e41752caa3df01e625,Invalid,,Ungradeable
-.git/objects/67,894f368b262b4d3bc3ad37a239de116b41665a,Invalid,,Ungradeable
-.git/objects/68,8d1d70cb41a18d9f3677247d27309b5421a957,Invalid,,Ungradeable
-.git/objects/68,ae4990d129e570eb6dc04d0ec582bb7044aa88,Invalid,,Ungradeable
-.git/objects/68,f1852a0e704b84d7044c7f4f1c1083df65bab9,Invalid,,Ungradeable
-.git/objects/69,192f6e917ead33a9c20d36110ac666ed28e03c,Invalid,,Ungradeable
-.git/objects/69,59725754fa852861e96ffaf966e517fd94b90a,Invalid,,Ungradeable
-.git/objects/69,fb0208ef9dbeee0930d3546f4be3c4e466f17c,Invalid,,Ungradeable
-.git/objects/6a,04e4c6f7e0de0c6494f71205246cc2054e3942,Invalid,,Ungradeable
-.git/objects/6a,e832047a819b11e70af7e7843762bac5ad69e4,Invalid,,Ungradeable
-.git/objects/6b,c3f56cead157a80ebafdf2223b5f95c60a17ff,Invalid,,Ungradeable
-.git/objects/6c,18492cd2e29be652a54cbb8feba7fcf17c978d,Invalid,,Ungradeable
-.git/objects/6c,946318a3ea3c319cc6189778e18689465847e7,Invalid,,Ungradeable
-.git/objects/6d,0f1d49c961a60646cb084c4e398fff697b30dc,Invalid,,Ungradeable
-.git/objects/6e,9a5d9ce473492f3b3abc02be939b85658d7f6a,Invalid,,Ungradeable
-.git/objects/6f,17ed2336e075ef7206869958fbb506c06497a8,Invalid,,Ungradeable
-.git/objects/6f,33e26e6c3111e5b208692225cd9ed9ec000c83,Invalid,,Ungradeable
-.git/objects/6f,f09bd265f038dab229a0bfa68f8df9a09d5e06,Invalid,,Ungradeable
-.git/objects/70,12fa45c5d7270929d74b0473d98789dbff6e99,Invalid,,Ungradeable
-.git/objects/70,1e6b7292b1c647d5a664f68f9b46a60b3477ee,Invalid,,Ungradeable
-.git/objects/71,6fe98a678dcd4dec835f155417dfe3ad2ff33a,Invalid,,Ungradeable
-.git/objects/73,1a3276b0704d8111d523b4b79bacf54e4c6175,Invalid,,Ungradeable
-.git/objects/75,871bc7878318f57e10fc8cc6f070aa7d3167ce,Invalid,,Ungradeable
-.git/objects/77,67bfd0dea2a0dcfb45527d8bfc4678611a77b4,Invalid,,Ungradeable
-.git/objects/79,6c7b66dcefad1a9c0f83c115b66f1641d3b188,Invalid,,Ungradeable
-.git/objects/7a,17b98758ebe54a09fc698789d2cb2f19f9c8fa,Invalid,,Ungradeable
-.git/objects/7a,f155a22207f11082cab61dd1f6b97717d29469,Invalid,,Ungradeable
-.git/objects/7b,3a0fdd839950bfe1d47fa1c63b597437a54bd2,Invalid,,Ungradeable
-.git/objects/7d,0164a198d338ce356f4d2d382abb4adfe116f0,Invalid,,Ungradeable
-.git/objects/7e,44c7fab9e6a8aadf48a0ab75b7ada8fea02489,Invalid,,Ungradeable
-.git/objects/83,66641727aff57d905defd5abb9760d1dfb49bf,Invalid,,Ungradeable
-.git/objects/84,1a9ba9b4e472f507b57c347df08264e41d2a7a,Invalid,,Ungradeable
-.git/objects/84,d1db3fd1a88d32c72af4515cf2bfe68915d8a9,Invalid,,Ungradeable
-.git/objects/86,5e4aaa29d8f9db82f205ee2388f2e3acb683fc,Invalid,,Ungradeable
-.git/objects/88,335c1cbbfa6af78b31d0e27af8681d29109fe8,Invalid,,Ungradeable
-.git/objects/88,932541b920302d954649bdc5e09e3a888de76d,Invalid,,Ungradeable
-.git/objects/88,b1e88cb8751416cee446b9562c67ecad133369,Invalid,,Ungradeable
-.git/objects/89,24525d36ccee97c6a6162141dd49a217a5701a,Invalid,,Ungradeable
-.git/objects/8a,d1899b93a5f7f12735ecb3a3da11cdf62f7a85,Invalid,,Ungradeable
-.git/objects/8b,3aec0081a982644cb7d4ac0c35ac43a4deb5b1,Invalid,,Ungradeable
-.git/objects/8c,c0f8365381317cb441644fe1e3bbfa49843f74,Invalid,,Ungradeable
-.git/objects/8c,f66cb2a58356c1ac3c67cd65d6d44c55f2dc6e,Invalid,,Ungradeable
-.git/objects/8d,6da6680f4545bcd392342b8b65aecc34183640,Invalid,,Ungradeable
-.git/objects/8e,0d9355ec3dc291e118502ac179174f64c097f3,Invalid,,Ungradeable
-.git/objects/8f,36819e56eef89c9c79b22ab671c7951365402a,Invalid,,Ungradeable
-.git/objects/90,5cf203e03e44be6096bbe0d8a3155e848bd184,Invalid,,Ungradeable
-.git/objects/91,a8141ea061bed84ce902a990b9f153b928ee9e,Invalid,,Ungradeable
-.git/objects/92,1d8cc5ef8d96cd3181a823521fa35d71492fda,Invalid,,Ungradeable
-.git/objects/92,e07dd9467b59647e7801e58a797fea301493f2,Invalid,,Ungradeable
-.git/objects/9b,eed2379af1ece7f5e98efa6d08cec3ce6ca063,Invalid,,Ungradeable
-.git/objects/9c,53528f98a782d44da8522776193c402f0ef758,Invalid,,Ungradeable
-.git/objects/9e,117d813f4e3926a18d17b8776869dd9d6b26be,Invalid,,Ungradeable
-.git/objects/9e,7c4a1658927d4d0dfe26363a6ca3a536f5789c,Invalid,,Ungradeable
-.git/objects/9e,ba0712fdb4da99177c5cc2ecb9be5e62e5f839,Invalid,,Ungradeable
-.git/objects/9f,e44a76a214b51fc4ee5628a2653354fec59fc0,Invalid,,Ungradeable
-.git/objects/a0,35f92def281a31ba72752c701780daaa1ab222,Invalid,,Ungradeable
-.git/objects/a1,5029207121c55079310060007cc5c67adfb8b8,Invalid,,Ungradeable
-.git/objects/a1,5324d30aa7edabcf51ef27239f942afc467eb6,Invalid,,Ungradeable
-.git/objects/a4,62363670c0bfb948b2a5565f218229924cb184,Invalid,,Ungradeable
-.git/objects/a5,af3cf4bfe046d52d76916d2d5a34cba2301ccb,Invalid,,Ungradeable
-.git/objects/a5,ba72de46945cc90ef442e7a66fedab34f30eab,Invalid,,Ungradeable
-.git/objects/a5,fc49e6e9b508a3bc0274adc8603bdd7d8e527d,Invalid,,Ungradeable
-.git/objects/a6,912ebfb2c37e586ed77b4bf62e6ad8b9ea23f4,Invalid,,Ungradeable
-.git/objects/a8,b2466f2c2c52b947b3c10ea5b0ce5cc6a6fa48,Invalid,,Ungradeable
-.git/objects/a9,af0e7d1db6ff7eba51702735b9b8035d41a048,Invalid,,Ungradeable
-.git/objects/a9,c0f89ea2ca75e0b50d457922446e8169f5eb1d,Invalid,,Ungradeable
-.git/objects/aa,4fd17c55fb8ca4197d58792eb479cd26164c58,Invalid,,Ungradeable
-.git/objects/ab,b363c6ab0cb5766d0ef3a8b59d9452efcd9659,Invalid,,Ungradeable
-.git/objects/ad,14716c669301db0264a594d5ffac92d6579e25,Invalid,,Ungradeable
-.git/objects/ad,1df2cb9525c15f05c0099899be6d45cb47c251,Invalid,,Ungradeable
-.git/objects/ad,60e4d5a2ceeb5ce6d7723be13fc4016d20287f,Invalid,,Ungradeable
-.git/objects/af,1aeff3c0618f0e09d2c88b66fc98fd74144acf,Invalid,,Ungradeable
-.git/objects/b0,a3549f3f470fbdad95e2da9c8d7daa66906a55,Invalid,,Ungradeable
-.git/objects/b1,206767f87d38645db2bbde383b98f05289d4fa,Invalid,,Ungradeable
-.git/objects/b1,6f7b00f6a9a9cb228ded7d72a2b4b0ccf982ba,Invalid,,Ungradeable
-.git/objects/b2,8708f9c595673f0de56fcad60d496009f86566,Invalid,,Ungradeable
-.git/objects/b6,9217a0bcd28842481a382836ea64aa0f1f61a7,Invalid,,Ungradeable
-.git/objects/b6,f2c5e065ebaa8a433cf5861e308b7c590324e5,Invalid,,Ungradeable
-.git/objects/b8,07575c1505c3b85b41624f602a646110f8ffa4,Invalid,,Ungradeable
-.git/objects/b8,407a6a21bda4ada4bda654a85a290292e3da8f,Invalid,,Ungradeable
-.git/objects/b8,440aa4e197e54f4b8c8bab4fcd2f3c6004059f,Invalid,,Ungradeable
-.git/objects/b8,7b9c478ef80b27d8e6f15c9348bfb37043a8db,Invalid,,Ungradeable
-.git/objects/b8,cd17598e23bb942ac56e8a838c113caff2429d,Invalid,,Ungradeable
-.git/objects/b8,ee5899207087a3a921397f948e977827c366e7,Invalid,,Ungradeable
-.git/objects/bc,39e5d3859c8e04cfb78254b64722c79e97a962,Invalid,,Ungradeable
-.git/objects/bc,7ac2dd3a142ae05e249f944a5374f22fdc0afc,Invalid,,Ungradeable
-.git/objects/bd,34f0c7abd1e7bcc56e7644e497bec76a38d4e8,Invalid,,Ungradeable
-.git/objects/c0,76da03038483c6ce36fb8a8ab5daff59cec4b8,Invalid,,Ungradeable
-.git/objects/c1,c4c12d6293efb2d4eb7ea0a1d8d4ce7143ec62,Invalid,,Ungradeable
-.git/objects/c3,0efbed38998af4a1a438c55b3be931492d7b1a,Invalid,,Ungradeable
-.git/objects/c3,ee3ef26522cd54e482949c552054b6b7252cfd,Invalid,,Ungradeable
-.git/objects/c4,cdf4e6c2ed1424bc990fc971b12121d5f548f6,Invalid,,Ungradeable
-.git/objects/c7,9d51ee3b0e7df621e8c373e388369be6871eea,Invalid,,Ungradeable
-.git/objects/c8,3c95965b0c2a621649f42dbded6a7cb1c29372,Invalid,,Ungradeable
-.git/objects/c8,bdbb6e7fb74ace143e82eb8ec717a27d88b551,Invalid,,Ungradeable
-.git/objects/c9,5a03a69998785650a4341566e918c1fdc323e4,Invalid,,Ungradeable
-.git/objects/c9,b13f3cd6c7b6dd646d923ac69430e91a90253d,Invalid,,Ungradeable
-.git/objects/ca,a8c4b4a477f20ee37a18a0f2c3b979a06d10f2,Invalid,,Ungradeable
-.git/objects/cd,0319ba8219a82cd72f976a506a594ba047a01f,Invalid,,Ungradeable
-.git/objects/cf,3c9fc8d148753f17ecd758aa095693dd5a8bec,Invalid,,Ungradeable
-.git/objects/d1,0cae464bd5ffda4cd9fbb17d26992a50efb452,Invalid,,Ungradeable
-.git/objects/d2,815ff485be93767a5ff8966cf9a4f3eecfe264,Invalid,,Ungradeable
-.git/objects/d6,d1737130f4d8cc3857bdd2b8bae07164ff9b2d,Invalid,,Ungradeable
-.git/objects/d7,1bf1a26f8fe0ff56ae73d1d3d06ef6fc2945a3,Invalid,,Ungradeable
-.git/objects/d7,24f0a6bed5ed1b7fbbdd04312e30ef00027f04,Invalid,,Ungradeable
-.git/objects/db,9d11bfd561b60a9196b5cb8a19c4d3adb5ea7d,Invalid,,Ungradeable
-.git/objects/e0,164f35715f8f7caf904e65aa11ffbfa1abfc3b,Invalid,,Ungradeable
-.git/objects/e3,b27a777fdf260cb2e8d178ea9a06db21015bcc,Invalid,,Ungradeable
-.git/objects/e7,3fbee2e7519f053473abde442275f04edf7d84,Invalid,,Ungradeable
-.git/objects/e7,a15ea50fad8466c68c098dcbfa765fe3841d14,Invalid,,Ungradeable
-.git/objects/ea,d9fd3f7e79249bb401634cfd1f9d1a418ab148,Invalid,,Ungradeable
-.git/objects/eb,aec7b3c3ad5f37e23d387cfa31138772c9b0d0,Invalid,,Ungradeable
-.git/objects/ec,b3cb92ef6277348929b4ba2be070a2ae364edb,Invalid,,Ungradeable
-.git/objects/ec,fc4b655aed8f668085fbc1ce3f8f978b0ecfe6,Invalid,,Ungradeable
-.git/objects/ed,b78a080021f4aadd9282d568d23d12802b99f2,Invalid,,Ungradeable
-.git/objects/ee,82f25640d86fb321b0a317ee530a2c513691c2,Invalid,,Ungradeable
-.git/objects/f0,66edb5775fe184d85f417cb4ed8488f12b721d,Invalid,,Ungradeable
-.git/objects/f1,206c3bd20b41b4f41bd1f0f43e2233a3923ec6,Invalid,,Ungradeable
-.git/objects/f2,0eca725e5e8d36a6cbb2711b80edc6ca885fed,Invalid,,Ungradeable
-.git/objects/f4,834444df2e00d85fb35474a4e35c2e72003ab5,Invalid,,Ungradeable
-.git/objects/f7,2c201c8e0557aa7779c4a1792f661cbc6721d8,Invalid,,Ungradeable
-.git/objects/f9,52428dc2d7adfc8d984b8cc63d2d07559f74fb,Invalid,,Ungradeable
-.git/objects/fa,0bef06d2dfe688c32964165acc723ee0aa34ab,Invalid,,Ungradeable
-.git/objects/fa,6abdfb6fbbc8b5e54fd9b7166a2fc06f664241,Invalid,,Ungradeable
-.git/objects/fb,90e5f87d74454cf8e046e8735117beb2e0adfd,Invalid,,Ungradeable
-.git/objects/fc,4d2e819fc655155c3a2dcd2b4d3bc16204b1fc,Invalid,,Ungradeable
-.git/objects/fc,d6e4830ba83b9db7f843b8ed53db4d3a697913,Invalid,,Ungradeable
-.git/objects/info,Empty folder,,Ungradeable
-.git/objects/pack,pack-009f995d6af98ac798eeb98a4ee12bd26a998ea4.idx,Invalid,,Ungradeable
-.git/objects/pack,pack-009f995d6af98ac798eeb98a4ee12bd26a998ea4.pack,Invalid,,Ungradeable
-.git/objects/pack,pack-05886b7bef340facfa490555066461f921e4359b.idx,Invalid,,Ungradeable
-.git/objects/pack,pack-05886b7bef340facfa490555066461f921e4359b.pack,Invalid,,Ungradeable
-.git/objects/pack,pack-a924c88f28f1e8b5930055045f30a0ec82af7ac9.idx,Invalid,,Ungradeable
-.git/objects/pack,pack-a924c88f28f1e8b5930055045f30a0ec82af7ac9.pack,Invalid,,Ungradeable
-.git/objects/pack,pack-be00461c220b975034089981f7e091506d4a4364.idx,Invalid,,Ungradeable
-.git/objects/pack,pack-be00461c220b975034089981f7e091506d4a4364.pack,Invalid,,Ungradeable
-.git/objects/pack,pack-d381bf4411917cff72908e70ad226373173c7662.idx,Invalid,,Ungradeable
-.git/objects/pack,pack-d381bf4411917cff72908e70ad226373173c7662.pack,Invalid,,Ungradeable
-.git/objects/pack,pack-e04d66c411ff1c4114aa7531b6c4e40e394ab70f.idx,Invalid,,Ungradeable
-.git/objects/pack,pack-e04d66c411ff1c4114aa7531b6c4e40e394ab70f.pack,Invalid,,Ungradeable
-.git,packed-refs,Invalid,,Ungradeable
-.git/refs/heads,batch-grader,Invalid,,Ungradeable
-.git/refs/heads,dev,Invalid,,Ungradeable
-.git/refs/heads,dev-my-self,Invalid,,Ungradeable
-.git/refs/heads,master,Invalid,,Ungradeable
-.git/refs/heads,OLD-Kevin,Invalid,,Ungradeable
-.git/refs/heads/pr,315,Invalid,,Ungradeable
-.git/refs/heads/pr,318,Invalid,,Ungradeable
-.git/refs/heads/pr,321,Invalid,,Ungradeable
-.git/refs/heads,test,Invalid,,Ungradeable
-.git/refs/heads,ui-problem-309,Invalid,,Ungradeable
-.git/refs/heads,ui-problem-for-saving-function,Invalid,,Ungradeable
-.git/refs/heads,ui-saving-function,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,222-bug-selecting-a-rule-overlaps-other-rule-tabs,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,264-enhancement-allow-user-to-use-ctrl+shift+z-or-ctrl+y-for-redo,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,apply-button-grey-out-fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,cannotreachpathing,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,dev,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,fix_no_number_contradiction,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,general_algorithm,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,HEAD,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,issue138-stt-save-bugs,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,master,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,mustlightfix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,native-binary-windows,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,new_puzzle-skyscrapers,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-Jacob,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-JavaFxPort,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-Kevin,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-main,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-ManualPuzzleCreation,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-Mariano,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-PuzzleGenerator,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-RippleEffect,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-Sissi,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-Skyscrapers,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,OLD-TreeTent,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,puzzle-editor,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,scroll_speed_fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,shortcuts_issue38_macOS-commands,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,UI-101-issue,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,ui-103-menu-improvements,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,ui-241,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,ui-ctrl-+Y-for-undo,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,UI-Home-panel-preferences-option-does-not-pull-up-preferences-menu,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,UI-problem-for-allow-user-to-use-Ctrl+Shift+Z-or-Ctrl+Y-for-Redo,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,ui-problem-for-the-treeview-zoomfit()-long-term-fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,ui-problem-with-the-fix-the-space-in-perference-menu-and-may-fixed-the-apply,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-19690ao,WhiteBottleNeck_fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-BoZhiDeng,dev,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-BoZhiDeng,HEAD,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-BoZhiDeng,master,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-BoZhiDeng,patch-1,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-BoZhiDeng,patch-2,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,222-bug-selecting-a-rule-overlaps-other-rule-tabs,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,264-enhancement-allow-user-to-use-ctrl+shift+z-or-ctrl+y-for-redo,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,apply-button-grey-out-fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,dev,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,fix_no_number_contradiction,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,general_algorithm,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,HEAD,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,issue138-stt-save-bugs,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,master,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,native-binary-windows,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,new_puzzle-skyscrapers,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-Jacob,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-JavaFxPort,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-Kevin,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-main,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-ManualPuzzleCreation,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-Mariano,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-PuzzleGenerator,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-RippleEffect,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-Sissi,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-Skyscrapers,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,OLD-TreeTent,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,puzzle-editor,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,scroll_speed_fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,shortcuts_issue38_macOS-commands,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,UI-101-issue,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,ui-103-menu-improvements,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,ui-241,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,ui-ctrl-+Y-for-undo,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,UI-Home-panel-preferences-option-does-not-pull-up-preferences-menu,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,UI-problem-for-allow-user-to-use-Ctrl+Shift+Z-or-Ctrl+Y-for-Redo,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,ui-problem-for-the-treeview-zoomfit()-long-term-fix,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,ui-problem-with-the-fix-the-space-in-perference-menu-and-may-fixed-the-apply,Invalid,,Ungradeable
-.git/refs/remotes/github-desktop-Tripplenut,WhiteBottleNeck_fix,Invalid,,Ungradeable
-.git/refs/remotes/origin,batch-grader,Invalid,,Ungradeable
-.git/refs/remotes/origin,dev,Invalid,,Ungradeable
-.git/refs/remotes/origin,HEAD,Invalid,,Ungradeable
-.git/refs/remotes/origin,master,Invalid,,Ungradeable
-.git/refs/remotes/origin,ui-problem-309,Invalid,,Ungradeable
-.git/refs/remotes/origin,ui-problem-for-saving-function,Invalid,,Ungradeable
-.git/refs/remotes/origin,ui-saving-function,Invalid,,Ungradeable
-.git/refs/remotes/upstream,222-bug-selecting-a-rule-overlaps-other-rule-tabs,Invalid,,Ungradeable
-.git/refs/remotes/upstream,264-enhancement-allow-user-to-use-ctrl+shift+z-or-ctrl+y-for-redo,Invalid,,Ungradeable
-.git/refs/remotes/upstream,apply-button-grey-out-fix,Invalid,,Ungradeable
-.git/refs/remotes/upstream,dev,Invalid,,Ungradeable
-.git/refs/remotes/upstream,fix_no_number_contradiction,Invalid,,Ungradeable
-.git/refs/remotes/upstream,general_algorithm,Invalid,,Ungradeable
-.git/refs/remotes/upstream,HEAD,Invalid,,Ungradeable
-.git/refs/remotes/upstream,issue138-stt-save-bugs,Invalid,,Ungradeable
-.git/refs/remotes/upstream,master,Invalid,,Ungradeable
-.git/refs/remotes/upstream,native-binary-windows,Invalid,,Ungradeable
-.git/refs/remotes/upstream,new_puzzle-skyscrapers,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-Jacob,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-JavaFxPort,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-Kevin,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-main,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-ManualPuzzleCreation,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-Mariano,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-PuzzleGenerator,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-RippleEffect,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-Sissi,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-Skyscrapers,Invalid,,Ungradeable
-.git/refs/remotes/upstream,OLD-TreeTent,Invalid,,Ungradeable
-.git/refs/remotes/upstream,puzzle-editor,Invalid,,Ungradeable
-.git/refs/remotes/upstream,scroll_speed_fix,Invalid,,Ungradeable
-.git/refs/remotes/upstream,shortcuts_issue38_macOS-commands,Invalid,,Ungradeable
-.git/refs/remotes/upstream,UI-101-issue,Invalid,,Ungradeable
-.git/refs/remotes/upstream,ui-103-menu-improvements,Invalid,,Ungradeable
-.git/refs/remotes/upstream,ui-241,Invalid,,Ungradeable
-.git/refs/remotes/upstream,ui-ctrl-+Y-for-undo,Invalid,,Ungradeable
-.git/refs/remotes/upstream,UI-Home-panel-preferences-option-does-not-pull-up-preferences-menu,Invalid,,Ungradeable
-.git/refs/remotes/upstream,UI-problem-for-allow-user-to-use-Ctrl+Shift+Z-or-Ctrl+Y-for-Redo,Invalid,,Ungradeable
-.git/refs/remotes/upstream,ui-problem-for-the-treeview-zoomfit()-long-term-fix,Invalid,,Ungradeable
-.git/refs/remotes/upstream,ui-problem-with-the-fix-the-space-in-perference-menu-and-may-fixed-the-apply,Invalid,,Ungradeable
-.git/refs/remotes/upstream,WhiteBottleNeck_fix,Invalid,,Ungradeable
-.git/refs/tags,1.9.0,Invalid,,Ungradeable
-.git/refs/tags,1.9.1,Invalid,,Ungradeable
-.git/refs/tags,2.0,Invalid,,Ungradeable
-.git/refs/tags,2.1,Invalid,,Ungradeable
-.git/refs/tags,3.0.0,Invalid,,Ungradeable
-.git/refs/tags,3.0.0-beta,Invalid,,Ungradeable
-.git/refs/tags,3.0.1-beta,Invalid,,Ungradeable
-.git/refs/tags,v2.1.1,Invalid,,Ungradeable
-.git/refs/tags,v3.0.0,Invalid,,Ungradeable
-.git/refs/tags,v3.0.0-beta,Invalid,,Ungradeable
-.git/refs/tags,v3.0.2-beta,Invalid,,Ungradeable
-.git/refs/tags,v4.0.0,Invalid,,Ungradeable
-.git/refs/tags,v4.0.0-beta,Invalid,,Ungradeable
-.github/ISSUE_TEMPLATE,bug_report.yml,Invalid,,Ungradeable
-.github/ISSUE_TEMPLATE,enhancement_request.yml,Invalid,,Ungradeable
-.github/ISSUE_TEMPLATE,feature_request.yml,Invalid,,Ungradeable
-.github,pull_request_template.md,Invalid,,Ungradeable
-.github/workflows,gradle.yml,Invalid,,Ungradeable
-.gradle/5.0/fileChanges,last-build.bin,Invalid,,Ungradeable
-.gradle/5.0/fileContent,fileContent.lock,Invalid,,Ungradeable
-.gradle/5.0/fileHashes,fileHashes.bin,Invalid,,Ungradeable
-.gradle/5.0/fileHashes,fileHashes.lock,Invalid,,Ungradeable
-.gradle/5.0/fileHashes,resourceHashesCache.bin,Invalid,,Ungradeable
-.gradle/5.0,gc.properties,Invalid,,Ungradeable
-.gradle/5.0/javaCompile,classAnalysis.bin,Invalid,,Ungradeable
-.gradle/5.0/javaCompile,jarAnalysis.bin,Invalid,,Ungradeable
-.gradle/5.0/javaCompile,javaCompile.lock,Invalid,,Ungradeable
-.gradle/5.0/javaCompile,taskHistory.bin,Invalid,,Ungradeable
-.gradle/5.0/taskHistory,taskHistory.bin,Invalid,,Ungradeable
-.gradle/5.0/taskHistory,taskHistory.lock,Invalid,,Ungradeable
-.gradle/5.0/vcsMetadata-1,Empty folder,,Ungradeable
-.gradle/buildOutputCleanup,buildOutputCleanup.lock,Invalid,,Ungradeable
-.gradle/buildOutputCleanup,cache.properties,Invalid,,Ungradeable
-.gradle/buildOutputCleanup,outputFiles.bin,Invalid,,Ungradeable
-.gradle/vcs-1,gc.properties,Invalid,,Ungradeable
-.idea,.name,Invalid,,Ungradeable
-.idea/codeStyles,codeStyleConfig.xml,Invalid,,Ungradeable
-.idea/codeStyles,Project.xml,Invalid,,Ungradeable
-.idea,compiler.xml,Invalid,,Ungradeable
-.idea,gradle.xml,Invalid,,Ungradeable
-.idea,jarRepositories.xml,Invalid,,Ungradeable
-.idea,misc.xml,Invalid,,Ungradeable
-.idea,vcs.xml,Invalid,,Ungradeable
-.idea,workspace.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/.metadata/.plugins/org.eclipse.jdt.ui,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/.metadata/.plugins/org.eclipse.m2e.logback.configuration,logback.1.6.0.20150526-2032.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/.metadata/.plugins/org.eclipse.ui.ide,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/.metadata/.plugins/org.eclipse.ui.intro,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/.metadata/.plugins/org.eclipse.ui.workbench,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/.metadata/.plugins/org.eclipse.ui.workbench,workingsets.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/.metadata/.plugins/org.eclipse.jdt.ui,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/.metadata/.plugins/org.eclipse.m2e.logback.configuration,logback.1.6.0.20150526-2032.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/.metadata/.plugins/org.eclipse.ui.ide,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/.metadata/.plugins/org.eclipse.ui.workbench,dialog_settings.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/.metadata/.plugins/org.eclipse.ui.workbench,workingsets.xml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/images/nurikabe/tiles,BlackTile.png,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/images/nurikabe/tiles,NumberTile.png,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/images/nurikabe/tiles,UnknownTile.png,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/images/nurikabe/tiles,WhiteTile.png,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/legup,config,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/legup,main_window.fxml,Invalid,,Ungradeable
-bin/main/edu/rpi/legup,log4j2.properties,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/puzzle/skyscrapers/rules,TODO.md,Invalid,,Ungradeable
-bin/main/edu/rpi/legup/puzzle/skyscrapers,TODO.md,Invalid,,Ungradeable
-bin/main,log4j2.xml,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ai,Solver.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/app,Config.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/app,GameBoardFacade.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/app,InvalidConfigException.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/app,LegupPreferences.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/app,PuzzleKeyAccelerator.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,BoardController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,Controller.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,CursorController$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,CursorController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,EditorElementController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,ElementController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,RuleController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,ToolbarController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/controller,TreeController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,AddTreeElementCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ApplyDefaultDirectRuleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,AutoCaseRuleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,CommandError.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,CommandState.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,DeleteTreeElementCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,EditDataCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,History.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ICommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,IHistoryListener.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,IHistorySubject.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,InvalidCommandStateTransition.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,MergeCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,PuzzleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ValidateDirectRuleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ValidateCaseRuleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/history,ValidateContradictionRuleCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup,Legup.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/elements,Element.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/elements,ElementType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/elements,NonPlaceableElement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/elements,PlaceableElement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/elements,RegisterElement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/gameboard,Board.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/gameboard,CaseBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/gameboard,ElementFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/gameboard,GridBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/gameboard,GridCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/gameboard,PuzzleElement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/observer,IBoardListener.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/observer,IBoardSubject.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/observer,ITreeListener.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/observer,ITreeSubject.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model,Puzzle$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model,Puzzle.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model,PuzzleExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model,PuzzleImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model,RegisterPuzzle.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,DirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,CaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,ContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,MergeRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,RegisterRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,Rule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/rules,RuleType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/tree,Tree.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/tree,TreeElement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/tree,TreeElementType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/tree,TreeNode.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/model/tree,TreeTransition.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,Battleship.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipCellController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipClue.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipClueView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipClueView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipElementView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship,BattleshipView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,AdjacentShipsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ContinueShipDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,FinishWithShipsDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,FinishWithWaterDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,IncompleteShipContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SegmentTypeDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SegmentTypeCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ShipLocationCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,ShipOrWaterCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,SurroundShipDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooFewInFleetContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooFewRowColContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooManyInFleetContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/battleship/rules,TooManyRowColContradiction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,Fillapix.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixCellController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixCellType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixElementView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixUtilities.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix,FillapixView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,BlackOrWhiteCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,FinishWithBlackDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,FinishWithWhiteDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,TooFewBlackCellsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/fillapix/rules,TooManyBlackCellsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,Heyawake.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake,HeyawakeView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,AdjacentBlacksContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BlackOrWhiteCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BlackPathDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,BottleNeckDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,FillRoomBlackDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,FillRoomWhiteDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,OneRowDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,PreventWhiteLineDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,RoomTooEmptyContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,RoomTooFullContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ThreeByThreeDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,TwoInCornerDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteAreaContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteAroundBlackDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteEscapeDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,WhiteLineContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ZigZagCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/heyawake/rules,ZigZagWhiteDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/elements,BlackTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/elements,BulbTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/elements,NumberTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUp.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpCellController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpCellType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup,LightUpView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,BulbsInPathContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,BulbsOutsideDiagonalDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,CannotLightACellContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,EmptyCellinLightDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,EmptyCornersDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,FinishWithBulbsDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,FinishWithEmptyDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,LightOrEmptyCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,MustLightDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,SatisfyNumberCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,TooFewBulbsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/lightup/rules,TooManyBulbsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,EditLineCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,Masyu.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuLine.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuLineView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu,MasyuView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BadLoopingContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackEdgeDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlackSplitCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,BlockedBlackDirectRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,ConnectedCellsBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,FinishPathBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,NearWhiteBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,NoOptionsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,NormalSplitCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,OnlyOneChoiceBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,OnlyTwoContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,WhiteContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,WhiteEdgeBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/masyu/rules,WhiteSplitCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/elements,BlackTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/elements,NumberTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/elements,UnknownTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/elements,WhiteTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,Nurikabe.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeUtilities.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe,NurikabeView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,BlackBetweenRegionsBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,BlackBottleNeckBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,BlackOrWhiteCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,BlackSquareContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,CannotReachCellBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,CornerBlackBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,FillinBlackBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,FillinWhiteBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,IsolateBlackContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,MultipleNumbersContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,NoNumberContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,PreventBlackSquareBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,SurroundRegionBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,TooFewSpacesContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,TooManySpacesContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,UnreachableWhiteCellContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/nurikabe/rules,WhiteBottleNeckBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle,PuzzleElementTypes.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic,BasicRuleAtomic.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic,BasicRule_Generic.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination,BasicRuleAndElimination.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination,BasicRuleBiconditionalElimination.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination,BasicRuleConditionalElimination.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination,BasicRuleNotElimination.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination,BasicRuleOrElimination.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/elimination,BasicRule_GenericElimination.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction,BasicRuleAndIntroduction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction,BasicRuleBiconditionalIntroduction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction,BasicRuleConditionalIntroduction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction,BasicRuleNotIntroduction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction,BasicRuleOrIntroduction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/basic/introduction,BasicRule_GenericIntroduction.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRuleAnd.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRuleAtomic.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRuleBiconditional.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRuleConditional.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRuleOr.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRule_Generic.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/caserule,CaseRule_GenericStatement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRuleAnd.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRuleAtomic.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRuleBiconditional.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRuleConditional.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRuleNot.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRuleOr.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction,ContradictionRule_GenericStatement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTable.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableCell$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableCellType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableElementView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableOperation.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableStatement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/shorttruthtable,ShortTruthTableView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,ClueCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,DuplicateNumberContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,ExceedingVisibilityContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,FixedMaxBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,InsufficientVisibilityContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,LastCellBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,LastNumberBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,NEdgeBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,OneEdgeBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,PossibleContentsCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers/rules,UnresolvedCellContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,Skyscrapers.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersClue.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersClueView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersClueView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersLine.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersLineView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/skyscrapers,SkyscrapersView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/elements,NumberTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,GroupType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,PossibleNumberCaseBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,AdvancedDeductionBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,LastCellForNumberBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,LastNumberForCellBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,NoSolutionContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,PossibleCellCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,PossibleNumberCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku/rules,RepeatedNumberContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,Sudoku.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuCellController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/sudoku,SudokuView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,ClueCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,EditLineCommand.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/elements,GrassTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/elements,TentTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/elements,TreeTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/elements,UnknownTile.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,EmptyFieldBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,FillinRowCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,FinishWithGrassBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,FinishWithTentsBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,LastCampingSpotBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,LinkTentCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,LinkTreeCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,NoTentForTreeContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,NoTreeForTentContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,SurroundTentWithGrassBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,TentForTreeBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,TentOrGrassCaseRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,TooFewTentsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,TooManyTentsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,TouchingTentsContradictionRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent/rules,TreeForTentBasicRule.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTent.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentCell.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentCellFactory.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentClue.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentClueView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentClueView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentController.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentExporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentImporter.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentLine.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentLineView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/puzzle/treetent,TreeTentView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/save,ExportFileException.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/save,InvalidFileFormatException.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/save,SavableBoard.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/save,SavableProof.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,BoardView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,DataSelectionView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,ElementSelection.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,ElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,GridBoardView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,GridElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/boardview,SelectionItemView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,CreatePuzzleDialog$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,CreatePuzzleDialog$2.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,CreatePuzzleDialog.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,DynamicView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,DynamicView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,DynamicViewType.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel$2.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel$3.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel$4.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel$5.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel$6.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,HomePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,LegupPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,LegupUI$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,LegupUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/animation,MaterialUIMovement.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/animation,MaterialUITimer.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialButtonUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialCheckBoxMenuItemUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialCheckBoxUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialComboBoxRenderer.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialComboBoxUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialEditorPaneUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialFileChooserUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialLabelUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialMenuBarUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialMenuItemUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialMenuUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPanelUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPasswordFieldUI$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPasswordFieldUI$2.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPasswordFieldUI$3.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPasswordFieldUI$4.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPasswordFieldUI$MaterialPasswordView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPasswordFieldUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialPopupMenuUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialProgressBarUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialRadioButtonMenuItemUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialRadioButtonUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialScrollBarUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialSeparatorUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialSliderUI$Line.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialSliderUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialSpinnerUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialSplitPaneDivider.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialSplitPaneUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTabbedPaneUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTableCellEditor.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTableCellRenderer.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTableHeaderCellRenderer.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTableHeaderUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTableUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextFieldUI$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextFieldUI$2.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextFieldUI$3.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextFieldUI$4.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextFieldUI$5.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextFieldUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTextPaneUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialToggleButtonUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialToolBarUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialToolTipUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTreeCellEditor$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTreeCellEditor.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTreeCellRenderer.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/components,MaterialTreeUI.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel,LegupLookAndFeel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,DropShadowBorder$Position.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,DropShadowBorder.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,MaterialBorders.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,MaterialColors.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,MaterialDrawingUtils.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,MaterialFonts.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/lookandfeel/materialdesign,MaterialImages.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ManualPuzzleCreatorDialog.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,PickGameDialog.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,PreferencesDialog$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,PreferencesDialog$2.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,PreferencesDialog.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ProofEditorPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,BasicRulePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,CaseRulePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,CaseRuleSelectionView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,ContradictionRulePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,RuleButton.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,RuleFrame$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,RuleFrame.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/rulesview,RulePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeElementView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeNodeView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeToolBarButton.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeToolBarName.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeToolbarPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeTransitionView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeView$1$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/proofeditorui/treeview,TreeViewSelection.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,PuzzleEditorPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/puzzleeditorui/elementsview,ElementButton.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/puzzleeditorui/elementsview,ElementFrame.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/puzzleeditorui/elementsview,ElementPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/puzzleeditorui/elementsview,NonPlaceableElementPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/puzzleeditorui/elementsview,PlaceableElementPanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui/puzzleeditorui/resizeview,ResizePanel.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ScrollView$1$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ScrollView$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ScrollView.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ToolbarName.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,WrapLayout.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ZoomablePane.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ZoomWidget$1.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ZoomWidget$PopupSlider.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/ui,ZoomWidget.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/user,Submission.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/user,UsageStatistics.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/user,User.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/utility,ConnectedRegions.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/utility,DisjointSets.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/utility,Entry.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/utility,LegupUtils.class,Invalid,,Ungradeable
-build/classes/java/main/edu/rpi/legup/utility,Logger.class,Invalid,,Ungradeable
-build/libs,Legup.jar,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,LICENSE.txt,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Black.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-BlackItalic.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Bold.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-BoldItalic.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Italic.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Light.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-LightItalic.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Medium.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-MediumItalic.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Regular.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-Thin.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/fonts/Roboto,Roboto-ThinItalic.ttf,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,BottomCap.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/cases,SegmentType.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/cases,ShipLocations.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/cases,ShipOrWater.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,AdjacentShips.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,IncompleteShip.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,MalformedShip.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,too_few_in_fleet.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,too_few_segments.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,too_many_in_fleet.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/contradictions,too_many_segments.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,labelforce.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,LeftCap.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,Middle.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[0].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[10].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[11].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[12].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[13].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[14].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[15].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[1].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,image[2].gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,screenshot.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,SegmentType.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/old,ShipOrWater.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,RightCap.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/rules,ContinueShip.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/rules,finishShip.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/rules,finishWater.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/rules,SegmentChoice.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship/rules,SurroundShip.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,submarine.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,too_many_in_fleet.psd,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,TopCap.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,UnknownSegment.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/battleship,water.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/fillapix/cases,BlackOrWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/fillapix/contradictions,TooFewBlackCells.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/fillapix/contradictions,TooManyBlackCells.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/fillapix/rules,FinishWithBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/fillapix/rules,FinishWithWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/fillapix,rulesharedcells.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/cases,BlackOrWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/contradictions,adjacentBlacks.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/contradictions,RoomTooEmpty.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/contradictions,RoomTooFull.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/contradictions,WhiteArea.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/contradictions,WhiteLine.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake,finishRoom.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,-1.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,0.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,1.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,10.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,11.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,12.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,13.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,14.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,15.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,2.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,3.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,4.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,5.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,6.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,7.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,8.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions,9.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,-1.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,0.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,1.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,10.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,11.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,12.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,13.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,14.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,15.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,2.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,3.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,4.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,5.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,6.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,7.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,8.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/regions/selected,9.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/rules,FillRoomBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/rules,FillRoomWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/heyawake/rules,WhiteAroundBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,AddChild.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,AddRegion.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Annotations.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,bar.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Basic Rules.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Best Fit.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,blank.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Case Rules.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Check All.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Check.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Collapse.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Console.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Contradictions.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,defaultContradiction.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,defaultRule.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,DelChild.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Directions.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Hint.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup/homepanel,new_puzzle_file.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup/homepanel,new_puzzle_file.tif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup/homepanel,proof_file.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup/homepanel,puzzle_file.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,LegupSplash.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Merge.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,MergeRule.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,New.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Normal Zoom.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Open Proof.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Open Puzzle.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Open.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,questionmark.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Redo.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Save.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Submit.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Undo.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,unknown.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Zoom In.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/Legup,Zoom Out.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,0.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,1.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,2.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,3.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,4.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,black.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/cases,LightOrEmpty.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/cases/Old,SatisfyNumber.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/cases/Old,SatisfyNumber2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/cases,SatisfyNumber.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions,BulbsInPath.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions,CannotLightACell.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions/Old,BulbsInPath.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions/Old,NoLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions/Old,TooFewBulbs.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions/Old,TooFewBulbs2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions/Old,TooManyBulbs.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions/Old,TooManyBulbs2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions,TooFewBulbs.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/contradictions,TooManyBulbs.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,empty.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,light.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup,light.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,AddLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,BulbsOutsideDiagonal.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,EmptyCellInLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,EmptyCorners.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,FinishWithBulbs.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,FinishWithEmpty.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules,MustLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,AddLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,MustLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,SurroundBulbs.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,SurroundBulbs2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,SurroundWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,SurroundWhite2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,WhiteCorners.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/lightup/rules/Old,WhiteInLight.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,CaseBlackSplit.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,CaseNormalSplit.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,CaseWhiteSplit.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,ContradictionBadLooping.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,ContradictionBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,ContradictionNoOptions.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,ContradictionOnly2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,ContradictionWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleBlackEdge.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleBlockedBlack.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleConnectedCells.gif,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleFinishPath.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleNearWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleOnlyOneChoice.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/masyu,RuleWhiteEdge.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/cases,BlackOrWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,BlackArea.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,BlackSquare.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,CantReach.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,MultipleNumbers.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,NoNumber.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,TooFewSpaces.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/contradictions,TooManySpaces.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe,nurikabe_icon_template.psd,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,BetweenRegions.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,CornerBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,FillInBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,FillInWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,NoBlackSquare.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,OneUnknownBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,OneUnknownRegion.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,OneUnknownWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,RuleWhite.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,SurroundBlack.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/rules,Unreachable.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/tiles,BlackTile.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/tiles,NumberTile.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/tiles,UnknownTile.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/nurikabe/tiles,WhiteTile.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic,Atomic.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/elimination,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/elimination,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/elimination,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/elimination,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/elimination,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/introduction,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/introduction,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/introduction,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/introduction,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/basic/introduction,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/case,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/case,Atomic.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/case,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/case,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/case,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/case,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction,Atomic.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic,Atomic.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/elimination,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/elimination,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/elimination,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/elimination,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/elimination,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/introduction,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/introduction,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/introduction,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/introduction,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/basic/introduction,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/contradiction,And.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/contradiction,Atomic.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/contradiction,Biconditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/contradiction,Conditional.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/contradiction,Not.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/shorttruthtable/ruleimages_old/contradiction,Or.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/skyscraper,DuplicateNumber.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/skyscraper,LastNumber.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/skyscraper,PossibleContents.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,AdvancedDeduction.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,forcedByDeduction.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,forcedByElimination.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,NoSolution.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,PossibleValues.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,possible_cells_number.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,RepeatedNumber.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/sudoku,tem.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/classic,cont_bad.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/classic,cont_good.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/classic,leads_to_cont.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/classic,leads_to_soln.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/classic,rule_bad.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/classic,soln.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/smiley,cont_bad.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/smiley,cont_good.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/smiley,leads_to_cont.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/smiley,leads_to_soln.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/smiley,prototype.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/tree/smiley,soln.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,annotate_grass.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,annotate_tent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,aroundTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,caseLinkTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,caseLinkTree.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,caseLinkTree_full.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,caseTentOrGrass.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,case_colcount.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,case_rowcount.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,contra_adjacentTents.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,contra_miscount.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,contra_NoTentForTree.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,contra_NoTreeForTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,finishGrass.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,finishTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,grass.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,NewTentLink.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,NewTreeLink.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,noTreesAround.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,aroundTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,aroundTent1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,caseLinkTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,caseLinkTent1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,caseLinkTree.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,caseLinkTree1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,case_colcount.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,case_colcount1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,case_rowcount.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,case_rowcount1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_adjacentTents.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_adjacentTents1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_miscount.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_noNeighbors.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_noNeighbors1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_notree.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_notree2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,contra_NoTreeForTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,finishGrass.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,finishTent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTentLink.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTentLink1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTentLink2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTentLink3.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTreeLink.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTreeLink1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,NewTreeLink2.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,noTreesAround.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,noTreesAround1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,oneTentPosition.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent/old,oneTentPosition1.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,oneTentPosition.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,tent.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,too_few_tents.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,too_many_tents.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,tree.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,UnknownTile.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/images/treetent,update_template_wip.psd,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,add.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,back_arrow.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,computer.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,details.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,down_arrow.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,file.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,floppy_drive.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,folder.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,hard_drive.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,home.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,list.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,new_folder.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,outlined_checked_box.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,painted_checked_box.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,radio_button_off.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,radio_button_on.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,remove.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,right_arrow.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,toggle_off.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,toggle_on.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,unchecked_box.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/imgs,up_arrow.png,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/legup,config,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/legup,main_window.fxml,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/puzzlefiles/battleship,BattleShipTest,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/puzzlefiles/fillapix,FillapixBoard1,Invalid,,Ungradeable
-build/resources/main/edu/rpi/legup/puzzlefiles/lightup,
\ No newline at end of file
From 730f1e3d6484648fd58137e73248f0b38e0aafcc Mon Sep 17 00:00:00 2001
From: charlestian23
Date: Fri, 17 Feb 2023 16:13:28 -0500
Subject: [PATCH 039/148] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 46bdab2e7..f49780528 100644
--- a/README.md
+++ b/README.md
@@ -79,3 +79,5 @@ along with this program. If not, see .
The look and feel of LEGUP uses [FlatLaf](https://github.com/JFormDesigner/FlatLaf), which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
+
+Hello World!
\ No newline at end of file
From 8a9c15ea39f4bedbddc369fd2e9672ce5116ee28 Mon Sep 17 00:00:00 2001
From: charlestian23
Date: Fri, 17 Feb 2023 16:15:36 -0500
Subject: [PATCH 040/148] Update README.md
---
README.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/README.md b/README.md
index f49780528..4eb8a68de 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,4 @@ along with this program. If not, see .
The look and feel of LEGUP uses [FlatLaf](https://github.com/JFormDesigner/FlatLaf), which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
-Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
-
-Hello World!
\ No newline at end of file
+Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
\ No newline at end of file
From c4d222a19cb0df7aa5136ad24d2fc7830e2fcac8 Mon Sep 17 00:00:00 2001
From: rspacerr <61034617+rspacerr@users.noreply.github.com>
Date: Fri, 17 Feb 2023 16:37:15 -0500
Subject: [PATCH 041/148] added ctrl-y keybind for redo (#455)
* added CTRL-Y keybind
* CTRL-Y keybind improvements
---------
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
.../edu/rpi/legup/ui/ProofEditorPanel.java | 22 ++++++++++++++++---
.../edu/rpi/legup/ui/PuzzleEditorPanel.java | 22 ++++++++++++++++---
2 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 541e44658..bfc5bf3d9 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -127,6 +127,7 @@ public JMenuBar getMenuBar() {
edit = new JMenu("Edit");
undo = new JMenuItem("Undo");
redo = new JMenuItem("Redo");
+
fitBoardToScreen = new JMenuItem("Fit Board to Screen");
fitTreeToScreen = new JMenuItem("Fit Tree to Screen");
@@ -314,13 +315,28 @@ public JMenuBar getMenuBar() {
}
edit.add(redo);
- redo.addActionListener((ActionEvent) ->
- GameBoardFacade.getInstance().getHistory().redo());
+
+ // Created action to support two keybinds (CTRL-SHIFT-Z, CTRL-Y)
+ Action redoAction = new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ GameBoardFacade.getInstance().getHistory().redo();
+ }
+ };
if (os.equals("mac")) {
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(
+ KeyStroke.getKeyStroke('Z', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + InputEvent.SHIFT_DOWN_MASK), "redoAction");
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(
+ KeyStroke.getKeyStroke('Y', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), "redoAction");
redo.setAccelerator(KeyStroke.getKeyStroke('Z', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + InputEvent.SHIFT_DOWN_MASK));
}
else {
- redo.setAccelerator(KeyStroke.getKeyStroke('Z', InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke('Y', InputEvent.CTRL_DOWN_MASK), "redoAction");
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke('Z', InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK), "redoAction");
+ redo.getActionMap().put("redoAction", redoAction);
+
+ // Button in menu will show CTRL-SHIFT-Z as primary keybind
+ redo.setAccelerator(KeyStroke.getKeyStroke('Z', InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK));
}
edit.add(fitBoardToScreen);
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 7d3447bd7..865da013e 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -155,15 +155,31 @@ public void setMenuBar() {
}
menus[1].add(redo);
- redo.addActionListener((ActionEvent) ->
- GameBoardFacade.getInstance().getHistory().redo());
+
+ // Created action to support two keybinds (CTRL-SHIFT-Z, CTRL-Y)
+ Action redoAction = new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ GameBoardFacade.getInstance().getHistory().redo();
+ }
+ };
if (os.equals("mac")) {
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(
+ KeyStroke.getKeyStroke('Z', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + InputEvent.SHIFT_DOWN_MASK), "redoAction");
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(
+ KeyStroke.getKeyStroke('Y', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), "redoAction");
redo.setAccelerator(KeyStroke.getKeyStroke('Z', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + InputEvent.SHIFT_DOWN_MASK));
}
else {
- redo.setAccelerator(KeyStroke.getKeyStroke('Z', InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke('Y', InputEvent.CTRL_DOWN_MASK), "redoAction");
+ redo.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke('Z', InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK), "redoAction");
+ redo.getActionMap().put("redoAction", redoAction);
+
+ // Button in menu will show CTRL-SHIFT-Z as primary keybind
+ redo.setAccelerator(KeyStroke.getKeyStroke('Z', InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK));
}
+
menus[1].add(fitBoardToScreen);
fitBoardToScreen.addActionListener((ActionEvent) -> dynamicBoardView.fitBoardViewToScreen());
From 7f28566127ba4429bb997d74153e3d88085b940a Mon Sep 17 00:00:00 2001
From: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Date: Fri, 17 Feb 2023 16:45:57 -0500
Subject: [PATCH 042/148] Upgrade Gradle to Version 7.5.1 (#456)
* Upgraded Gradle and added JavaDoc action
* Update README.md
* Create gradle.properties
Added to show deprecated Gradle features
* Fixed deprecated Gradle features
* Update build.gradle
---------
Co-authored-by: Ivan Ho <41582274+Corppet@users.noreply.github.com>
---
.github/workflows/publish-javadoc.yml | 21 +++++++++++
README.md | 14 ++++----
build.gradle | 44 +++++++++++++-----------
gradle.properties | 1 +
gradle/wrapper/gradle-wrapper.properties | 2 +-
legup-update/build.gradle | 14 ++++----
6 files changed, 61 insertions(+), 35 deletions(-)
create mode 100644 .github/workflows/publish-javadoc.yml
create mode 100644 gradle.properties
diff --git a/.github/workflows/publish-javadoc.yml b/.github/workflows/publish-javadoc.yml
new file mode 100644
index 000000000..d25271ff8
--- /dev/null
+++ b/.github/workflows/publish-javadoc.yml
@@ -0,0 +1,21 @@
+# modified from https://github.com/MathieuSoysal/Javadoc-publisher.yml
+
+name: Publish Javadoc
+
+on:
+ push:
+ branches:
+ - dev
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Publish JavaDoc
+ uses: MathieuSoysal/Javadoc-publisher.yml@v2.3.0
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ javadoc-branch: javadoc
+ java-version: 8
+ target-folder: docs
+ project: gradle
\ No newline at end of file
diff --git a/README.md b/README.md
index 4eb8a68de..d1352e7e6 100644
--- a/README.md
+++ b/README.md
@@ -23,16 +23,16 @@ LEGUP (**L**ogic **E**ngine for **G**rid-**U**sing **P**uzzles) is a better way
- [License](#license)
## Background
-Dr. van Heuveln has taught logic courses on a frequent basis for the past 15 years, and noted that a good number of students struggle with the systems of modern formal logic that were developed in the late 1800's and early 1900's, and that have been universally used in logic courses since. These traditional systems use abstract linear symbol strings such as `(P & Q) -> (R v S)`, and deploy even more abstract rules such as & Elim to infer new symbol strings from old ones, thus engaging the user in logical reasoning.
+Dr. van Heuveln has taught logic courses on a frequent basis for the past 15 years, and noted that a good number of students struggle with the systems of modern formal logic that were developed in the late 1800's and early 1900's, and that have been universally used in logic courses since. These traditional systems use abstract linear symbol strings such as `(P & Q) -> (R v S)`, and deploy even more abstract rules such as & Elim to infer new symbol strings from old ones, thus engaging the user in logical reasoning.
-This project brings about the idea that there are more pedagogically effective ways for students to learn the basic and important principles of logical reasoning.
+This project brings about the idea that there are more pedagogically effective ways for students to learn the basic and important principles of logical reasoning.
LEGUP uses a more visual representation in a more concrete and engaging environment. These and other features of the LEGUP interface are suspected to have several advantages over more traditional interfaces in terms of learning logic.
## Use Cases
The LEGUP interface allows the user to solve different types of grid-based logical puzzles. Probably the best known example of such a puzzle is the popular Sudoku puzzle, but there are many other types of puzzles that are based on the principle of filling in cells of a square or rectangular grid with different kinds of objects. In all cases, the user is provided certain clues that will force a unique configuration of objects in the grid. These types of puzzles are often advertised as "logic puzzles," and are claimed to train one's logical mind as, using deduction, users should be able to infer which object goes where.
-So, how does the LEGUP interface differ from online platforms for grid-based games? The most important difference is that the LEGUP interface requires the user to explicitly indicate their logical reasoning. Thus, solving the puzzle due to some lucky guesses is no longer an option! The interface will congratulate the user less on the fact that the user was able to solve the puzzle, but more on how the user solved the puzzle. This is essential to logic. Logic is not about the truth or the correct or best answer, but about deductive implication and valid inference. What follows from what, and why?
+So, how does the LEGUP interface differ from online platforms for grid-based games? The most important difference is that the LEGUP interface requires the user to explicitly indicate their logical reasoning. Thus, solving the puzzle due to some lucky guesses is no longer an option! The interface will congratulate the user less on the fact that the user was able to solve the puzzle, but more on how the user solved the puzzle. This is essential to logic. Logic is not about the truth or the correct or best answer, but about deductive implication and valid inference. What follows from what, and why?
LEGUP also provides a single interface that is capable of supporting many different types of puzzles. Since most of the interface remains the same, however, users wil start to recognize certain similarities between the different puzzles. In particular, since they have to explicitly state their reasoning, users should start to see strong similarities in their logical reasoning patterns from puzzle to puzzle, is the very basis of the abstract logical reasoning principles taught in traditional logic courses. However, rather than being "thrown in the water" with abstract principles based on obscure symbols, users instead are dealing with a concrete, fun, and engaging logic puzzle. As such, LEGUP aims to give its users a "leg up" when it comes to the understanding of logic.
@@ -42,10 +42,12 @@ If you are an educator interested in using LEGUP, go to the [releases page](http
## For Students
If you are a student interested in learning the basics of logic, LEGUP is a great way for you to get started. If your instructor is using LEGUP in the classroom and you are looking for extra practice, you can reference the sample puzzle files can be found in the [puzzle files folder](https://github.com/Bram-Hub/Legup/tree/master/puzzles%20files) to get more practice.
-Additionally, if you are interested in computer science and programming, please consider contributing to LEGUP! Not only would it a great way to practice logical reasoning, but it is also a great way to dip your toes into open source software and contributing to open source projects.
+Additionally, if you are interested in computer science and programming, please consider contributing to LEGUP! Not only would it a great way to practice logical reasoning, but it is also a great way to dip your toes into open source software and contributing to open source projects.
## Documentation
-Documentation is actively being worked on on the [LEGUP wiki](https://github.com/Bram-Hub/Legup/wiki).
+Documentation is actively being worked on on the [LEGUP wiki](https://github.com/Bram-Hub/Legup/wiki).
+
+The Javadocs for our application are currently hosted directly on [our Github Pages site](https://bram-hub.github.io/LEGUP/).
Documentation is very much in the early stages, and we would greatly appreciate anyone who is willing to help write and structure the documentation. Currently, the priority is to write detailed documentation on how Nurikabe works, as it is the puzzle that is the most developed within LEGUP.
@@ -75,7 +77,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
```
-
+
The look and feel of LEGUP uses [FlatLaf](https://github.com/JFormDesigner/FlatLaf), which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index addaf242b..5d6256635 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,33 +16,33 @@ sourceCompatibility = 1.8
dependencies {
implementation 'org.jetbrains:annotations:20.1.0'
implementation 'org.jetbrains:annotations:20.1.0'
- compile 'com.formdev:flatlaf:3.0'
- compile project(':legup-update')
- compile 'com.google.firebase:firebase-admin:6.3.0'
- compile 'org.apache.httpcomponents:httpclient:4.5.1'
- compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
- compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
+ implementation 'com.formdev:flatlaf:3.0'
+ implementation project(':legup-update')
+ implementation 'com.google.firebase:firebase-admin:6.3.0'
+ implementation 'org.apache.httpcomponents:httpclient:4.5.1'
+ implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
+ implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
-// compile 'com.google.code.gson:gson:2.8.2'
-// compile 'commons-cli:commons-cli:1.4'
-// compile 'commons-io:commons-io:2.6'
- compile 'org.apache.commons:commons-lang3:3.12.0'
- compile 'org.apache.logging.log4j:log4j-api:2.17.2'
- compile 'org.apache.logging.log4j:log4j-core:2.17.2'
+// implementation 'com.google.code.gson:gson:2.8.2'
+// implementation 'commons-cli:commons-cli:1.4'
+// implementation 'commons-io:commons-io:2.6'
+ implementation 'org.apache.commons:commons-lang3:3.12.0'
+ implementation 'org.apache.logging.log4j:log4j-api:2.17.2'
+ implementation 'org.apache.logging.log4j:log4j-core:2.17.2'
- testCompile group: 'junit', name: 'junit', version: '4.12'
- testCompile 'junit:junit:4.+'
+ testImplementation group: 'junit', name: 'junit', version: '4.12'
+ testImplementation 'junit:junit:4.+'
}
task customFatJar(type: Jar) {
manifest {
attributes('Implementation-Title': 'Legup',
- 'Implementation-Version': version,
+ 'Implementation-Version': archiveVersion,
'Main-Class': 'edu.rpi.legup.Legup',
'SplashScreen-Image': 'edu/rpi/legup/images/Legup/LegupSplash.png')
}
- archiveName = 'Legup.jar'
- baseName = 'Legup.jar'
+ archiveFileName = 'Legup.jar'
+ archiveBaseName = 'Legup.jar'
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
@@ -52,21 +52,23 @@ task customFatJar(type: Jar) {
}
jar {
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+
from {
- configurations.compile.collect {
+ configurations.compileClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
- configurations.runtime.collect {
+ configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes('Implementation-Title': 'Legup',
- 'Implementation-Version': version,
+ 'Implementation-Version': archiveVersion,
'Main-Class': 'edu.rpi.legup.Legup',
'SplashScreen-Image': 'edu/rpi/legup/images/Legup/LegupSplash.png')
}
- archiveName = 'Legup.jar'
+ archiveFileName = 'Legup.jar'
}
/*
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 000000000..03b2e37ad
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1 @@
+org.gradle.warning.mode=all
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 830458866..2d2fd7c74 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
\ No newline at end of file
diff --git a/legup-update/build.gradle b/legup-update/build.gradle
index 097f18413..573fcf38c 100644
--- a/legup-update/build.gradle
+++ b/legup-update/build.gradle
@@ -11,12 +11,12 @@ repositories {
}
dependencies {
- compile 'com.google.code.gson:gson:2.8.2'
- compile 'commons-cli:commons-cli:1.4'
- compile 'commons-io:commons-io:2.6'
- compile 'org.apache.commons:commons-lang3:3.7'
- compile 'org.apache.logging.log4j:log4j-api:2.10.0'
- compile 'org.apache.logging.log4j:log4j-core:2.10.0'
+ implementation 'com.google.code.gson:gson:2.8.2'
+ implementation 'commons-cli:commons-cli:1.4'
+ implementation 'commons-io:commons-io:2.6'
+ implementation 'org.apache.commons:commons-lang3:3.7'
+ implementation 'org.apache.logging.log4j:log4j-api:2.10.0'
+ implementation 'org.apache.logging.log4j:log4j-core:2.10.0'
- testCompile group: 'junit', name: 'junit', version: '4.12'
+ testImplementation group: 'junit', name: 'junit', version: '4.12'
}
\ No newline at end of file
From 2aac5b6964fddb5aecc823cf10ecdffdc1a054a2 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 17 Feb 2023 17:03:57 -0500
Subject: [PATCH 043/148] fixed bug that's causing some buttons to remain
highlighted after being clicked
---
src/main/java/edu/rpi/legup/ui/DynamicView.java | 4 ++++
src/main/java/edu/rpi/legup/ui/HomePanel.java | 4 ++++
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 1 +
.../legup/ui/lookandfeel/components/MaterialComboBoxUI.java | 1 +
.../legup/ui/lookandfeel/components/MaterialScrollBarUI.java | 2 ++
.../legup/ui/lookandfeel/components/MaterialSpinnerUI.java | 3 ++-
.../edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java | 1 +
.../legup/ui/proofeditorui/treeview/TreeToolBarButton.java | 1 +
.../legup/ui/puzzleeditorui/elementsview/ElementButton.java | 1 +
9 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/ui/DynamicView.java b/src/main/java/edu/rpi/legup/ui/DynamicView.java
index bab457e15..3290bde5b 100644
--- a/src/main/java/edu/rpi/legup/ui/DynamicView.java
+++ b/src/main/java/edu/rpi/legup/ui/DynamicView.java
@@ -99,6 +99,8 @@ private JPanel setUpZoomerHelper(final String label, ActionListener listener) {
// Create and add the resize button to the zoomer
JButton resizeButton = new JButton(label);
+ resizeButton.setFocusPainted(false);
+ resizeButton.setFocusPainted(false);
resizeButton.setEnabled(true);
resizeButton.setSize(100, 50);
resizeButton.addActionListener(listener);
@@ -112,6 +114,7 @@ private JPanel setUpZoomerHelper(final String label, ActionListener listener) {
JButton plus = new JButton(new ImageIcon(ImageIO.read(
Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResource(
"edu/rpi/legup/imgs/add.png")))));
+ plus.setFocusPainted(false);
plus.setFont(MaterialFonts.getRegularFont(10f));
plus.setPreferredSize(new Dimension(20, 20));
plus.addActionListener((ActionEvent e) -> zoomSlider.setValue(zoomSlider.getValue() + 25));
@@ -120,6 +123,7 @@ private JPanel setUpZoomerHelper(final String label, ActionListener listener) {
JButton minus = new JButton(new ImageIcon(ImageIO.read(
Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResource(
"edu/rpi/legup/imgs/remove.png")))));
+ minus.setFocusPainted(false);
minus.setPreferredSize(new Dimension(20, 20));
minus.setFont(MaterialFonts.getRegularFont(10f));
minus.addActionListener((ActionEvent e) -> zoomSlider.setValue(zoomSlider.getValue() - 25));
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 8cc78afda..c47c8ee23 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -129,6 +129,7 @@ private void initButtons() {
URL button0IconLocation = ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/homepanel/proof_file.png");
ImageIcon button0Icon = new ImageIcon(button0IconLocation);
+ this.buttons[0].setFocusPainted(false);
this.buttons[0].setIcon(resizeButtonIcon(button0Icon, this.buttonSize, this.buttonSize));
this.buttons[0].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[0].setVerticalTextPosition(AbstractButton.BOTTOM);
@@ -142,6 +143,7 @@ private void initButtons() {
};
URL button1IconLocation = ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/homepanel/new_puzzle_file.png");
ImageIcon button1Icon = new ImageIcon(button1IconLocation);
+ this.buttons[1].setFocusPainted(false);
this.buttons[1].setIcon(resizeButtonIcon(button1Icon, this.buttonSize, this.buttonSize));
this.buttons[1].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[1].setVerticalTextPosition(AbstractButton.BOTTOM);
@@ -155,6 +157,7 @@ private void initButtons() {
};
URL button2IconLocation = ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/homepanel/puzzle_file.png");
ImageIcon button2Icon = new ImageIcon(button2IconLocation);
+ this.buttons[2].setFocusPainted(false);
this.buttons[2].setIcon(resizeButtonIcon(button2Icon, this.buttonSize, this.buttonSize));
this.buttons[2].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[2].setVerticalTextPosition(AbstractButton.BOTTOM);
@@ -165,6 +168,7 @@ private void initButtons() {
this.buttons[i].setBounds(200, 200, 700, 700);
}
this.buttons[3] = new JButton("Batch Grader");
+ this.buttons[3].setFocusPainted(false);
this.buttons[3].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[3].setVerticalTextPosition(AbstractButton.BOTTOM);
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 541e44658..40d908b50 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -496,6 +496,7 @@ public void add_drop(){
// we should create a need jbuttom for it to ship the rule we select.
JPanel panel= new JPanel();
JButton moveing_buttom= new JButton();
+ moveing_buttom.setFocusPainted(false);
moveing_buttom.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
diff --git a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java
index 6b7c042f4..f9d6fa090 100644
--- a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java
+++ b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java
@@ -43,6 +43,7 @@ protected JButton createArrowButton() {
else {
button = new BasicArrowButton(SwingConstants.SOUTH);
}
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("ComboBox.buttonBackground"));
button.setBorder(BorderFactory.createEmptyBorder());
diff --git a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java
index f91149d75..4bf5bbb0f 100644
--- a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java
+++ b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java
@@ -43,6 +43,7 @@ public void paint(Graphics g, JComponent c) {
protected JButton createDecreaseButton(int orientation) {
JButton button = new BasicArrowButton(orientation);
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("ScrollBar.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("ScrollBar.arrowButtonBorder"));
@@ -54,6 +55,7 @@ protected JButton createDecreaseButton(int orientation) {
protected JButton createIncreaseButton(int orientation) {
JButton button = new BasicArrowButton(orientation);
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("ScrollBar.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("ScrollBar.arrowButtonBorder"));
diff --git a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java
index 5b6a7e175..0a74c9d99 100644
--- a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java
+++ b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java
@@ -55,6 +55,7 @@ protected Component createNextButton() {
else {
button = new BasicArrowButton(SwingConstants.NORTH);
}
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("Spinner.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("Spinner.arrowButtonBorder"));
@@ -73,7 +74,7 @@ protected Component createPreviousButton() {
else {
button = new BasicArrowButton(SwingConstants.SOUTH);
}
-
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("Spinner.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("Spinner.arrowButtonBorder"));
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java
index 7e2e30bf5..30545f413 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java
@@ -15,6 +15,7 @@ public class RuleButton extends JButton {
RuleButton(Rule rule) {
super(rule.getRuleName(), rule.getImageIcon()); // display rules' name under rule when load the icon
this.rule = rule;
+ this.setFocusPainted(false);
}
/**
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java
index b39c53b41..c2f40e21a 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java
@@ -13,6 +13,7 @@ public TreeToolBarButton(ImageIcon imageIcon, TreeToolBarName name) {
this.name = name;
this.setSize(MINIMUM_DIMENSION.width, MINIMUM_DIMENSION.height);
this.setMinimumSize(this.MINIMUM_DIMENSION);
+ this.setFocusPainted(false);
}
public TreeToolBarName getToolBarName() {
diff --git a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java
index dfe879379..de2281ad1 100644
--- a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java
+++ b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java
@@ -16,6 +16,7 @@ public class ElementButton extends JButton {
super(e.getImageIcon());
this.element = e;
this.originalBorder = this.getBorder();
+ this.setFocusPainted(false);
}
public Element getElement() {
From 3c58c604fd6238db0656e5702818f581bcb6c3ea Mon Sep 17 00:00:00 2001
From: N-Desmarais <55117352+N-Desmarais@users.noreply.github.com>
Date: Fri, 17 Feb 2023 17:16:43 -0500
Subject: [PATCH 044/148] Fixed Biconditional Contradiction (#459)
Updated the id code to match the reference sheet
---
.../rules/contradiction/ContradictionRuleBiconditional.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction/ContradictionRuleBiconditional.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction/ContradictionRuleBiconditional.java
index b6b159b26..bf215358a 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction/ContradictionRuleBiconditional.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/rules/contradiction/ContradictionRuleBiconditional.java
@@ -6,7 +6,7 @@
public class ContradictionRuleBiconditional extends ContradictionRule_GenericStatement {
public ContradictionRuleBiconditional() {
- super("STTT-CONT-0002", "Contradicting Biconditional",
+ super("STTT-CONT-0003", "Contradicting Biconditional",
"A Biconditional statement must have a contradicting pattern",
"edu/rpi/legup/images/shorttruthtable/ruleimages/contradiction/Biconditional.png",
ShortTruthTableOperation.BICONDITIONAL,
From 47db9d67ce50dc419d02ea09616c793e1ccdf09f Mon Sep 17 00:00:00 2001
From: Jun Song <40209659+Acewvrs@users.noreply.github.com>
Date: Fri, 17 Feb 2023 17:20:33 -0500
Subject: [PATCH 045/148] fixed bug that's causing some buttons to remain
highlighted after being clicked (#461)
---
src/main/java/edu/rpi/legup/ui/DynamicView.java | 4 ++++
src/main/java/edu/rpi/legup/ui/HomePanel.java | 4 ++++
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 1 +
.../legup/ui/lookandfeel/components/MaterialComboBoxUI.java | 1 +
.../legup/ui/lookandfeel/components/MaterialScrollBarUI.java | 2 ++
.../legup/ui/lookandfeel/components/MaterialSpinnerUI.java | 3 ++-
.../edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java | 1 +
.../legup/ui/proofeditorui/treeview/TreeToolBarButton.java | 1 +
.../legup/ui/puzzleeditorui/elementsview/ElementButton.java | 1 +
9 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/ui/DynamicView.java b/src/main/java/edu/rpi/legup/ui/DynamicView.java
index bab457e15..3290bde5b 100644
--- a/src/main/java/edu/rpi/legup/ui/DynamicView.java
+++ b/src/main/java/edu/rpi/legup/ui/DynamicView.java
@@ -99,6 +99,8 @@ private JPanel setUpZoomerHelper(final String label, ActionListener listener) {
// Create and add the resize button to the zoomer
JButton resizeButton = new JButton(label);
+ resizeButton.setFocusPainted(false);
+ resizeButton.setFocusPainted(false);
resizeButton.setEnabled(true);
resizeButton.setSize(100, 50);
resizeButton.addActionListener(listener);
@@ -112,6 +114,7 @@ private JPanel setUpZoomerHelper(final String label, ActionListener listener) {
JButton plus = new JButton(new ImageIcon(ImageIO.read(
Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResource(
"edu/rpi/legup/imgs/add.png")))));
+ plus.setFocusPainted(false);
plus.setFont(MaterialFonts.getRegularFont(10f));
plus.setPreferredSize(new Dimension(20, 20));
plus.addActionListener((ActionEvent e) -> zoomSlider.setValue(zoomSlider.getValue() + 25));
@@ -120,6 +123,7 @@ private JPanel setUpZoomerHelper(final String label, ActionListener listener) {
JButton minus = new JButton(new ImageIcon(ImageIO.read(
Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResource(
"edu/rpi/legup/imgs/remove.png")))));
+ minus.setFocusPainted(false);
minus.setPreferredSize(new Dimension(20, 20));
minus.setFont(MaterialFonts.getRegularFont(10f));
minus.addActionListener((ActionEvent e) -> zoomSlider.setValue(zoomSlider.getValue() - 25));
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 8cc78afda..c47c8ee23 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -129,6 +129,7 @@ private void initButtons() {
URL button0IconLocation = ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/homepanel/proof_file.png");
ImageIcon button0Icon = new ImageIcon(button0IconLocation);
+ this.buttons[0].setFocusPainted(false);
this.buttons[0].setIcon(resizeButtonIcon(button0Icon, this.buttonSize, this.buttonSize));
this.buttons[0].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[0].setVerticalTextPosition(AbstractButton.BOTTOM);
@@ -142,6 +143,7 @@ private void initButtons() {
};
URL button1IconLocation = ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/homepanel/new_puzzle_file.png");
ImageIcon button1Icon = new ImageIcon(button1IconLocation);
+ this.buttons[1].setFocusPainted(false);
this.buttons[1].setIcon(resizeButtonIcon(button1Icon, this.buttonSize, this.buttonSize));
this.buttons[1].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[1].setVerticalTextPosition(AbstractButton.BOTTOM);
@@ -155,6 +157,7 @@ private void initButtons() {
};
URL button2IconLocation = ClassLoader.getSystemClassLoader().getResource("edu/rpi/legup/images/Legup/homepanel/puzzle_file.png");
ImageIcon button2Icon = new ImageIcon(button2IconLocation);
+ this.buttons[2].setFocusPainted(false);
this.buttons[2].setIcon(resizeButtonIcon(button2Icon, this.buttonSize, this.buttonSize));
this.buttons[2].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[2].setVerticalTextPosition(AbstractButton.BOTTOM);
@@ -165,6 +168,7 @@ private void initButtons() {
this.buttons[i].setBounds(200, 200, 700, 700);
}
this.buttons[3] = new JButton("Batch Grader");
+ this.buttons[3].setFocusPainted(false);
this.buttons[3].setHorizontalTextPosition(AbstractButton.CENTER);
this.buttons[3].setVerticalTextPosition(AbstractButton.BOTTOM);
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index bfc5bf3d9..c0e7a9897 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -512,6 +512,7 @@ public void add_drop(){
// we should create a need jbuttom for it to ship the rule we select.
JPanel panel= new JPanel();
JButton moveing_buttom= new JButton();
+ moveing_buttom.setFocusPainted(false);
moveing_buttom.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
diff --git a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java
index 6b7c042f4..f9d6fa090 100644
--- a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java
+++ b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialComboBoxUI.java
@@ -43,6 +43,7 @@ protected JButton createArrowButton() {
else {
button = new BasicArrowButton(SwingConstants.SOUTH);
}
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("ComboBox.buttonBackground"));
button.setBorder(BorderFactory.createEmptyBorder());
diff --git a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java
index f91149d75..4bf5bbb0f 100644
--- a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java
+++ b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialScrollBarUI.java
@@ -43,6 +43,7 @@ public void paint(Graphics g, JComponent c) {
protected JButton createDecreaseButton(int orientation) {
JButton button = new BasicArrowButton(orientation);
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("ScrollBar.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("ScrollBar.arrowButtonBorder"));
@@ -54,6 +55,7 @@ protected JButton createDecreaseButton(int orientation) {
protected JButton createIncreaseButton(int orientation) {
JButton button = new BasicArrowButton(orientation);
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("ScrollBar.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("ScrollBar.arrowButtonBorder"));
diff --git a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java
index 5b6a7e175..0a74c9d99 100644
--- a/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java
+++ b/src/main/java/edu/rpi/legup/ui/lookandfeel/components/MaterialSpinnerUI.java
@@ -55,6 +55,7 @@ protected Component createNextButton() {
else {
button = new BasicArrowButton(SwingConstants.NORTH);
}
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("Spinner.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("Spinner.arrowButtonBorder"));
@@ -73,7 +74,7 @@ protected Component createPreviousButton() {
else {
button = new BasicArrowButton(SwingConstants.SOUTH);
}
-
+ button.setFocusPainted(false);
button.setOpaque(true);
button.setBackground(UIManager.getColor("Spinner.arrowButtonBackground"));
button.setBorder(UIManager.getBorder("Spinner.arrowButtonBorder"));
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java
index 7e2e30bf5..30545f413 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleButton.java
@@ -15,6 +15,7 @@ public class RuleButton extends JButton {
RuleButton(Rule rule) {
super(rule.getRuleName(), rule.getImageIcon()); // display rules' name under rule when load the icon
this.rule = rule;
+ this.setFocusPainted(false);
}
/**
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java
index b39c53b41..c2f40e21a 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeToolBarButton.java
@@ -13,6 +13,7 @@ public TreeToolBarButton(ImageIcon imageIcon, TreeToolBarName name) {
this.name = name;
this.setSize(MINIMUM_DIMENSION.width, MINIMUM_DIMENSION.height);
this.setMinimumSize(this.MINIMUM_DIMENSION);
+ this.setFocusPainted(false);
}
public TreeToolBarName getToolBarName() {
diff --git a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java
index dfe879379..de2281ad1 100644
--- a/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java
+++ b/src/main/java/edu/rpi/legup/ui/puzzleeditorui/elementsview/ElementButton.java
@@ -16,6 +16,7 @@ public class ElementButton extends JButton {
super(e.getImageIcon());
this.element = e;
this.originalBorder = this.getBorder();
+ this.setFocusPainted(false);
}
public Element getElement() {
From 005a166976a61ff75a4511c6e7363eed8e598e70 Mon Sep 17 00:00:00 2001
From: pitbull51067
Date: Fri, 17 Feb 2023 17:25:32 -0500
Subject: [PATCH 046/148] Changes to `TreeTent`.
---
.../legup/puzzle/treetent/ClueCommand.java | 4 +-
.../legup/puzzle/treetent/TreeTentCell.java | 45 ++++++-------------
.../puzzle/treetent/TreeTentCellFactory.java | 2 +-
.../puzzle/treetent/TreeTentController.java | 8 ++--
.../puzzle/treetent/TreeTentExporter.java | 2 +-
.../puzzle/treetent/TreeTentImporter.java | 6 +--
.../legup/puzzle/treetent/TreeTentType.java | 21 ++++++---
.../treetent/rules/EmptyFieldDirectRule.java | 2 +-
.../treetent/rules/FillinRowCaseRule.java | 4 +-
.../rules/FinishWithGrassDirectRule.java | 2 +-
.../rules/FinishWithTentsDirectRule.java | 2 +-
.../rules/LastCampingSpotDirectRule.java | 2 +-
.../SurroundTentWithGrassDirectRule.java | 2 +-
.../treetent/rules/TentOrGrassCaseRule.java | 4 +-
14 files changed, 48 insertions(+), 58 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java b/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java
index 7ada10a07..30af5af51 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java
@@ -70,7 +70,7 @@ public void executeCommand() {
for (TreeTentCell cell : tempList) {
cell = (TreeTentCell) board.getPuzzleElement(cell);
- cell.setData(TreeTentType.GRASS.value);
+ cell.setData(TreeTentType.GRASS);
board.addModifiedData(cell);
finalTran.propagateChange(cell);
@@ -170,7 +170,7 @@ public void undoCommand() {
for (TreeTentCell cell : tempList) {
cell = (TreeTentCell) board.getPuzzleElement(cell);
- cell.setData(TreeTentType.UNKNOWN.value);
+ cell.setData(TreeTentType.UNKNOWN);
board.removeModifiedData(cell);
final TreeTentCell finalCell = cell;
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
index bab45f4ab..290e0858d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
@@ -6,46 +6,27 @@
import java.awt.*;
import java.awt.event.MouseEvent;
-public class TreeTentCell extends GridCell {
+public class TreeTentCell extends GridCell {
- public TreeTentCell(int valueInt, Point location) {
- super(valueInt, location);
+ public TreeTentCell(TreeTentType value, Point location) {
+ super(value, location);
}
public TreeTentType getType() {
- switch (data) {
- case 0:
- return TreeTentType.UNKNOWN;
- case 1:
- return TreeTentType.TREE;
- case 2:
- return TreeTentType.GRASS;
- case 3:
- return TreeTentType.TENT;
- default:
- return null;
- }
+ return data;
}
@Override
public void setType(Element e, MouseEvent m) {
- if (e.getElementName().equals("Unknown Tile")) {
- this.data = 0;
- }
- else {
- if (e.getElementName().equals("Tree Tile")) {
- this.data = 1;
- }
- else {
- if (e.getElementName().equals("Grass Tile")) {
- this.data = 2;
- }
- else {
- if (e.getElementName().equals("Tent Tile")) {
- this.data = 3;
- }
- }
- }
+ switch (e.getElementName()) {
+ case "Unknown Tile":
+ this.data = TreeTentType.UNKNOWN;
+ case "Tree Tile":
+ this.data = TreeTentType.TREE;
+ case "Grass Tile":
+ this.data = TreeTentType.GRASS;
+ case "Tent Tile":
+ this.data = TreeTentType.TENT;
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
index 9543c89dc..7e34f2b27 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
@@ -38,7 +38,7 @@ public PuzzleElement importCell(Node node, Board board) throws InvalidFileFormat
throw new InvalidFileFormatException("TreeTent Factory: cell unknown value");
}
- TreeTentCell cell = new TreeTentCell(value, new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.convertToTreeTentType(value), new Point(x, y));
cell.setIndex(y * height + x);
return cell;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java
index 41ec8a854..1a5416c0d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java
@@ -111,11 +111,11 @@ public TreeTentController() {
public void changeCell(MouseEvent e, PuzzleElement element) {
TreeTentCell cell = (TreeTentCell) element;
if (e.getButton() == MouseEvent.BUTTON1) {
- if (cell.getData() == 0) {
+ if (cell.getData() == TreeTentType.UNKNOWN) {
element.setData(2);
}
else {
- if (cell.getData() == 2) {
+ if (cell.getData() == TreeTentType.GRASS) {
element.setData(3);
}
else {
@@ -125,11 +125,11 @@ public void changeCell(MouseEvent e, PuzzleElement element) {
}
else {
if (e.getButton() == MouseEvent.BUTTON3) {
- if (cell.getData() == 0) {
+ if (cell.getData() == TreeTentType.UNKNOWN) {
element.setData(3);
}
else {
- if (cell.getData() == 2) {
+ if (cell.getData() == TreeTentType.GRASS) {
element.setData(0);
}
else {
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java
index 510114e46..828a5ffe0 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java
@@ -32,7 +32,7 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {
org.w3c.dom.Element cellsElement = newDocument.createElement("cells");
for (PuzzleElement puzzleElement : board.getPuzzleElements()) {
TreeTentCell cell = (TreeTentCell) puzzleElement;
- if (cell.getData() != 0) {
+ if (cell.getData() != TreeTentType.UNKNOWN) {
org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, puzzleElement);
cellsElement.appendChild(cellElement);
}
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 935d8f980..acd094a1b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java
@@ -27,7 +27,7 @@ public void initializeBoard(int rows, int columns) {
for (int y = 0; y < rows; y++) {
for (int x = 0; x < columns; x++) {
if (treeTentBoard.getCell(x, y) == null) {
- TreeTentCell cell = new TreeTentCell(0, new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.UNKNOWN, new Point(x, y));
cell.setIndex(y * columns + x);
cell.setModifiable(true);
treeTentBoard.setCell(x, y, cell);
@@ -88,7 +88,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int i = 0; i < elementDataList.getLength(); i++) {
TreeTentCell cell = (TreeTentCell) puzzle.getFactory().importCell(elementDataList.item(i), treeTentBoard);
Point loc = cell.getLocation();
- if (cell.getData() != 0) {
+ if (cell.getData() != TreeTentType.UNKNOWN) {
cell.setModifiable(false);
cell.setGiven(true);
}
@@ -98,7 +98,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (treeTentBoard.getCell(x, y) == null) {
- TreeTentCell cell = new TreeTentCell(0, new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.UNKNOWN, new Point(x, y));
cell.setIndex(y * height + x);
cell.setModifiable(true);
treeTentBoard.setCell(x, y, cell);
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
index 5faa88c59..cad1b2515 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
@@ -1,12 +1,21 @@
package edu.rpi.legup.puzzle.treetent;
-public enum TreeTentType {
- UNKNOWN(0), TREE(1), GRASS(2), TENT(3),
- CLUE_NORTH(-1), CLUE_EAST(-2), CLUE_SOUTH(-3), CLUE_WEST(-4);
+import edu.rpi.legup.puzzle.masyu.MasyuType;
- public int value;
+public enum TreeTentType {
+ UNKNOWN, TREE, GRASS, TENT,
+ CLUE_NORTH, CLUE_EAST, CLUE_SOUTH, CLUE_WEST;
- TreeTentType(int value) {
- this.value = value;
+ public static TreeTentType convertToTreeTentType(int num) {
+ switch (num) {
+ case 1:
+ return TREE;
+ case 2:
+ return GRASS;
+ case 3:
+ return TENT;
+ default:
+ return UNKNOWN;
+ }
}
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
index f57602114..bd2642497 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
@@ -72,7 +72,7 @@ public Board getDefaultBoard(TreeNode node) {
for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
TreeTentCell cell = (TreeTentCell) element;
if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.GRASS.value);
+ cell.setData(TreeTentType.GRASS);
treeTentBoard.addModifiedData(cell);
}
}
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 b762c7875..e88e321c4 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
@@ -90,12 +90,12 @@ private ArrayList genCombRecursive(TreeTentBoard iBoard, List getCases(Board board, PuzzleElement puzzleElement) {
ArrayList cases = new ArrayList<>();
Board case1 = board.copy();
PuzzleElement data1 = case1.getPuzzleElement(puzzleElement);
- data1.setData(TreeTentType.TENT.value);
+ data1.setData(TreeTentType.TENT);
case1.addModifiedData(data1);
cases.add(case1);
Board case2 = board.copy();
PuzzleElement data2 = case2.getPuzzleElement(puzzleElement);
- data2.setData(TreeTentType.GRASS.value);
+ data2.setData(TreeTentType.GRASS);
case2.addModifiedData(data2);
cases.add(case2);
From ef612a2979cbebe046c611a54751c013bd004812 Mon Sep 17 00:00:00 2001
From: pitbull51067
Date: Fri, 17 Feb 2023 17:33:49 -0500
Subject: [PATCH 047/148] Changes to `TreeTent`.
---
.../java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java | 2 +-
src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
index 7e34f2b27..e5e7603a6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
@@ -38,7 +38,7 @@ public PuzzleElement importCell(Node node, Board board) throws InvalidFileFormat
throw new InvalidFileFormatException("TreeTent Factory: cell unknown value");
}
- TreeTentCell cell = new TreeTentCell(TreeTentType.convertToTreeTentType(value), new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.valueOf(value), new Point(x, y));
cell.setIndex(y * height + x);
return cell;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
index cad1b2515..890cdfe29 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
@@ -6,7 +6,7 @@ public enum TreeTentType {
UNKNOWN, TREE, GRASS, TENT,
CLUE_NORTH, CLUE_EAST, CLUE_SOUTH, CLUE_WEST;
- public static TreeTentType convertToTreeTentType(int num) {
+ public static TreeTentType valueOf(int num) {
switch (num) {
case 1:
return TREE;
From 7e98aadb438dcf7434d8799ce21123368e2ce0d9 Mon Sep 17 00:00:00 2001
From: RyancRiv <104662361+RyancRiv@users.noreply.github.com>
Date: Fri, 17 Feb 2023 17:42:27 -0500
Subject: [PATCH 048/148] Moved text below icon for search panel (#463)
Made buttons same size and moved text to bottom
---
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 3 ++-
.../legup/ui/proofeditorui/rulesview/RuleFrame.java | 2 --
.../legup/ui/proofeditorui/rulesview/RulePanel.java | 12 ++++++++++++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index c0e7a9897..e2529ae70 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -737,8 +737,9 @@ public void setPuzzleView(Puzzle puzzle) {
ruleFrame.getDirectRulePanel().setRules(puzzle.getDirectRules());
ruleFrame.getCasePanel().setRules(puzzle.getCaseRules());
ruleFrame.getContradictionPanel().setRules(puzzle.getContradictionRules());
- //ruleFrame.getSearchPanel().setRules(puzzle.getContradictionRules());
ruleFrame.getSearchPanel().setSearchBar(puzzle);
+// ruleFrame.getSearchPanel().setRules(puzzle.getBasicRules());
+
toolBarButtons[ToolbarName.CHECK.ordinal()].setEnabled(true);
// toolBarButtons[ToolbarName.SAVE.ordinal()].setEnabled(true);
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java
index 73f8b9104..c763f6cef 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RuleFrame.java
@@ -93,7 +93,6 @@ public void setSelectionByRule(Rule rule) {
DirectRulePanel.setSelectionByRule(rule);
casePanel.setSelectionByRule(rule);
contradictionPanel.setSelectionByRule(rule);
-
}
/**
@@ -139,7 +138,6 @@ public void setRules(Puzzle puzzle) {
DirectRulePanel.setRules(puzzle.getDirectRules());
contradictionPanel.setRules(puzzle.getContradictionRules());
casePanel.setRules(puzzle.getCaseRules());
-
}
/**
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
index 5db7beeb4..2f197fe1d 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java
@@ -102,6 +102,10 @@ public void searchForRule(Puzzle puzzle, String ruleName) {
ruleButtons[0] = new RuleButton(rule);
ruleFrame.getButtonGroup().add(ruleButtons[0]);
+ ruleButtons[0].setPreferredSize(new Dimension(150,150));// adjust the size of each RuleButton
+ ruleButtons[0].setHorizontalTextPosition(JButton.CENTER);
+ ruleButtons[0].setVerticalTextPosition(JButton.BOTTOM);
+
ruleButtons[0].setToolTipText(rule.getRuleName() + ": " + rule.getDescription());
ruleButtons[0].addActionListener(ruleFrame.getController());
add(ruleButtons[0]);
@@ -113,6 +117,10 @@ else if(similarityCheck(ruleName, rule.getRuleName().toUpperCase())>0.2){
ruleButtons[similarfound] = new RuleButton(rule);
ruleFrame.getButtonGroup().add(ruleButtons[similarfound]);
+ ruleButtons[similarfound].setPreferredSize(new Dimension(150,150));// adjust the size of each RuleButton
+ ruleButtons[similarfound].setHorizontalTextPosition(JButton.CENTER);
+ ruleButtons[similarfound].setVerticalTextPosition(JButton.BOTTOM);
+
ruleButtons[similarfound].setToolTipText(rule.getRuleName() + ": " + rule.getDescription());
ruleButtons[similarfound].addActionListener(ruleFrame.getController());
add(ruleButtons[similarfound]);
@@ -123,6 +131,10 @@ else if((ruleName.charAt(0)) == (rule.getRuleName().toUpperCase()).charAt(0)){
ruleButtons[similarfound] = new RuleButton(rule);
ruleFrame.getButtonGroup().add(ruleButtons[similarfound]);
+ ruleButtons[similarfound].setPreferredSize(new Dimension(150,150));// adjust the size of each RuleButton
+ ruleButtons[similarfound].setHorizontalTextPosition(JButton.CENTER);
+ ruleButtons[similarfound].setVerticalTextPosition(JButton.BOTTOM);
+
ruleButtons[similarfound].setToolTipText(rule.getRuleName() + ": " + rule.getDescription());
ruleButtons[similarfound].addActionListener(ruleFrame.getController());
add(ruleButtons[similarfound]);
From 9491891450abecb5e4f1371140bf0febbb0a90f8 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 17 Feb 2023 17:47:49 -0500
Subject: [PATCH 049/148] Cleaned up code. removed unused functions and
needless code fragments that got commented out. Added TODO comments to
indicate functions to implement later on
---
.../edu/rpi/legup/app/GameBoardFacade.java | 1 -
.../rpi/legup/app/PuzzleKeyAccelerator.java | 2 ++
.../java/edu/rpi/legup/ui/DynamicView.java | 1 -
src/main/java/edu/rpi/legup/ui/HomePanel.java | 17 ++-------------
src/main/java/edu/rpi/legup/ui/LegupUI.java | 3 ++-
.../java/edu/rpi/legup/ui/PickGameDialog.java | 1 -
.../edu/rpi/legup/ui/ProofEditorPanel.java | 21 +++----------------
.../java/edu/rpi/legup/ui/ScrollView.java | 2 --
.../java/edu/rpi/legup/ui/ZoomWidget.java | 2 +-
9 files changed, 10 insertions(+), 40 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
index 72a36efa3..a8a0bce6d 100644
--- a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
+++ b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
@@ -107,7 +107,6 @@ public static void setupConfig() {
public void setPuzzleEditor(Puzzle puzzle) {
this.puzzle = puzzle;
this.puzzleEditor.setPuzzleView(puzzle);
-// this.history.clear();
}
public void setConfig(Config config) {
diff --git a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
index 17d53eab6..2b43b6164 100644
--- a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
+++ b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
@@ -66,6 +66,8 @@ public void keyPressed(KeyEvent e) {
String update = "";
if (rule.getRuleType() == RuleType.CASE) {
+ // TODO: review this line of code and figure out what it's supposed to do:
+ // TODO: remove if necessary
// handleCaseRule((CaseRule)rule);
}
else {
diff --git a/src/main/java/edu/rpi/legup/ui/DynamicView.java b/src/main/java/edu/rpi/legup/ui/DynamicView.java
index 3290bde5b..038f87d23 100644
--- a/src/main/java/edu/rpi/legup/ui/DynamicView.java
+++ b/src/main/java/edu/rpi/legup/ui/DynamicView.java
@@ -203,7 +203,6 @@ public void resetStatus() {
}
public void reset() {
- // System.out.println("get into the reset");
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
Board board1 = GameBoardFacade.getInstance().getBoard();
board1.setModifiable(true);
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index c47c8ee23..e559522a7 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -164,7 +164,6 @@ private void initButtons() {
this.buttons[2].addActionListener(CursorController.createListener(this, openPuzzleListener)); // PLACEHOLDER
for (int i = 0; i < this.buttons.length - 1; i++) { // -1 to avoid the batch grader button
- //this.buttons[i].setPreferredSize(new Dimension(100, 100));
this.buttons[i].setBounds(200, 200, 700, 700);
}
this.buttons[3] = new JButton("Batch Grader");
@@ -175,18 +174,12 @@ private void initButtons() {
this.buttons[3].addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
-// ProofEditorPanel panel=new ProofEditorPanel(new FileDialog(new Frame()),new JFrame(), legupUI);
-// //legupUI.setVisible(false);
-// panel.checkProofAll();
- //checkfolder();
-
try {
use_xml_to_check();
}
catch (Exception ex) {
throw new RuntimeException(ex);
}
- //checkallproof1();
System.out.println("finished checking the folder");
}
@@ -226,8 +219,6 @@ public void checkfolder(){
writer.append(",");
writer.append("Solved or not");
writer.append("\n");
- //csvWriter.flush();
- //csvWriter.close();
for (final File folderEntry : folder.listFiles(File::isDirectory)) {
writer.append(folderEntry.getName());
@@ -317,7 +308,7 @@ public void use_xml_to_check() throws Exception{
File resultFile = new File(folder.getAbsolutePath() + File.separator +"result.csv");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser saxParser = spf.newSAXParser();
-// String path = "C:\\Users\\LiWeiJun\\Desktop\\TestSet\\TestSet\\roseh";
+
//read the xml file
try (BufferedWriter writer = new BufferedWriter(new FileWriter(resultFile))) {
writer.write("Name");
@@ -533,10 +524,7 @@ public void traverseDir1(File folder, BufferedWriter writer, String path) throws
}
}
private void initText() {
- // Note: until an auto-changing version label is implemented in the future, I removed
- // the version text from the home screen to avoid confusion
-
- // this.text = new JLabel[3];
+ // TODO: add version text after auto-changing version label is implemented. (text[2] = version)
this.text = new JLabel[2];
JLabel welcome = new JLabel("Welcome to Legup");
@@ -553,7 +541,6 @@ private void initText() {
this.text[0] = welcome;
this.text[1] = credits;
- // this.text[2] = version;
}
private void render() {
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index 32e661a78..6d5802641 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -133,8 +133,9 @@ public void errorEncountered(String error) {
JOptionPane.showMessageDialog(null, error);
}
+ // TODO: implement
public void showStatus(String status, boolean error, int timer) {
- // TODO: implement
+
}
//ask to edu.rpi.legup.save current proof
diff --git a/src/main/java/edu/rpi/legup/ui/PickGameDialog.java b/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
index 1822efda6..24fc4602f 100644
--- a/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
@@ -126,7 +126,6 @@ public void initPuzzles() {
puzzles = new String[games.length][];
puzzleBox = new JTextField();
for (int x = 0; x < games.length; ++x) {
- // o = GameBoardFacade.getInstance().getConfig().getBoardsForPuzzle(games[x]).toArray();
puzzles[x] = new String[o.length];
for (int y = 0; y < o.length; ++y) {
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index c0e7a9897..70ee05613 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -117,7 +117,7 @@ public JMenuBar getMenuBar() {
file = new JMenu("File");
newPuzzle = new JMenuItem("Open");
resetPuzzle = new JMenuItem("Reset Puzzle");
-// genPuzzle = new JMenuItem("Puzzle Generators");
+// genPuzzle = new JMenuItem("Puzzle Generators"); // TODO: implement puzzle generator
saveProofAs = new JMenuItem("Save Proof As"); // create a new file to save
saveProofChange = new JMenuItem("Save Proof Change"); // save to the current file
preferences = new JMenuItem("Preferences");
@@ -203,9 +203,6 @@ public JMenuBar getMenuBar() {
helpLegup = new JMenuItem("Help Legup");
aboutLegup = new JMenuItem("About Legup");
- // unused
- // help = new JMenu("Help");
-
mBar.add(file);
file.add(newPuzzle);
newPuzzle.addActionListener((ActionEvent) -> promptPuzzle());
@@ -216,12 +213,6 @@ public JMenuBar getMenuBar() {
newPuzzle.setAccelerator(KeyStroke.getKeyStroke('N', InputEvent.CTRL_DOWN_MASK));
}
-// file.add(genPuzzle);
-//// genPuzzle.addActionListener((ActionEvent) ->
-//// {
-//// pickGameDialog = new PickGameDialog(this, true);
-//// pickGameDialog.setVisible(true);
-//// });
file.add(resetPuzzle);
resetPuzzle.addActionListener(a -> {
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
@@ -973,16 +964,10 @@ private void submit() {
}
}
- private void directions() {
- JOptionPane.showMessageDialog(null, "For every move you make, you must provide a rule for it (located in the Rules panel).\n" + "While working on the edu.rpi.legup.puzzle, you may click on the \"Check\" button to test your proof for correctness.", "Directions", JOptionPane.PLAIN_MESSAGE);
- }
-
- public void errorEncountered(String error) {
- JOptionPane.showMessageDialog(null, error);
- }
+ // TODO: implement
public void showStatus(String status, boolean error, int timer) {
- // TODO: implement
+
}
protected void fitTreeViewToScreen() {
diff --git a/src/main/java/edu/rpi/legup/ui/ScrollView.java b/src/main/java/edu/rpi/legup/ui/ScrollView.java
index bc638ee7e..d49f9207c 100644
--- a/src/main/java/edu/rpi/legup/ui/ScrollView.java
+++ b/src/main/java/edu/rpi/legup/ui/ScrollView.java
@@ -170,8 +170,6 @@ public void zoom(int n, Point point) {
}
public void zoomTo(double newScale) {
- //System.out.println("Zooming to " + newScale);
-
// check zoom bounds
if (newScale < minScale) {
newScale = minScale;
diff --git a/src/main/java/edu/rpi/legup/ui/ZoomWidget.java b/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
index c183df86c..1e423c346 100644
--- a/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
+++ b/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
@@ -18,7 +18,7 @@ public class ZoomWidget extends JLabel {
private MouseAdapter open = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
palette.slider.setValue(parent.getZoom());
- palette.show(e.getComponent(), 0, 0);//e.getX(), e.getY() );
+ palette.show(e.getComponent(), 0, 0);
}
};
From 1d0eb94a2ff35e3081719da2cde6db3c0a23c699 Mon Sep 17 00:00:00 2001
From: Kevin Xu <35581753+kevinkxu@users.noreply.github.com>
Date: Fri, 24 Feb 2023 14:46:57 -0500
Subject: [PATCH 050/148] [ENHANCEMENT] Add dark mode #404 (#466)
* [ENHANCEMENT] Add dark mode #404
* Changed all instances of "night mode" to "dark mode"
---------
Co-authored-by: charlestian23
---
.../edu/rpi/legup/app/LegupPreferences.java | 6 ++--
src/main/java/edu/rpi/legup/ui/LegupUI.java | 10 ++++--
.../edu/rpi/legup/ui/PreferencesDialog.java | 36 ++++++++++++++++---
3 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/app/LegupPreferences.java b/src/main/java/edu/rpi/legup/app/LegupPreferences.java
index 06275927d..0b88003e4 100644
--- a/src/main/java/edu/rpi/legup/app/LegupPreferences.java
+++ b/src/main/java/edu/rpi/legup/app/LegupPreferences.java
@@ -4,9 +4,6 @@
import java.util.Map;
import java.util.prefs.Preferences;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
public class LegupPreferences {
private static LegupPreferences instance;
@@ -19,6 +16,7 @@ public class LegupPreferences {
public static final String WORK_DIRECTORY = "work-directory";
public static final String START_FULL_SCREEN = "start-full-screen";
public static final String AUTO_UPDATE = "auto-update";
+ public static final String DARK_MODE = "night-mode";
public static final String SHOW_MISTAKES = "show-mistakes";
public static final String SHOW_ANNOTATIONS = "show-annotations";
public static final String ALLOW_DEFAULT_RULES = "allow-default-rules";
@@ -29,6 +27,7 @@ public class LegupPreferences {
defaultPreferencesMap.put(WORK_DIRECTORY, System.getProperty("user.home"));
defaultPreferencesMap.put(START_FULL_SCREEN, Boolean.toString(false));
defaultPreferencesMap.put(AUTO_UPDATE, Boolean.toString(true));
+ defaultPreferencesMap.put(DARK_MODE, Boolean.toString(false));
defaultPreferencesMap.put(SHOW_MISTAKES, Boolean.toString(true));
defaultPreferencesMap.put(SHOW_ANNOTATIONS, Boolean.toString(false));
defaultPreferencesMap.put(ALLOW_DEFAULT_RULES, Boolean.toString(false));
@@ -40,6 +39,7 @@ public class LegupPreferences {
preferencesMap.put(WORK_DIRECTORY, preferences.get(WORK_DIRECTORY, defaultPreferencesMap.get(WORK_DIRECTORY)));
preferencesMap.put(START_FULL_SCREEN, preferences.get(START_FULL_SCREEN, defaultPreferencesMap.get(START_FULL_SCREEN)));
preferencesMap.put(AUTO_UPDATE, preferences.get(AUTO_UPDATE, defaultPreferencesMap.get(AUTO_UPDATE)));
+ preferencesMap.put(DARK_MODE, preferences.get(DARK_MODE, defaultPreferencesMap.get(DARK_MODE)));
preferencesMap.put(SHOW_MISTAKES, preferences.get(SHOW_MISTAKES, defaultPreferencesMap.get(SHOW_MISTAKES)));
preferencesMap.put(SHOW_ANNOTATIONS, preferences.get(SHOW_ANNOTATIONS, defaultPreferencesMap.get(SHOW_ANNOTATIONS)));
preferencesMap.put(ALLOW_DEFAULT_RULES, preferences.get(ALLOW_DEFAULT_RULES, defaultPreferencesMap.get(ALLOW_DEFAULT_RULES)));
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index 32e661a78..6eab874b9 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -9,9 +9,9 @@
import com.formdev.flatlaf.FlatLightLaf;
+import com.formdev.flatlaf.FlatDarkLaf;
import edu.rpi.legup.app.GameBoardFacade;
import edu.rpi.legup.app.LegupPreferences;
-import edu.rpi.legup.ui.lookandfeel.LegupLookAndFeel;
import edu.rpi.legup.ui.boardview.BoardView;
import edu.rpi.legup.ui.proofeditorui.treeview.TreePanel;
@@ -45,9 +45,15 @@ public static String getOS() {
public LegupUI() {
setTitle("LEGUP");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ LegupPreferences prefs = LegupPreferences.getInstance();
try {
- UIManager.setLookAndFeel(new FlatLightLaf());
+ if(Boolean.valueOf(prefs.getUserPref(LegupPreferences.DARK_MODE))) {
+ UIManager.setLookAndFeel(new FlatDarkLaf());
+ }
+ else {
+ UIManager.setLookAndFeel(new FlatLightLaf());
+ }
}
catch (UnsupportedLookAndFeelException e) {
System.err.println("Not supported ui look and feel");
diff --git a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
index 535e632f8..6eb6b3413 100644
--- a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
@@ -1,7 +1,5 @@
package edu.rpi.legup.ui;
-import edu.rpi.legup.app.Config;
-import edu.rpi.legup.app.GameBoardFacade;
import edu.rpi.legup.app.LegupPreferences;
import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.rules.Rule;
@@ -14,16 +12,16 @@
import java.awt.event.*;
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.logging.Level;
import java.util.logging.Logger;
+import com.formdev.flatlaf.FlatLightLaf;
+import com.formdev.flatlaf.FlatDarkLaf;
public class PreferencesDialog extends JDialog {
private final static Logger LOGGER = Logger.getLogger(PreferencesDialog.class.getName());
- private JCheckBox fullScreen, autoUpdate, showMistakes, showAnnotations, allowDefault, generateCases, immFeedback;
+ private JCheckBox fullScreen, autoUpdate, darkMode, showMistakes, showAnnotations, allowDefault, generateCases, immFeedback;
private JTextField workDirectory;
private static Image folderIcon;
@@ -81,6 +79,21 @@ public PreferencesDialog(Frame frame) {
setVisible(true);
}
+ private void toggleDarkMode(LegupPreferences prefs) {
+ try {
+ if(Boolean.valueOf(prefs.getUserPref(LegupPreferences.DARK_MODE))) {
+ UIManager.setLookAndFeel(new FlatDarkLaf());
+ }
+ else {
+ UIManager.setLookAndFeel(new FlatLightLaf());
+ }
+ com.formdev.flatlaf.FlatLaf.updateUI();
+ }
+ catch (UnsupportedLookAndFeelException e) {
+ System.err.println("Not supported ui look and feel");
+ }
+ }
+
private JScrollPane createGeneralTab() {
LegupPreferences prefs = LegupPreferences.getInstance();
JScrollPane scrollPane = new JScrollPane();
@@ -131,6 +144,15 @@ private JScrollPane createGeneralTab() {
contentPane.add(autoUpdateRow);
contentPane.add(Box.createRigidArea(new Dimension(0, 10)));
+ darkMode = new JCheckBox("Dark Mode", Boolean.valueOf(prefs.getUserPref(LegupPreferences.DARK_MODE)));
+ darkMode.setToolTipText("This turns dark mode on and off");
+ JPanel darkModeRow = new JPanel();
+ darkModeRow.setLayout(new BorderLayout());
+ darkModeRow.add(darkMode, BorderLayout.WEST);
+ darkModeRow.setMaximumSize(new Dimension(Integer.MAX_VALUE, darkModeRow.getPreferredSize().height));
+ contentPane.add(darkModeRow);
+ contentPane.add(Box.createRigidArea(new Dimension(0, 10)));
+
contentPane.add(createLeftLabel("Board View Preferences"));
contentPane.add(createLineSeparator());
showMistakes = new JCheckBox("Show Mistakes", Boolean.valueOf(prefs.getUserPref(LegupPreferences.SHOW_MISTAKES)));
@@ -306,10 +328,14 @@ public void applyPreferences() {
prefs.setUserPref(LegupPreferences.WORK_DIRECTORY, workDirectory.getText());
prefs.setUserPref(LegupPreferences.START_FULL_SCREEN, Boolean.toString(fullScreen.isSelected()));
prefs.setUserPref(LegupPreferences.AUTO_UPDATE, Boolean.toString(autoUpdate.isSelected()));
+ prefs.setUserPref(LegupPreferences.DARK_MODE, Boolean.toString(darkMode.isSelected()));
prefs.setUserPref(LegupPreferences.SHOW_MISTAKES, Boolean.toString(showMistakes.isSelected()));
prefs.setUserPref(LegupPreferences.SHOW_ANNOTATIONS, Boolean.toString(showAnnotations.isSelected()));
prefs.setUserPref(LegupPreferences.ALLOW_DEFAULT_RULES, Boolean.toString(allowDefault.isSelected()));
prefs.setUserPref(LegupPreferences.AUTO_GENERATE_CASES, Boolean.toString(generateCases.isSelected()));
prefs.setUserPref(LegupPreferences.IMMEDIATE_FEEDBACK, Boolean.toString(immFeedback.isSelected()));
+
+ // toggle dark mode based on updated NIGHT_MODE variable
+ toggleDarkMode(prefs);
}
}
\ No newline at end of file
From e066d10bbbf340b72b5477c99293908dcc4d66c0 Mon Sep 17 00:00:00 2001
From: jason pu
Date: Fri, 24 Feb 2023 16:13:12 -0500
Subject: [PATCH 051/148] 95 white bottle beck (#469)
* Update NoNumbersContradictionRuleTest.java
Function name change
* Changes NoNumberContradictionRule
Changes the NoNumber contradiction rule. Now a contradiction occurs when a transition produces a room of white cells without a number. Adds the corresponding tests.
---------
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
.../rules/NoNumberContradictionRule.java | 30 +++++++++----------
.../rules/NoNumbersContradictionRuleTest.java | 19 +++++++++++-
.../NoNumberReachable | 13 ++++++++
3 files changed, 45 insertions(+), 17 deletions(-)
create mode 100644 src/test/resources/puzzles/nurikabe/rules/NoNumberContradictionRule/NoNumberReachable
diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/NoNumberContradictionRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/NoNumberContradictionRule.java
index 0149f0f50..687a6f1ba 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/NoNumberContradictionRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/NoNumberContradictionRule.java
@@ -10,6 +10,7 @@
import edu.rpi.legup.utility.DisjointSets;
import java.util.Set;
+import java.util.List;
public class NoNumberContradictionRule extends ContradictionRule {
@@ -40,25 +41,22 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
if (cell.getType() != NurikabeType.WHITE) {
return super.getInvalidUseOfRuleMessage() + ": " + this.INVALID_USE_MESSAGE;
}
- DisjointSets regions = NurikabeUtilities.getNurikabeRegions(nurikabeBoard);
- Set whiteRegion = regions.getSet(cell);
- for (NurikabeCell c : whiteRegion) {
- if (c.getType() == NurikabeType.NUMBER) {
- return super.getNoContradictionMessage() + ": " + this.NO_CONTRADICTION_MESSAGE;
- }
- }
- for (NurikabeCell c : whiteRegion) {
- // System.out.println(c.getLocation().x + "\t" + c.getLocation().y);
- NurikabeCell top = nurikabeBoard.getCell(c.getLocation().x, c.getLocation().y + 1);
- NurikabeCell left = nurikabeBoard.getCell(c.getLocation().x - 1, c.getLocation().y);
- NurikabeCell right = nurikabeBoard.getCell(c.getLocation().x + 1, c.getLocation().y);
- NurikabeCell bottom = nurikabeBoard.getCell(c.getLocation().x, c.getLocation().y - 1);
- if (isEmptyCell(top) || isEmptyCell(left) || isEmptyCell(right) || isEmptyCell(bottom)) {
- return super.getInvalidUseOfRuleMessage() + ": " + this.NOT_SURROUNDED_BY_BLACK_MESSAGE;
+// If the transition creates a room of white cells with no number, a contradiction occurs.
+ DisjointSets anotherRegion = NurikabeUtilities.getPossibleWhiteRegions(nurikabeBoard);
+ List> allsets = anotherRegion.getAllSets();
+ for (Set s : allsets) {
+ boolean numberExists = false;
+ for (NurikabeCell c : s) {
+ if (c.getType() == NurikabeType.NUMBER) {
+ numberExists = true;
+ }
+ }
+ if(!numberExists) {
+ return null;
}
}
- return null;
+ return super.getNoContradictionMessage() + ": " + this.NO_CONTRADICTION_MESSAGE;
}
/**
diff --git a/src/test/java/puzzles/nurikabe/rules/NoNumbersContradictionRuleTest.java b/src/test/java/puzzles/nurikabe/rules/NoNumbersContradictionRuleTest.java
index 2f13b7ccb..bc7f40d7b 100644
--- a/src/test/java/puzzles/nurikabe/rules/NoNumbersContradictionRuleTest.java
+++ b/src/test/java/puzzles/nurikabe/rules/NoNumbersContradictionRuleTest.java
@@ -26,7 +26,7 @@ public static void setUp() {
}
@Test
- public void TooFewSpacesContradictionRule_TwoSurroundBlackTest() throws InvalidFileFormatException {
+ public void NoNumberContradictionRule_NoNumberSurroundBlack() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/nurikabe/rules/NoNumberContradictionRule/NoNumberSurroundBlack", nurikabe);
TreeNode rootNode = nurikabe.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
@@ -48,4 +48,21 @@ public void TooFewSpacesContradictionRule_TwoSurroundBlackTest() throws InvalidF
}
}
}
+
+// Checks if a transition produces a room without a number.
+ @Test
+ public void NoNumberContradictionRule_NoNumberReachable() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/nurikabe/rules/NoNumberContradictionRule/NoNumberReachable", nurikabe);
+ TreeNode rootNode = nurikabe.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ NurikabeBoard board = (NurikabeBoard) transition.getBoard();
+ for (int i = 0; i < board.getHeight(); i++) {
+ for (int k = 0; k < board.getWidth(); k++) {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, board.getCell(k, i)));
+ }
+ }
+ }
+
}
diff --git a/src/test/resources/puzzles/nurikabe/rules/NoNumberContradictionRule/NoNumberReachable b/src/test/resources/puzzles/nurikabe/rules/NoNumberContradictionRule/NoNumberReachable
new file mode 100644
index 000000000..933a60034
--- /dev/null
+++ b/src/test/resources/puzzles/nurikabe/rules/NoNumberContradictionRule/NoNumberReachable
@@ -0,0 +1,13 @@
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
From 76fb8f9f88f29fa3560b87a3d9eaab88983bcbcd Mon Sep 17 00:00:00 2001
From: Aditya Borkar <96987732+VortiganOfficial@users.noreply.github.com>
Date: Fri, 24 Feb 2023 16:16:58 -0500
Subject: [PATCH 052/148] Changedd the yes/no/cancel options to just yes/no
(#453)
self explanatory
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
src/main/java/edu/rpi/legup/ui/LegupUI.java | 2 +-
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 4 ++--
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index 6eab874b9..74669598a 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -145,7 +145,7 @@ public void showStatus(String status, boolean error, int timer) {
//ask to edu.rpi.legup.save current proof
public boolean noquit(String instr) {
- int n = JOptionPane.showConfirmDialog(null, instr, "Confirm", JOptionPane.YES_NO_CANCEL_OPTION);
+ int n = JOptionPane.showConfirmDialog(null, instr, "Confirm", JOptionPane.YES_NO_OPTION);
return n != JOptionPane.YES_OPTION;
}
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index e2529ae70..2cf0ae3e6 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -229,7 +229,7 @@ public JMenuBar getMenuBar() {
Tree tree = GameBoardFacade.getInstance().getTree();
TreeNode rootNode = tree.getRootNode();
if (rootNode != null) {
- int confirmReset = JOptionPane.showConfirmDialog(this, "Reset Puzzle to Root Node?", "Confirm Reset", JOptionPane.YES_NO_CANCEL_OPTION);
+ int confirmReset = JOptionPane.showConfirmDialog(this, "Reset Puzzle to Root Node?", "Confirm Reset", JOptionPane.YES_NO_OPTION);
if (confirmReset == JOptionPane.YES_OPTION) {
List children = rootNode.getChildren();
children.forEach(t -> puzzle.notifyTreeListeners(l -> l.onTreeElementRemoved(t)));
@@ -553,7 +553,7 @@ private void saveProofChange(){
//ask to edu.rpi.legup.save current proof
public boolean noquit(String instr) {
- int n = JOptionPane.showConfirmDialog(null, instr, "Confirm", JOptionPane.YES_NO_CANCEL_OPTION);
+ int n = JOptionPane.showConfirmDialog(null, instr, "Confirm", JOptionPane.YES_NO_OPTION);
return n != JOptionPane.YES_OPTION;
}
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 865da013e..93e3e620e 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -361,7 +361,7 @@ public void loadPuzzle(String fileName, File puzzleFile) {
}
public boolean noQuit(String instr) {
- int n = JOptionPane.showConfirmDialog(null, instr, "Confirm", JOptionPane.YES_NO_CANCEL_OPTION);
+ int n = JOptionPane.showConfirmDialog(null, instr, "Confirm", JOptionPane.YES_NO_OPTION);
return n != JOptionPane.YES_OPTION;
}
From 9d9e3acb59e1abd6d6b4181dd2398885d8668e0f Mon Sep 17 00:00:00 2001
From: pitbull51067 <103721450+pitbull51067@users.noreply.github.com>
Date: Fri, 24 Feb 2023 16:29:06 -0500
Subject: [PATCH 053/148] Issue #139: Made Tree Tent use TreeTentType (#464)
* Changes to `TreeTent`.
* Changes to `TreeTent`.
---------
Co-authored-by: Ivan Ho <41582274+Corppet@users.noreply.github.com>
---
.../legup/puzzle/treetent/ClueCommand.java | 4 +-
.../legup/puzzle/treetent/TreeTentCell.java | 45 ++++++-------------
.../puzzle/treetent/TreeTentCellFactory.java | 2 +-
.../puzzle/treetent/TreeTentController.java | 8 ++--
.../puzzle/treetent/TreeTentExporter.java | 2 +-
.../puzzle/treetent/TreeTentImporter.java | 6 +--
.../legup/puzzle/treetent/TreeTentType.java | 21 ++++++---
.../treetent/rules/EmptyFieldDirectRule.java | 2 +-
.../treetent/rules/FillinRowCaseRule.java | 4 +-
.../rules/FinishWithGrassDirectRule.java | 2 +-
.../rules/FinishWithTentsDirectRule.java | 2 +-
.../rules/LastCampingSpotDirectRule.java | 2 +-
.../SurroundTentWithGrassDirectRule.java | 2 +-
.../treetent/rules/TentOrGrassCaseRule.java | 4 +-
14 files changed, 48 insertions(+), 58 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java b/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java
index 7ada10a07..30af5af51 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/ClueCommand.java
@@ -70,7 +70,7 @@ public void executeCommand() {
for (TreeTentCell cell : tempList) {
cell = (TreeTentCell) board.getPuzzleElement(cell);
- cell.setData(TreeTentType.GRASS.value);
+ cell.setData(TreeTentType.GRASS);
board.addModifiedData(cell);
finalTran.propagateChange(cell);
@@ -170,7 +170,7 @@ public void undoCommand() {
for (TreeTentCell cell : tempList) {
cell = (TreeTentCell) board.getPuzzleElement(cell);
- cell.setData(TreeTentType.UNKNOWN.value);
+ cell.setData(TreeTentType.UNKNOWN);
board.removeModifiedData(cell);
final TreeTentCell finalCell = cell;
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
index bab45f4ab..290e0858d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
@@ -6,46 +6,27 @@
import java.awt.*;
import java.awt.event.MouseEvent;
-public class TreeTentCell extends GridCell {
+public class TreeTentCell extends GridCell {
- public TreeTentCell(int valueInt, Point location) {
- super(valueInt, location);
+ public TreeTentCell(TreeTentType value, Point location) {
+ super(value, location);
}
public TreeTentType getType() {
- switch (data) {
- case 0:
- return TreeTentType.UNKNOWN;
- case 1:
- return TreeTentType.TREE;
- case 2:
- return TreeTentType.GRASS;
- case 3:
- return TreeTentType.TENT;
- default:
- return null;
- }
+ return data;
}
@Override
public void setType(Element e, MouseEvent m) {
- if (e.getElementName().equals("Unknown Tile")) {
- this.data = 0;
- }
- else {
- if (e.getElementName().equals("Tree Tile")) {
- this.data = 1;
- }
- else {
- if (e.getElementName().equals("Grass Tile")) {
- this.data = 2;
- }
- else {
- if (e.getElementName().equals("Tent Tile")) {
- this.data = 3;
- }
- }
- }
+ switch (e.getElementName()) {
+ case "Unknown Tile":
+ this.data = TreeTentType.UNKNOWN;
+ case "Tree Tile":
+ this.data = TreeTentType.TREE;
+ case "Grass Tile":
+ this.data = TreeTentType.GRASS;
+ case "Tent Tile":
+ this.data = TreeTentType.TENT;
}
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
index 9543c89dc..e5e7603a6 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCellFactory.java
@@ -38,7 +38,7 @@ public PuzzleElement importCell(Node node, Board board) throws InvalidFileFormat
throw new InvalidFileFormatException("TreeTent Factory: cell unknown value");
}
- TreeTentCell cell = new TreeTentCell(value, new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.valueOf(value), new Point(x, y));
cell.setIndex(y * height + x);
return cell;
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java
index 41ec8a854..1a5416c0d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentController.java
@@ -111,11 +111,11 @@ public TreeTentController() {
public void changeCell(MouseEvent e, PuzzleElement element) {
TreeTentCell cell = (TreeTentCell) element;
if (e.getButton() == MouseEvent.BUTTON1) {
- if (cell.getData() == 0) {
+ if (cell.getData() == TreeTentType.UNKNOWN) {
element.setData(2);
}
else {
- if (cell.getData() == 2) {
+ if (cell.getData() == TreeTentType.GRASS) {
element.setData(3);
}
else {
@@ -125,11 +125,11 @@ public void changeCell(MouseEvent e, PuzzleElement element) {
}
else {
if (e.getButton() == MouseEvent.BUTTON3) {
- if (cell.getData() == 0) {
+ if (cell.getData() == TreeTentType.UNKNOWN) {
element.setData(3);
}
else {
- if (cell.getData() == 2) {
+ if (cell.getData() == TreeTentType.GRASS) {
element.setData(0);
}
else {
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java
index 510114e46..828a5ffe0 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentExporter.java
@@ -32,7 +32,7 @@ protected org.w3c.dom.Element createBoardElement(Document newDocument) {
org.w3c.dom.Element cellsElement = newDocument.createElement("cells");
for (PuzzleElement puzzleElement : board.getPuzzleElements()) {
TreeTentCell cell = (TreeTentCell) puzzleElement;
- if (cell.getData() != 0) {
+ if (cell.getData() != TreeTentType.UNKNOWN) {
org.w3c.dom.Element cellElement = puzzle.getFactory().exportCell(newDocument, puzzleElement);
cellsElement.appendChild(cellElement);
}
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 935d8f980..acd094a1b 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentImporter.java
@@ -27,7 +27,7 @@ public void initializeBoard(int rows, int columns) {
for (int y = 0; y < rows; y++) {
for (int x = 0; x < columns; x++) {
if (treeTentBoard.getCell(x, y) == null) {
- TreeTentCell cell = new TreeTentCell(0, new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.UNKNOWN, new Point(x, y));
cell.setIndex(y * columns + x);
cell.setModifiable(true);
treeTentBoard.setCell(x, y, cell);
@@ -88,7 +88,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int i = 0; i < elementDataList.getLength(); i++) {
TreeTentCell cell = (TreeTentCell) puzzle.getFactory().importCell(elementDataList.item(i), treeTentBoard);
Point loc = cell.getLocation();
- if (cell.getData() != 0) {
+ if (cell.getData() != TreeTentType.UNKNOWN) {
cell.setModifiable(false);
cell.setGiven(true);
}
@@ -98,7 +98,7 @@ public void initializeBoard(Node node) throws InvalidFileFormatException {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (treeTentBoard.getCell(x, y) == null) {
- TreeTentCell cell = new TreeTentCell(0, new Point(x, y));
+ TreeTentCell cell = new TreeTentCell(TreeTentType.UNKNOWN, new Point(x, y));
cell.setIndex(y * height + x);
cell.setModifiable(true);
treeTentBoard.setCell(x, y, cell);
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
index 5faa88c59..890cdfe29 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentType.java
@@ -1,12 +1,21 @@
package edu.rpi.legup.puzzle.treetent;
-public enum TreeTentType {
- UNKNOWN(0), TREE(1), GRASS(2), TENT(3),
- CLUE_NORTH(-1), CLUE_EAST(-2), CLUE_SOUTH(-3), CLUE_WEST(-4);
+import edu.rpi.legup.puzzle.masyu.MasyuType;
- public int value;
+public enum TreeTentType {
+ UNKNOWN, TREE, GRASS, TENT,
+ CLUE_NORTH, CLUE_EAST, CLUE_SOUTH, CLUE_WEST;
- TreeTentType(int value) {
- this.value = value;
+ public static TreeTentType valueOf(int num) {
+ switch (num) {
+ case 1:
+ return TREE;
+ case 2:
+ return GRASS;
+ case 3:
+ return TENT;
+ default:
+ return UNKNOWN;
+ }
}
}
\ No newline at end of file
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
index f57602114..bd2642497 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/rules/EmptyFieldDirectRule.java
@@ -72,7 +72,7 @@ public Board getDefaultBoard(TreeNode node) {
for (PuzzleElement element : treeTentBoard.getPuzzleElements()) {
TreeTentCell cell = (TreeTentCell) element;
if (cell.getType() == TreeTentType.UNKNOWN && isForced(treeTentBoard, cell)) {
- cell.setData(TreeTentType.GRASS.value);
+ cell.setData(TreeTentType.GRASS);
treeTentBoard.addModifiedData(cell);
}
}
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 b762c7875..e88e321c4 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
@@ -90,12 +90,12 @@ private ArrayList genCombRecursive(TreeTentBoard iBoard, List getCases(Board board, PuzzleElement puzzleElement) {
ArrayList cases = new ArrayList<>();
Board case1 = board.copy();
PuzzleElement data1 = case1.getPuzzleElement(puzzleElement);
- data1.setData(TreeTentType.TENT.value);
+ data1.setData(TreeTentType.TENT);
case1.addModifiedData(data1);
cases.add(case1);
Board case2 = board.copy();
PuzzleElement data2 = case2.getPuzzleElement(puzzleElement);
- data2.setData(TreeTentType.GRASS.value);
+ data2.setData(TreeTentType.GRASS);
case2.addModifiedData(data2);
cases.add(case2);
From 95c3045fd3e707b232cb55e890825539030fc446 Mon Sep 17 00:00:00 2001
From: Aditya Borkar <96987732+VortiganOfficial@users.noreply.github.com>
Date: Fri, 24 Feb 2023 17:17:12 -0500
Subject: [PATCH 054/148] Changed LEGUP and centered batch grader (#474)
* Changedd the yes/no/cancel options to just yes/no
self explanatory
* Changed LEGUP and button
Capitalised LEGUP in the main menu as well as the app title, and centered the batch grader button
---------
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index c47c8ee23..b06658a2c 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -539,7 +539,7 @@ private void initText() {
// this.text = new JLabel[3];
this.text = new JLabel[2];
- JLabel welcome = new JLabel("Welcome to Legup");
+ JLabel welcome = new JLabel("Welcome to LEGUP");
welcome.setFont(new Font("Roboto", Font.BOLD, 23));
welcome.setAlignmentX(Component.CENTER_ALIGNMENT);
@@ -560,7 +560,7 @@ private void render() {
this.removeAll();
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
- this.legupUI.setTitle("Legup: A Better Way to Learn Formal Logic");
+ this.legupUI.setTitle("LEGUP: A Better Way to Learn Formal Logic");
JPanel buttons = new JPanel();
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
@@ -573,7 +573,7 @@ private void render() {
JPanel batchGraderButton = new JPanel();
batchGraderButton.add(this.buttons[3]);
- batchGraderButton.setAlignmentX(Component.LEFT_ALIGNMENT);
+ batchGraderButton.setAlignmentX(Component.CENTER_ALIGNMENT);
this.add(Box.createRigidArea(new Dimension(0, 5)));
From 2784e01133542da93389726b2c2ff0873b4b502a Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 24 Feb 2023 17:25:26 -0500
Subject: [PATCH 055/148] moved TODO comments inside the showStatus() method to
match the style.
---
src/main/java/edu/rpi/legup/ui/LegupUI.java | 3 +--
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 5 +----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index ed5f01ce5..6eab874b9 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -139,9 +139,8 @@ public void errorEncountered(String error) {
JOptionPane.showMessageDialog(null, error);
}
- // TODO: implement
public void showStatus(String status, boolean error, int timer) {
-
+ // TODO: implement
}
//ask to edu.rpi.legup.save current proof
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 96af5f35c..2fa82c02b 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -964,11 +964,8 @@ private void submit() {
Submission submit = new Submission(board);
}
}
-
-
- // TODO: implement
public void showStatus(String status, boolean error, int timer) {
-
+ // TODO: implement
}
protected void fitTreeViewToScreen() {
From fe5385c986ccf59e6e189e245d1db3739dfcaf52 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 24 Feb 2023 17:40:03 -0500
Subject: [PATCH 056/148] changed the spacing between texts in preferences to
be more consistent
---
src/main/java/edu/rpi/legup/ui/PreferencesDialog.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
index 6eb6b3413..da524a5f0 100644
--- a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
@@ -135,6 +135,7 @@ private JScrollPane createGeneralTab() {
fullScreenRow.add(fullScreen, BorderLayout.WEST);
fullScreenRow.setMaximumSize(new Dimension(Integer.MAX_VALUE, fullScreenRow.getPreferredSize().height));
contentPane.add(fullScreenRow);
+
autoUpdate = new JCheckBox("Automatically Check for Updates", Boolean.valueOf(prefs.getUserPref(LegupPreferences.AUTO_UPDATE)));
autoUpdate.setToolTipText("If checked this automatically checks for updates on startup of Legup");
JPanel autoUpdateRow = new JPanel();
@@ -142,7 +143,7 @@ private JScrollPane createGeneralTab() {
autoUpdateRow.add(autoUpdate, BorderLayout.WEST);
autoUpdateRow.setMaximumSize(new Dimension(Integer.MAX_VALUE, autoUpdateRow.getPreferredSize().height));
contentPane.add(autoUpdateRow);
- contentPane.add(Box.createRigidArea(new Dimension(0, 10)));
+// contentPane.add(Box.createRigidArea(new Dimension(0, 10)));
darkMode = new JCheckBox("Dark Mode", Boolean.valueOf(prefs.getUserPref(LegupPreferences.DARK_MODE)));
darkMode.setToolTipText("This turns dark mode on and off");
@@ -192,6 +193,7 @@ private JScrollPane createGeneralTab() {
generateCasesRow.add(generateCases, BorderLayout.WEST);
generateCasesRow.setMaximumSize(new Dimension(Integer.MAX_VALUE, generateCasesRow.getPreferredSize().height));
contentPane.add(generateCasesRow);
+ contentPane.add(Box.createRigidArea(new Dimension(0, 10)));
immFeedback = new JCheckBox("Provide Immediate Feedback", Boolean.valueOf(prefs.getUserPref(LegupPreferences.IMMEDIATE_FEEDBACK)));
immFeedback.setToolTipText("If checked this will update the colors of the tree view elements immediately");
From 298eaac4ca672523acac60959a8cb0e99ce46465 Mon Sep 17 00:00:00 2001
From: Antonio Orta <60408336+19690ao@users.noreply.github.com>
Date: Tue, 28 Feb 2023 16:11:23 -0500
Subject: [PATCH 057/148] Cancel Load Null Pointer (#480)
* Return on cancel
* Return on cancel comments
---
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 4 ++++
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 2cf0ae3e6..f1042687f 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -403,6 +403,10 @@ public Object[] promptPuzzle() {
public void loadPuzzle() {
Object[] items = promptPuzzle();
+ // Return if items == null (cancel)
+ if (items == null) {
+ return;
+ }
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
loadPuzzle(fileName, puzzleFile);
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 93e3e620e..156bc2405 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -338,6 +338,10 @@ public Object[] promptPuzzle() {
public void loadPuzzle() {
Object[] items = promptPuzzle();
+ // Return if items == null (cancel)
+ if (items == null) {
+ return;
+ }
String fileName = (String) items[0];
File puzzleFile = (File) items[1];
loadPuzzle(fileName, puzzleFile);
From 2becd8a30bd77bad3342ff31ae1cacba9c5a76e0 Mon Sep 17 00:00:00 2001
From: Ivan Ho <41582274+Corppet@users.noreply.github.com>
Date: Tue, 28 Feb 2023 16:51:20 -0500
Subject: [PATCH 058/148] `keyPressed()` `TODO` simplification
Combined multiple `TODO` comments involving the same code block into one.
---
src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
index 2b43b6164..36ffb08aa 100644
--- a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
+++ b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
@@ -66,8 +66,7 @@ public void keyPressed(KeyEvent e) {
String update = "";
if (rule.getRuleType() == RuleType.CASE) {
- // TODO: review this line of code and figure out what it's supposed to do:
- // TODO: remove if necessary
+ // TODO: review this line of code and figure out what it's supposed to do (remove if necessary)
// handleCaseRule((CaseRule)rule);
}
else {
From ffe839392698cf1884c4a683d3c716f82e711afb Mon Sep 17 00:00:00 2001
From: Jun Song <40209659+Acewvrs@users.noreply.github.com>
Date: Tue, 28 Feb 2023 16:53:11 -0500
Subject: [PATCH 059/148] Code Clean up (#472)
* fixed bug that's causing some buttons to remain highlighted after being clicked
* Cleaned up code. removed unused functions and needless code fragments that got commented out. Added TODO comments to indicate functions to implement later on
* moved TODO comments inside the showStatus() method to match the style.
* `keyPressed()` `TODO` simplification
Combined multiple `TODO` comments involving the same code block into one.
---------
Co-authored-by: Ivan Ho <41582274+Corppet@users.noreply.github.com>
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
.../edu/rpi/legup/app/GameBoardFacade.java | 1 -
.../rpi/legup/app/PuzzleKeyAccelerator.java | 1 +
.../java/edu/rpi/legup/ui/DynamicView.java | 1 -
src/main/java/edu/rpi/legup/ui/HomePanel.java | 17 ++--------------
.../java/edu/rpi/legup/ui/PickGameDialog.java | 1 -
.../edu/rpi/legup/ui/ProofEditorPanel.java | 20 +------------------
.../java/edu/rpi/legup/ui/ScrollView.java | 2 --
.../java/edu/rpi/legup/ui/ZoomWidget.java | 2 +-
8 files changed, 5 insertions(+), 40 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
index 72a36efa3..a8a0bce6d 100644
--- a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
+++ b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
@@ -107,7 +107,6 @@ public static void setupConfig() {
public void setPuzzleEditor(Puzzle puzzle) {
this.puzzle = puzzle;
this.puzzleEditor.setPuzzleView(puzzle);
-// this.history.clear();
}
public void setConfig(Config config) {
diff --git a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
index 17d53eab6..36ffb08aa 100644
--- a/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
+++ b/src/main/java/edu/rpi/legup/app/PuzzleKeyAccelerator.java
@@ -66,6 +66,7 @@ public void keyPressed(KeyEvent e) {
String update = "";
if (rule.getRuleType() == RuleType.CASE) {
+ // TODO: review this line of code and figure out what it's supposed to do (remove if necessary)
// handleCaseRule((CaseRule)rule);
}
else {
diff --git a/src/main/java/edu/rpi/legup/ui/DynamicView.java b/src/main/java/edu/rpi/legup/ui/DynamicView.java
index 3290bde5b..038f87d23 100644
--- a/src/main/java/edu/rpi/legup/ui/DynamicView.java
+++ b/src/main/java/edu/rpi/legup/ui/DynamicView.java
@@ -203,7 +203,6 @@ public void resetStatus() {
}
public void reset() {
- // System.out.println("get into the reset");
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
Board board1 = GameBoardFacade.getInstance().getBoard();
board1.setModifiable(true);
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index b06658a2c..5d6fd3766 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -164,7 +164,6 @@ private void initButtons() {
this.buttons[2].addActionListener(CursorController.createListener(this, openPuzzleListener)); // PLACEHOLDER
for (int i = 0; i < this.buttons.length - 1; i++) { // -1 to avoid the batch grader button
- //this.buttons[i].setPreferredSize(new Dimension(100, 100));
this.buttons[i].setBounds(200, 200, 700, 700);
}
this.buttons[3] = new JButton("Batch Grader");
@@ -175,18 +174,12 @@ private void initButtons() {
this.buttons[3].addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
-// ProofEditorPanel panel=new ProofEditorPanel(new FileDialog(new Frame()),new JFrame(), legupUI);
-// //legupUI.setVisible(false);
-// panel.checkProofAll();
- //checkfolder();
-
try {
use_xml_to_check();
}
catch (Exception ex) {
throw new RuntimeException(ex);
}
- //checkallproof1();
System.out.println("finished checking the folder");
}
@@ -226,8 +219,6 @@ public void checkfolder(){
writer.append(",");
writer.append("Solved or not");
writer.append("\n");
- //csvWriter.flush();
- //csvWriter.close();
for (final File folderEntry : folder.listFiles(File::isDirectory)) {
writer.append(folderEntry.getName());
@@ -317,7 +308,7 @@ public void use_xml_to_check() throws Exception{
File resultFile = new File(folder.getAbsolutePath() + File.separator +"result.csv");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser saxParser = spf.newSAXParser();
-// String path = "C:\\Users\\LiWeiJun\\Desktop\\TestSet\\TestSet\\roseh";
+
//read the xml file
try (BufferedWriter writer = new BufferedWriter(new FileWriter(resultFile))) {
writer.write("Name");
@@ -533,10 +524,7 @@ public void traverseDir1(File folder, BufferedWriter writer, String path) throws
}
}
private void initText() {
- // Note: until an auto-changing version label is implemented in the future, I removed
- // the version text from the home screen to avoid confusion
-
- // this.text = new JLabel[3];
+ // TODO: add version text after auto-changing version label is implemented. (text[2] = version)
this.text = new JLabel[2];
JLabel welcome = new JLabel("Welcome to LEGUP");
@@ -553,7 +541,6 @@ private void initText() {
this.text[0] = welcome;
this.text[1] = credits;
- // this.text[2] = version;
}
private void render() {
diff --git a/src/main/java/edu/rpi/legup/ui/PickGameDialog.java b/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
index 1822efda6..24fc4602f 100644
--- a/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
@@ -126,7 +126,6 @@ public void initPuzzles() {
puzzles = new String[games.length][];
puzzleBox = new JTextField();
for (int x = 0; x < games.length; ++x) {
- // o = GameBoardFacade.getInstance().getConfig().getBoardsForPuzzle(games[x]).toArray();
puzzles[x] = new String[o.length];
for (int y = 0; y < o.length; ++y) {
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index f1042687f..5ab4a8e1c 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -117,7 +117,7 @@ public JMenuBar getMenuBar() {
file = new JMenu("File");
newPuzzle = new JMenuItem("Open");
resetPuzzle = new JMenuItem("Reset Puzzle");
-// genPuzzle = new JMenuItem("Puzzle Generators");
+// genPuzzle = new JMenuItem("Puzzle Generators"); // TODO: implement puzzle generator
saveProofAs = new JMenuItem("Save Proof As"); // create a new file to save
saveProofChange = new JMenuItem("Save Proof Change"); // save to the current file
preferences = new JMenuItem("Preferences");
@@ -203,9 +203,6 @@ public JMenuBar getMenuBar() {
helpLegup = new JMenuItem("Help Legup");
aboutLegup = new JMenuItem("About Legup");
- // unused
- // help = new JMenu("Help");
-
mBar.add(file);
file.add(newPuzzle);
newPuzzle.addActionListener((ActionEvent) -> promptPuzzle());
@@ -216,12 +213,6 @@ public JMenuBar getMenuBar() {
newPuzzle.setAccelerator(KeyStroke.getKeyStroke('N', InputEvent.CTRL_DOWN_MASK));
}
-// file.add(genPuzzle);
-//// genPuzzle.addActionListener((ActionEvent) ->
-//// {
-//// pickGameDialog = new PickGameDialog(this, true);
-//// pickGameDialog.setVisible(true);
-//// });
file.add(resetPuzzle);
resetPuzzle.addActionListener(a -> {
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
@@ -977,15 +968,6 @@ private void submit() {
Submission submit = new Submission(board);
}
}
-
- private void directions() {
- JOptionPane.showMessageDialog(null, "For every move you make, you must provide a rule for it (located in the Rules panel).\n" + "While working on the edu.rpi.legup.puzzle, you may click on the \"Check\" button to test your proof for correctness.", "Directions", JOptionPane.PLAIN_MESSAGE);
- }
-
- public void errorEncountered(String error) {
- JOptionPane.showMessageDialog(null, error);
- }
-
public void showStatus(String status, boolean error, int timer) {
// TODO: implement
}
diff --git a/src/main/java/edu/rpi/legup/ui/ScrollView.java b/src/main/java/edu/rpi/legup/ui/ScrollView.java
index bc638ee7e..d49f9207c 100644
--- a/src/main/java/edu/rpi/legup/ui/ScrollView.java
+++ b/src/main/java/edu/rpi/legup/ui/ScrollView.java
@@ -170,8 +170,6 @@ public void zoom(int n, Point point) {
}
public void zoomTo(double newScale) {
- //System.out.println("Zooming to " + newScale);
-
// check zoom bounds
if (newScale < minScale) {
newScale = minScale;
diff --git a/src/main/java/edu/rpi/legup/ui/ZoomWidget.java b/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
index c183df86c..1e423c346 100644
--- a/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
+++ b/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
@@ -18,7 +18,7 @@ public class ZoomWidget extends JLabel {
private MouseAdapter open = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
palette.slider.setValue(parent.getZoom());
- palette.show(e.getComponent(), 0, 0);//e.getX(), e.getY() );
+ palette.show(e.getComponent(), 0, 0);
}
};
From acedfd9bff76a6d3a3dc5cba3afbaa2885da5c92 Mon Sep 17 00:00:00 2001
From: rspacerr
Date: Tue, 28 Feb 2023 17:00:19 -0500
Subject: [PATCH 060/148] fixed corner bug
---
.../rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
index 6915d8177..55316fcbb 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
@@ -46,7 +46,7 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
for (int i = -1; i < 2; i += 2) {
for (int j = -1; j < 2; j += 2) {
// If the corner does not exist, skip the corner
- if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.x + i < board.getHeight())) {
+ if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.y + j < board.getHeight())) {
continue;
}
From ce422bbd707d7fc3993ced782de30f0cdd1ef1a7 Mon Sep 17 00:00:00 2001
From: rspacerr
Date: Tue, 28 Feb 2023 17:02:16 -0500
Subject: [PATCH 061/148] Revert "fixed corner bug"
This reverts commit acedfd9bff76a6d3a3dc5cba3afbaa2885da5c92.
---
.../rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
index 55316fcbb..6915d8177 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
@@ -46,7 +46,7 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
for (int i = -1; i < 2; i += 2) {
for (int j = -1; j < 2; j += 2) {
// If the corner does not exist, skip the corner
- if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.y + j < board.getHeight())) {
+ if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.x + i < board.getHeight())) {
continue;
}
From 257c6120c0a791f91a41de699d7dddbf239406ce Mon Sep 17 00:00:00 2001
From: rspacerr
Date: Tue, 28 Feb 2023 17:07:06 -0500
Subject: [PATCH 062/148] fixed corner bug
---
.../rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
index 6915d8177..55316fcbb 100644
--- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/CornerBlackDirectRule.java
@@ -46,7 +46,7 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
for (int i = -1; i < 2; i += 2) {
for (int j = -1; j < 2; j += 2) {
// If the corner does not exist, skip the corner
- if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.x + i < board.getHeight())) {
+ if (!(cellLocation.x + i >= 0 && cellLocation.x + i < board.getWidth() && cellLocation.y + j >= 0 && cellLocation.y + j < board.getHeight())) {
continue;
}
From b3485387496e22aa554e42e41f95e8079854b905 Mon Sep 17 00:00:00 2001
From: Aditya Borkar <96987732+VortiganOfficial@users.noreply.github.com>
Date: Fri, 3 Mar 2023 16:12:28 -0500
Subject: [PATCH 063/148] Fixed the nullpointer exception when cancelling batch
grader (#481)
* Changedd the yes/no/cancel options to just yes/no
self explanatory
* Changed LEGUP and button
Capitalised LEGUP in the main menu as well as the app title, and centered the batch grader button
* Fixed nullpointerexception when batch grader cancel is clicked
self explanatory, to fix this i just put return if null statements everywhere
* Fixed checkstyle errors
---------
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
src/main/java/edu/rpi/legup/ui/HomePanel.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index 5d6fd3766..ebcada652 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -294,8 +294,13 @@ public void use_xml_to_check() throws Exception{
LegupPreferences preferences = LegupPreferences.getInstance();
File preferredDirectory = new File(preferences.getUserPref(LegupPreferences.WORK_DIRECTORY));
+ if (preferredDirectory == null) {
+ return;
+ }
JFileChooser folderBrowser = new JFileChooser(preferredDirectory);
-
+ if (folderBrowser == null) {
+ return;
+ }
folderBrowser.setCurrentDirectory(new File(LegupPreferences.WORK_DIRECTORY));
folderBrowser.setDialogTitle("Select Directory");
@@ -304,8 +309,13 @@ public void use_xml_to_check() throws Exception{
folderBrowser.showOpenDialog(this);
folderBrowser.setVisible(true);
File folder = folderBrowser.getSelectedFile();
-
+ if (folder == null) {
+ return;
+ }
File resultFile = new File(folder.getAbsolutePath() + File.separator +"result.csv");
+ if (resultFile == null) {
+ return;
+ }
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser saxParser = spf.newSAXParser();
From 4b08cc9fcc205b3ef02ded61307a6a786e9c2767 Mon Sep 17 00:00:00 2001
From: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Date: Fri, 3 Mar 2023 16:14:19 -0500
Subject: [PATCH 064/148] Update LightUp.java (#488)
Co-authored-by: Ivan Ho <41582274+Corppet@users.noreply.github.com>
---
src/main/java/edu/rpi/legup/puzzle/lightup/LightUp.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/puzzle/lightup/LightUp.java b/src/main/java/edu/rpi/legup/puzzle/lightup/LightUp.java
index b0ef17b65..6a67d28ca 100644
--- a/src/main/java/edu/rpi/legup/puzzle/lightup/LightUp.java
+++ b/src/main/java/edu/rpi/legup/puzzle/lightup/LightUp.java
@@ -25,6 +25,8 @@ public LightUp() {
@Override
public void initializeView() {
boardView = new LightUpView((LightUpBoard) currentBoard);
+ boardView.setBoard(currentBoard);
+ addBoardListener(boardView);
}
/**
From 58c172c6a6fa31d45519ba7b3881cd75c7c4e742 Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Fri, 3 Mar 2023 17:02:38 -0500
Subject: [PATCH 065/148] These 2 lines fix at least 2 issues. This was much
more annoying to figure out.
---
src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java | 2 +-
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 5ab4a8e1c..0dfa8bcd5 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -205,7 +205,7 @@ public JMenuBar getMenuBar() {
mBar.add(file);
file.add(newPuzzle);
- newPuzzle.addActionListener((ActionEvent) -> promptPuzzle());
+ newPuzzle.addActionListener((ActionEvent) -> loadPuzzle());
if (os.equals("mac")) {
newPuzzle.setAccelerator(KeyStroke.getKeyStroke('N', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
}
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 156bc2405..3b74b8bcf 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -104,7 +104,7 @@ public void setMenuBar() {
// file>new
JMenuItem newPuzzle = new JMenuItem("New");
- newPuzzle.addActionListener((ActionEvent) -> promptPuzzle());
+ newPuzzle.addActionListener((ActionEvent) -> loadPuzzle());
if (os.equals("mac")) {
newPuzzle.setAccelerator(KeyStroke.getKeyStroke('N', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
}
From 1bd19ab789906647be30a397390dfd31e3c88018 Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Mon, 6 Mar 2023 15:37:39 -0500
Subject: [PATCH 066/148] Too Few Bulbs Changes
Doesnt pass but after more research on specifics of the rule, it should be the right structure and a good example.
---
bin/main/edu/rpi/legup/legup/config | 2 +-
.../TooFewBulbsContradictionRuleTest.java | 34 ++++++++++++++++++-
.../BulbsAroundBlackTile | 15 ++++++++
3 files changed, 49 insertions(+), 2 deletions(-)
create mode 100644 src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/BulbsAroundBlackTile
diff --git a/bin/main/edu/rpi/legup/legup/config b/bin/main/edu/rpi/legup/legup/config
index 8e3b4b84c..bb7da871a 100644
--- a/bin/main/edu/rpi/legup/legup/config
+++ b/bin/main/edu/rpi/legup/legup/config
@@ -15,7 +15,7 @@
+ fileCreationDisabled="false"/>
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
From 669262f4570398843a5c84e1b656e56bdd773750 Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Tue, 7 Mar 2023 15:24:48 -0500
Subject: [PATCH 067/148] Created two example files
---
.../{BulbsAroundBlackTile => TooFew} | 7 ++++---
.../TooManyBulbsContradictionRule/TooMany | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 3 deletions(-)
rename src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/{BulbsAroundBlackTile => TooFew} (66%)
create mode 100644 src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany
diff --git a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/BulbsAroundBlackTile b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
similarity index 66%
rename from src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/BulbsAroundBlackTile
rename to src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
index 249cbe13c..6cdad3ae6 100644
--- a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/BulbsAroundBlackTile
+++ b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
@@ -1,14 +1,15 @@
-
+
|
|
|
|
+ |
|
- |
- |
+ |
+ |
diff --git a/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany b/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany
new file mode 100644
index 000000000..6f96f7e8f
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany
@@ -0,0 +1,18 @@
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
From 00d6cc71327376d9bba3816c9784f238ad49fec7 Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Wed, 8 Mar 2023 12:11:25 -0500
Subject: [PATCH 068/148] Finished too few bulbs
There was a requirement that no squares be gray because that invites the potential for bulbs to be there and satisfy the black tile instead of having a too few bulbs contradiction.
---
.../lightup/rules/TooFewBulbsContradictionRuleTest.java | 5 +----
.../lightup/rules/TooFewBulbsContradictionRule/TooFew | 4 +++-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
index edacb47ce..2b5adfa88 100644
--- a/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
@@ -27,7 +27,7 @@ public static void setUp() {
@Test
public void TooFewBulbsContradictionRule_LightInHorizontalPath() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/lightup/rules/TooFewBulbsContradictionRule/BulbsAroundBlackTile", lightUp);
+ TestUtilities.importTestBoard("puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
@@ -44,8 +44,5 @@ public void TooFewBulbsContradictionRule_LightInHorizontalPath() throws InvalidF
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(4, 4)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(5, 5)));
-
- //intentional failure for sanity check
- //Assert.assertEquals(2, 3);
}
}
diff --git a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
index 6cdad3ae6..ca735a340 100644
--- a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
+++ b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
@@ -6,7 +6,9 @@
|
|
|
- |
+ |
+ |
+ |
|
|
|
From e3629367b96910cd6895d655d1d969f9084b3bf5 Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Wed, 8 Mar 2023 21:28:44 -0500
Subject: [PATCH 069/148] Cannot Light a Cell Contradiction
---
.../BulbsInPathContradictionRuleTest.java | 2 +
...CannotLightACellContradictionRuleTest.java | 37 +++++++++++++++++--
.../rules/EmptyCellinLightBasicRuleTest.java | 26 ++++++++++++-
.../TooFewBulbsContradictionRuleTest.java | 3 +-
.../TooManyBulbsContradictionRuleTest.java | 31 +++++++++++++++-
.../CannotLightACell | 18 +++++++++
.../EmptyCellinLight | 18 +++++++++
7 files changed, 128 insertions(+), 7 deletions(-)
create mode 100644 src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell
create mode 100644 src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight
diff --git a/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java
index 3b1748abb..a9d24d497 100644
--- a/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java
@@ -34,6 +34,7 @@ public void BulbsInPathContradictionRule_LightInHorizontalPath() throws InvalidF
transition.setRule(RULE);
LightUpBoard board = (LightUpBoard) transition.getBoard();
+ //confirm there is a contradiction somewhere on the board
Assert.assertNull(RULE.checkContradiction(board));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(2, 0)));
@@ -49,6 +50,7 @@ public void BulbsInPathContradictionRule_LightInVerticalPath() throws InvalidFil
transition.setRule(RULE);
LightUpBoard board = (LightUpBoard) transition.getBoard();
+ //confirm there is a contradiction somewhere on the board
Assert.assertNull(RULE.checkContradiction(board));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(0, 2)));
diff --git a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
index 260a62c9c..27818a1b8 100644
--- a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
@@ -1,19 +1,50 @@
package puzzles.lightup.rules;
+import edu.rpi.legup.puzzle.lightup.LightUpBoard;
+import legup.MockGameBoardFacade;
+import legup.TestUtilities;
+import edu.rpi.legup.model.PuzzleImporter;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import org.junit.Assert;
+import edu.rpi.legup.puzzle.lightup.LightUp;
+import edu.rpi.legup.puzzle.lightup.rules.CannotLightACellContradictionRule;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
import org.junit.BeforeClass;
import org.junit.Test;
-import edu.rpi.legup.puzzle.lightup.LightUp;
public class CannotLightACellContradictionRuleTest {
+ private static final CannotLightACellContradictionRule RULE = new CannotLightACellContradictionRule();
private static LightUp lightUp;
+ private static PuzzleImporter importer;
@BeforeClass
public static void setUp() {
+ MockGameBoardFacade.getInstance();
lightUp = new LightUp();
+ importer = lightUp.getImporter();
}
- @Test
- public void simpleCaseTest() {
+ @Test
+ public void CannotLightaCellContradictionRule() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+ //confirm there is a contradiction somewhere on the board
+ Assert.assertNull(RULE.checkContradiction(board));
+ //confirm it is impossible to light up these squares
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 3)));
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(3, 3)));
+
+ //confirm these are not required to be lit because they are already lit or unable to be
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 2)));
}
}
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
index 5cea77d8f..2b91a5f98 100644
--- a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
@@ -3,17 +3,41 @@
import org.junit.BeforeClass;
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
+import edu.rpi.legup.puzzle.lightup.rules.EmptyCellinLightBasicRule;
+import edu.rpi.legup.model.PuzzleImporter;
+import legup.MockGameBoardFacade;
+import edu.rpi.legup.save.InvalidFileFormatException;
+import legup.TestUtilities;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.lightup.LightUpBoard;
+import edu.rpi.legup.model.gameboard.PuzzleElement;
+import java.util.*;
+import org.junit.Assert;
public class EmptyCellinLightBasicRuleTest {
+ private static final EmptyCellinLightBasicRule RULE = new EmptyCellinLightBasicRule();
private static LightUp lightUp;
+ private static PuzzleImporter importer;
@BeforeClass
public static void setUp() {
+ MockGameBoardFacade.getInstance();
lightUp = new LightUp();
+ importer = lightUp.getImporter();
}
@Test
- public void simpleCaseTest() {
+ public void EmptyCellinLightBasicRule() throws InvalidFileFormatException{
+ TestUtilities.importTestBoard("puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+ Set data = board.getModifiedData();
+
+ Assert.assertNull(RULE.checkRule(transition));
}
}
diff --git a/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
index 2b5adfa88..e22e21cf8 100644
--- a/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
@@ -26,13 +26,14 @@ public static void setUp() {
}
@Test
- public void TooFewBulbsContradictionRule_LightInHorizontalPath() throws InvalidFileFormatException {
+ public void TooFewBulbsContradictionRule() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
LightUpBoard board = (LightUpBoard) transition.getBoard();
+ //confirm there is a contradiction somewhere on the board
Assert.assertNull(RULE.checkContradiction(board));
//confirm that there arent enough bulbs around the black tiles
diff --git a/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java
index ac4c49520..b1de334dc 100644
--- a/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java
@@ -3,17 +3,44 @@
import org.junit.BeforeClass;
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
+import edu.rpi.legup.puzzle.lightup.rules.TooManyBulbsContradictionRule;
+import edu.rpi.legup.model.PuzzleImporter;
+import legup.MockGameBoardFacade;
+import edu.rpi.legup.save.InvalidFileFormatException;
+import legup.TestUtilities;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.lightup.LightUpBoard;
+import org.junit.Assert;
public class TooManyBulbsContradictionRuleTest {
+ private static final TooManyBulbsContradictionRule RULE = new TooManyBulbsContradictionRule();
private static LightUp lightUp;
+ private static PuzzleImporter importer;
@BeforeClass
public static void setUp() {
+ MockGameBoardFacade.getInstance();
lightUp = new LightUp();
+ importer = lightUp.getImporter();
}
-
@Test
- public void simpleCaseTest() {
+ public void TooFewBulbsContradictionRule() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+ //confirm there is a contradiction somewhere on the board
+ Assert.assertNull(RULE.checkContradiction(board));
+
+ //confirm that there are too many bulbs around the black tiles
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 4)));
+ //confirm there are no requirements for number of bulbs around non-black tiles or 0 tiles
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(5, 5)));
}
}
diff --git a/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell b/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell
new file mode 100644
index 000000000..62e8b32f8
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell
@@ -0,0 +1,18 @@
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight b/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight
new file mode 100644
index 000000000..62e8b32f8
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight
@@ -0,0 +1,18 @@
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
From e427f2108cf06335e55425f159eb632a4d78177b Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 17 Mar 2023 14:34:33 -0400
Subject: [PATCH 070/148] set test points to make sure the STT files are loaded
in correctly
---
src/main/java/edu/rpi/legup/model/PuzzleImporter.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
index b72beac68..48c3c26a4 100644
--- a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
+++ b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
@@ -181,6 +181,9 @@ protected void createTree(Node node) throws InvalidFileFormatException {
HashMap treeTransitions = new HashMap<>();
HashMap nodeChanges = new HashMap<>();
+ System.out.println("test1");
+ System.out.print(nodeList.getLength());
+ System.out.println("test2");
for (int i = 0; i < nodeList.getLength(); i++) {
org.w3c.dom.Element treeNodeElement = (org.w3c.dom.Element) nodeList.item(i);
String nodeId = treeNodeElement.getAttribute("id");
From 3067af6cf00fb2f2afbe42079bde4d6b294b8d84 Mon Sep 17 00:00:00 2001
From: Jun
Date: Fri, 17 Mar 2023 16:14:56 -0400
Subject: [PATCH 071/148] testing transitions
---
src/main/java/edu/rpi/legup/app/GameBoardFacade.java | 2 ++
src/main/java/edu/rpi/legup/model/PuzzleImporter.java | 4 +---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
index a8a0bce6d..bb00130f9 100644
--- a/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
+++ b/src/main/java/edu/rpi/legup/app/GameBoardFacade.java
@@ -304,7 +304,9 @@ public void loadPuzzle(InputStream inputStream) throws InvalidFileFormatExceptio
LOGGER.error("Puzzle importer is null");
throw new InvalidFileFormatException("Puzzle importer null");
}
+
importer.initializePuzzle(node);
+ // System.out.println("test1");
puzzle.initializeView();
puzzle.getBoardView().onTreeElementChanged(puzzle.getTree().getRootNode());
setPuzzle(puzzle);
diff --git a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
index 48c3c26a4..b1faa55b3 100644
--- a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
+++ b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
@@ -181,9 +181,6 @@ protected void createTree(Node node) throws InvalidFileFormatException {
HashMap treeTransitions = new HashMap<>();
HashMap nodeChanges = new HashMap<>();
- System.out.println("test1");
- System.out.print(nodeList.getLength());
- System.out.println("test2");
for (int i = 0; i < nodeList.getLength(); i++) {
org.w3c.dom.Element treeNodeElement = (org.w3c.dom.Element) nodeList.item(i);
String nodeId = treeNodeElement.getAttribute("id");
@@ -213,6 +210,7 @@ protected void createTree(Node node) throws InvalidFileFormatException {
NodeList transList = treeNodeElement.getElementsByTagName("transition");
for (int k = 0; k < transList.getLength(); k++) {
+ System.out.println("transition "+ k+ " for node "+ i+ "\n");
org.w3c.dom.Element trans = (org.w3c.dom.Element) transList.item(k);
String transId = trans.getAttribute("id");
TreeTransition transition = treeTransitions.get(transId);
From 187096b0ac2826900dcbcbfc5760b8d845d52149 Mon Sep 17 00:00:00 2001
From: 25tallurich <93100501+25tallurich@users.noreply.github.com>
Date: Fri, 17 Mar 2023 16:48:55 -0400
Subject: [PATCH 072/148] Logo (#498)
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
.../rpi/legup/images/Legup/Legup_new_logo.svg | 66 +++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 src/main/resources/edu/rpi/legup/images/Legup/Legup_new_logo.svg
diff --git a/src/main/resources/edu/rpi/legup/images/Legup/Legup_new_logo.svg b/src/main/resources/edu/rpi/legup/images/Legup/Legup_new_logo.svg
new file mode 100644
index 000000000..ec4357d74
--- /dev/null
+++ b/src/main/resources/edu/rpi/legup/images/Legup/Legup_new_logo.svg
@@ -0,0 +1,66 @@
+
+
From 79c223d27dcd72a81607ba9725f8c1a73159036b Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Sat, 18 Mar 2023 12:56:42 -0400
Subject: [PATCH 073/148] Added simple tests instead of all complex
---
...CannotLightACellContradictionRuleTest.java | 30 +++++++++++++++++--
.../TooFewBulbsContradictionRuleTest.java | 24 ++++++++++++++-
.../TooManyBulbsContradictionRuleTest.java | 26 +++++++++++++++-
.../CannotLight | 11 +++++++
.../{CannotLightACell => FullLightTest} | 0
.../FullTooFewTest | 18 +++++++++++
.../rules/TooFewBulbsContradictionRule/TooFew | 15 +++-------
.../FullTooManyTest | 18 +++++++++++
.../TooManyBulbsContradictionRule/TooMany | 13 +++-----
9 files changed, 131 insertions(+), 24 deletions(-)
create mode 100644 src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight
rename src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/{CannotLightACell => FullLightTest} (100%)
create mode 100644 src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/FullTooFewTest
create mode 100644 src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/FullTooManyTest
diff --git a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
index 27818a1b8..f1dd25a13 100644
--- a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
@@ -27,8 +27,9 @@ public static void setUp() {
}
@Test
- public void CannotLightaCellContradictionRule() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell", lightUp);
+ //extensive full testing of null and non-null in a 5x5 board
+ public void FullLightTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/FullLightTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
@@ -47,4 +48,29 @@ public void CannotLightaCellContradictionRule() throws InvalidFileFormatExceptio
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 2)));
}
+
+ @Test
+ //simple contradiction testing for null and non-null in a 3x3 board
+ public void CannotLightMiddle() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+ //confirm there is a contradiction somewhere on the board
+ Assert.assertNull(RULE.checkContradiction(board));
+
+ //confirm it is impossible to light up the center square
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
+
+ //every square except the center
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 1)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 2)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 2)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 1)));
+ }
}
diff --git a/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
index e22e21cf8..5325a6901 100644
--- a/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/TooFewBulbsContradictionRuleTest.java
@@ -27,7 +27,7 @@ public static void setUp() {
@Test
public void TooFewBulbsContradictionRule() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew", lightUp);
+ TestUtilities.importTestBoard("puzzles/lightup/rules/TooFewBulbsContradictionRule/FullTooFewTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
@@ -46,4 +46,26 @@ public void TooFewBulbsContradictionRule() throws InvalidFileFormatException {
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(4, 4)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(5, 5)));
}
+
+ @Test
+ public void TooFewSimpleTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+
+ //confirm it is impossible to satisfy up the center square
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
+
+ //every square except the center
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 1)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 2)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 2)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 1)));
+ }
}
diff --git a/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java
index b1de334dc..cd5988897 100644
--- a/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/TooManyBulbsContradictionRuleTest.java
@@ -25,8 +25,9 @@ public static void setUp() {
importer = lightUp.getImporter();
}
@Test
+ //complex extensive toofew test
public void TooFewBulbsContradictionRule() throws InvalidFileFormatException {
- TestUtilities.importTestBoard("puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany", lightUp);
+ TestUtilities.importTestBoard("puzzles/lightup/rules/TooManyBulbsContradictionRule/FullTooManyTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
@@ -43,4 +44,27 @@ public void TooFewBulbsContradictionRule() throws InvalidFileFormatException {
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(5, 5)));
}
+
+ @Test
+ //tests a 3x3 board with a 3 in the center and 4 surrounding lightbulbs
+ public void TooManySimpleTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+
+ //confirm it is impossible to satisfy up the center square
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
+
+ //every square except the center
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 1)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 2)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 2)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 1)));
+ }
}
diff --git a/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight b/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight
new file mode 100644
index 000000000..bfadbcf7f
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight
@@ -0,0 +1,11 @@
+
+
+
+
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell b/src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/FullLightTest
similarity index 100%
rename from src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLightACell
rename to src/test/resources/puzzles/lightup/rules/CannotLightACellContradictionRule/FullLightTest
diff --git a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/FullTooFewTest b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/FullTooFewTest
new file mode 100644
index 000000000..ca735a340
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/FullTooFewTest
@@ -0,0 +1,18 @@
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
index ca735a340..0a78cf1d4 100644
--- a/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
+++ b/src/test/resources/puzzles/lightup/rules/TooFewBulbsContradictionRule/TooFew
@@ -1,17 +1,10 @@
-
+
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ |
+ |
+ |
diff --git a/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/FullTooManyTest b/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/FullTooManyTest
new file mode 100644
index 000000000..6f96f7e8f
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/FullTooManyTest
@@ -0,0 +1,18 @@
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany b/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany
index 6f96f7e8f..f5ffde798 100644
--- a/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany
+++ b/src/test/resources/puzzles/lightup/rules/TooManyBulbsContradictionRule/TooMany
@@ -1,17 +1,12 @@
-
+
- |
- |
- |
+ |
|
- |
|
- |
- |
- |
- |
+ |
+ |
From fef0f81e66c568e2798b04a59ae90ec34d6698cf Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Sat, 18 Mar 2023 14:03:40 -0400
Subject: [PATCH 074/148] Working Basic EmptyCellsinLight Test
---
.../rules/EmptyCellinLightBasicRuleTest.java | 54 ++++++++++++++++---
.../EmptyCellinLightBasicRule/EmptyCells | 11 ++++
2 files changed, 59 insertions(+), 6 deletions(-)
create mode 100644 src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCells
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
index 2b91a5f98..a84cab998 100644
--- a/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/EmptyCellinLightBasicRuleTest.java
@@ -11,8 +11,8 @@
import edu.rpi.legup.model.tree.TreeNode;
import edu.rpi.legup.model.tree.TreeTransition;
import edu.rpi.legup.puzzle.lightup.LightUpBoard;
-import edu.rpi.legup.model.gameboard.PuzzleElement;
-import java.util.*;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
import org.junit.Assert;
public class EmptyCellinLightBasicRuleTest {
@@ -28,16 +28,58 @@ public static void setUp() {
}
@Test
+ //tests a 3x3 board with with a 0 black tile in the center and lightbulbs in top left and bototm right
+ //confirms the rest of the tiles must be empty
public void EmptyCellinLightBasicRule() throws InvalidFileFormatException{
- TestUtilities.importTestBoard("puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight", lightUp);
+ TestUtilities.importTestBoard("puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCells", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
-
- LightUpBoard board = (LightUpBoard) transition.getBoard();
- Set data = board.getModifiedData();
+ //get board state
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+
+ //change the board's cells considering the emptycellinlight rule
+ LightUpCell cell2 = board.getCell(1,0);
+ cell2.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell2);
+
+ LightUpCell cell3 = board.getCell(0,1);
+ cell3.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell3);
+
+ LightUpCell cell4 = board.getCell(2,0);
+ cell4.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell4);
+
+ LightUpCell cell5 = board.getCell(0,2);
+ cell5.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell5);
+
+ LightUpCell cell6 = board.getCell(1,2);
+ cell6.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell6);
+
+ LightUpCell cell7 = board.getCell(2,1);
+ cell7.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell7);
+
+ //confirm there is a logical following of the EmptyCellinLight rule
Assert.assertNull(RULE.checkRule(transition));
+ //cells (0,0) and (2,2) are not empty because they have lightbulbs, and (1,1)
+ //because it is a black tile. Confirm the rest are empty
+ LightUpCell c;
+ for (int i = 0; i < board.getHeight(); i++) {
+ for (int j = 0; j < board.getWidth(); j++) {
+ c = board.getCell(j, i);
+ if ((i == 0 && j == 0) || (i == 2 && j == 2) || (i == 1 && j == 1)){
+ Assert.assertNotNull(RULE.checkRuleAt(transition, c));
+ }
+ else {
+ Assert.assertNull(RULE.checkRuleAt(transition, c));
+ }
+ }
+ }
}
}
diff --git a/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCells b/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCells
new file mode 100644
index 000000000..feca5b861
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCells
@@ -0,0 +1,11 @@
+
+
+
+
+ |
+ |
+ |
+
+
+
+
\ No newline at end of file
From 9e7a15a424624fe4e6a127cd2a6ab714343b8219 Mon Sep 17 00:00:00 2001
From: 19690ao
Date: Sat, 18 Mar 2023 17:37:24 -0400
Subject: [PATCH 075/148] Revert Commit
847af1b129d0c244148315beca7427e8f432a35c
---
src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index c8f5e24f5..f974c6eae 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -386,8 +386,8 @@ public void onRedo(boolean isBottom, boolean isTop) {
@Override
public void onClearHistory() {
- undo.setEnabled(false);
- redo.setEnabled(false);
+ //undo.setEnabled(false);
+ //redo.setEnabled(false);
}
public BoardView getBoardView() {
From 712af0a71382394dea4aa292d7398b6514f51029 Mon Sep 17 00:00:00 2001
From: Jun
Date: Sun, 19 Mar 2023 17:22:09 -0400
Subject: [PATCH 076/148] added a test case, BlockInVerticalPath for LightUp
that tests there isn't a contradiction if there is a block between two bulbs.
---
.../java/edu/rpi/legup/model/PuzzleImporter.java | 1 -
.../rules/BulbsInPathContradictionRuleTest.java | 15 +++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
index b1faa55b3..b72beac68 100644
--- a/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
+++ b/src/main/java/edu/rpi/legup/model/PuzzleImporter.java
@@ -210,7 +210,6 @@ protected void createTree(Node node) throws InvalidFileFormatException {
NodeList transList = treeNodeElement.getElementsByTagName("transition");
for (int k = 0; k < transList.getLength(); k++) {
- System.out.println("transition "+ k+ " for node "+ i+ "\n");
org.w3c.dom.Element trans = (org.w3c.dom.Element) transList.item(k);
String transId = trans.getAttribute("id");
TreeTransition transition = treeTransitions.get(transId);
diff --git a/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java
index 3b1748abb..94814868d 100644
--- a/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/BulbsInPathContradictionRuleTest.java
@@ -55,4 +55,19 @@ public void BulbsInPathContradictionRule_LightInVerticalPath() throws InvalidFil
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
}
+
+ @Test
+ public void BulbsInPathContradictionRule_BlockInVerticalPath() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/BulbsInPathContradictionRule/BlockInVerticalPath", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+ Assert.assertNotNull(RULE.checkContradiction(board));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 2)));
+
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
+ }
}
From 576f1f27a290814ffbadded8e723c94fee3e2997 Mon Sep 17 00:00:00 2001
From: Jun
Date: Sun, 19 Mar 2023 18:11:51 -0400
Subject: [PATCH 077/148] added a test case, CannontFillMiddle for LightUp that
tests CannotLightACell Contradiction Rule
---
.../legup/puzzle/treetent/TreeTentCell.java | 2 +-
...CannotLightACellContradictionRuleTest.java | 28 +++++++++++++++++--
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
index 290e0858d..7b938fabb 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
@@ -32,7 +32,7 @@ public void setType(Element e, MouseEvent m) {
@Override
public TreeTentCell copy() {
- TreeTentCell copy = new TreeTentCell(data, (Point) location.clone());
+ TreeTentCell copy = new TreeTentCell( data, (Point) location.clone());
copy.setIndex(index);
copy.setModifiable(isModifiable);
copy.setGiven(isGiven);
diff --git a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
index 260a62c9c..d4f3e2d82 100644
--- a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
@@ -1,19 +1,43 @@
package puzzles.lightup.rules;
+import edu.rpi.legup.puzzle.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.rules.CannotLightACellContradictionRule;
+import legup.MockGameBoardFacade;
+import legup.TestUtilities;
+import edu.rpi.legup.model.PuzzleImporter;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import org.junit.Assert;
+import edu.rpi.legup.puzzle.lightup.LightUp;
+import edu.rpi.legup.save.InvalidFileFormatException;
+
import org.junit.BeforeClass;
import org.junit.Test;
-import edu.rpi.legup.puzzle.lightup.LightUp;
public class CannotLightACellContradictionRuleTest {
+ private static final CannotLightACellContradictionRule RULE = new CannotLightACellContradictionRule();
private static LightUp lightUp;
+ private static PuzzleImporter importer;
@BeforeClass
public static void setUp() {
+ MockGameBoardFacade.getInstance();
lightUp = new LightUp();
+ importer = lightUp.getImporter();
}
@Test
- public void simpleCaseTest() {
+ public void CannotLightACellContradictionRule_CannotFillMiddle() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotFillMiddle", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+ Assert.assertNull(RULE.checkContradiction(board));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
+ Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 2)));
+ Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
}
}
From dc2289b075f1a090557f27865119982914603a79 Mon Sep 17 00:00:00 2001
From: Jun
Date: Sun, 19 Mar 2023 18:14:00 -0400
Subject: [PATCH 078/148] removed unnecessary indent
---
src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
index 7b938fabb..290e0858d 100644
--- a/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
+++ b/src/main/java/edu/rpi/legup/puzzle/treetent/TreeTentCell.java
@@ -32,7 +32,7 @@ public void setType(Element e, MouseEvent m) {
@Override
public TreeTentCell copy() {
- TreeTentCell copy = new TreeTentCell( data, (Point) location.clone());
+ TreeTentCell copy = new TreeTentCell(data, (Point) location.clone());
copy.setIndex(index);
copy.setModifiable(isModifiable);
copy.setGiven(isGiven);
From 38ee499b02a9c1386a022f085959fde18c4fd961 Mon Sep 17 00:00:00 2001
From: Jimmers2001 <38543433+Jimmers2001@users.noreply.github.com>
Date: Mon, 20 Mar 2023 09:21:45 -0400
Subject: [PATCH 079/148] Finish Empty Corners but it throws an error
prints "out of bounds" although for a 3x3 grid it should be within bounds
---
...CannotLightACellContradictionRuleTest.java | 2 +-
.../rules/EmptyCornersBasicRuleTest.java | 65 ++++++++++++++++++-
.../EmptyCellinLight | 18 -----
.../rules/EmptyCornersBasicRule/EmptyCorners | 10 +++
4 files changed, 75 insertions(+), 20 deletions(-)
delete mode 100644 src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight
create mode 100644 src/test/resources/puzzles/lightup/rules/EmptyCornersBasicRule/EmptyCorners
diff --git a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
index f1dd25a13..2789e0c1d 100644
--- a/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/CannotLightACellContradictionRuleTest.java
@@ -51,7 +51,7 @@ public void FullLightTest() throws InvalidFileFormatException {
@Test
//simple contradiction testing for null and non-null in a 3x3 board
- public void CannotLightMiddle() throws InvalidFileFormatException {
+ public void CannotLightMiddleTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
diff --git a/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java b/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
index cbec500f6..bb5738599 100644
--- a/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
+++ b/src/test/java/puzzles/lightup/rules/EmptyCornersBasicRuleTest.java
@@ -3,17 +3,80 @@
import org.junit.BeforeClass;
import org.junit.Test;
import edu.rpi.legup.puzzle.lightup.LightUp;
+import edu.rpi.legup.puzzle.lightup.rules.EmptyCornersBasicRule;
+import edu.rpi.legup.model.PuzzleImporter;
+import legup.MockGameBoardFacade;
+import edu.rpi.legup.save.InvalidFileFormatException;
+import legup.TestUtilities;
+import edu.rpi.legup.model.tree.TreeNode;
+import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.puzzle.lightup.LightUpBoard;
+import edu.rpi.legup.puzzle.lightup.LightUpCell;
+import edu.rpi.legup.puzzle.lightup.LightUpCellType;
+import org.junit.Assert;
public class EmptyCornersBasicRuleTest {
+ private static final EmptyCornersBasicRule RULE = new EmptyCornersBasicRule();
private static LightUp lightUp;
+ private static PuzzleImporter importer;
+
@BeforeClass
public static void setUp() {
+ MockGameBoardFacade.getInstance();
lightUp = new LightUp();
+ importer = lightUp.getImporter();
}
@Test
- public void simpleCaseTest() {
+ public void EmptyCornersTest() throws InvalidFileFormatException {
+ TestUtilities.importTestBoard("puzzles/lightup/rules/EmptyCornersBasicRule/EmptyCorners", lightUp);
+ TreeNode rootNode = lightUp.getTree().getRootNode();
+ TreeTransition transition = rootNode.getChildren().get(0);
+ transition.setRule(RULE);
+
+ //get board state
+ LightUpBoard board = (LightUpBoard) transition.getBoard();
+
+ //change the board's cells considering the EmptyCorners rule to empty
+ LightUpCell cell1 = board.getCell(2,2);
+ cell1.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell1);
+
+ LightUpCell cell2 = board.getCell(0,2);
+ cell2.setData(LightUpCellType.EMPTY.value);
+ board.addModifiedData(cell2);
+ //confirm there is a logical following of the EmptyCorners rule
+ Assert.assertNull(RULE.checkRule(transition));
+
+ //confirm the two expected cells are emptied USING THE RULE
+ // and none of the rest are (others can be empty just not by the same rule)
+ LightUpCell c;
+ for (int i = 0; i < board.getHeight(); i++) {
+ for (int j = 0; j < board.getWidth(); j++) {
+ System.err.printf("getting cell at location %d, %d\n", j, i);
+ c = board.getCell(j, i);
+ if ((i == 2 && j == 0) || (i == 2 && j == 2)){
+ Assert.assertNull(RULE.checkRuleAt(transition, c));
+ }
+ else {
+ Assert.assertNotNull(RULE.checkRuleAt(transition, c));
+ }
+ }
+ }
}
}
+/*
+ * public GridCell getCell(int x, int y) {
+ if (y * dimension.width + x >= puzzleElements.size() || x >= dimension.width ||
+ y >= dimension.height || x < 0 || y < 0) {
+ System.err.printf("not in bounds, bounds are %dx%d\n", dimension.width, dimension.height);
+ return null;
+ }
+ return (GridCell) puzzleElements.get(y * dimension.width + x);
+ }
+ *
+ *
+ *
+ */
\ No newline at end of file
diff --git a/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight b/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight
deleted file mode 100644
index 62e8b32f8..000000000
--- a/src/test/resources/puzzles/lightup/rules/EmptyCellinLightBasicRule/EmptyCellinLight
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
-
-
-
-
\ No newline at end of file
diff --git a/src/test/resources/puzzles/lightup/rules/EmptyCornersBasicRule/EmptyCorners b/src/test/resources/puzzles/lightup/rules/EmptyCornersBasicRule/EmptyCorners
new file mode 100644
index 000000000..5dc1013fd
--- /dev/null
+++ b/src/test/resources/puzzles/lightup/rules/EmptyCornersBasicRule/EmptyCorners
@@ -0,0 +1,10 @@
+
+
+
+
+ |
+ |
+
+
+
+
\ No newline at end of file
From 8d77a0490dbb1cfb07ecbad894a3beb599373456 Mon Sep 17 00:00:00 2001
From: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Date: Tue, 21 Mar 2023 10:53:51 -0400
Subject: [PATCH 080/148] Update README.md
Fixed a typo
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index d1352e7e6..e5e4ccaed 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ Additionally, if you are interested in computer science and programming, please
## Documentation
Documentation is actively being worked on on the [LEGUP wiki](https://github.com/Bram-Hub/Legup/wiki).
-The Javadocs for our application are currently hosted directly on [our Github Pages site](https://bram-hub.github.io/LEGUP/).
+The Javadocs for our application are currently hosted directly on [our GitHub Pages site](https://bram-hub.github.io/LEGUP/).
Documentation is very much in the early stages, and we would greatly appreciate anyone who is willing to help write and structure the documentation. Currently, the priority is to write detailed documentation on how Nurikabe works, as it is the puzzle that is the most developed within LEGUP.
@@ -80,4 +80,4 @@ along with this program. If not, see .
The look and feel of LEGUP uses [FlatLaf](https://github.com/JFormDesigner/FlatLaf), which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
-Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
\ No newline at end of file
+Some of the icons used in LEGUP were taken from or derived from the icons found on https://fonts.google.com/icons, which is licensed under the [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
From 42be8fd17898c0f0f0a811a8bd2097448f402631 Mon Sep 17 00:00:00 2001
From: sravan parakala <43002608+sparakala21@users.noreply.github.com>
Date: Fri, 24 Mar 2023 15:59:13 -0400
Subject: [PATCH 081/148] Color blind support (#470) (#471)
* Color blind support (#470)
* new CB resources
a new folder of assets that are red and blue not red and green
* Added the color blind preference setting
Added the color blind preference setting in the preference page and the user preference map.
* atomic
i changed atomic Rule because i forgot to change it last week
* Modifies loadimage() function
The loadimage() function now checks if the user selects color blind mode.
* changes grid colors in compliance with colorblind preference
i changed the element view to update colors. now all thats left is changing the proof tree.
* Implements color blind settings on the proof tree
---------
Co-authored-by: Jason Pu
* Color blind support (#483)
* new CB resources
a new folder of assets that are red and blue not red and green
* Added the color blind preference setting
Added the color blind preference setting in the preference page and the user preference map.
* atomic
i changed atomic Rule because i forgot to change it last week
* Modifies loadimage() function
The loadimage() function now checks if the user selects color blind mode.
* changes grid colors in compliance with colorblind preference
i changed the element view to update colors. now all thats left is changing the proof tree.
* Implements color blind settings on the proof tree
* Bug fix
* colorBlind -> colorblind
* Error fixed but good
---------
Co-authored-by: Jason Pu
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---------
Co-authored-by: Jason Pu
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
---
.../edu/rpi/legup/app/LegupPreferences.java | 4 ++
.../java/edu/rpi/legup/model/rules/Rule.java | 6 +++
.../ShortTruthTableElementView.java | 18 +++++--
.../edu/rpi/legup/ui/PreferencesDialog.java | 14 ++++-
.../treeview/TreeTransitionView.java | 50 +++++++++++++++++-
.../ruleimages_cb/basic/Atomic.png | Bin 0 -> 5604 bytes
.../ruleimages_cb/basic/elimination/And.png | Bin 0 -> 15699 bytes
.../basic/elimination/Biconditional.png | Bin 0 -> 12100 bytes
.../basic/elimination/Conditional.png | Bin 0 -> 15052 bytes
.../ruleimages_cb/basic/elimination/Not.png | Bin 0 -> 7169 bytes
.../ruleimages_cb/basic/elimination/Or.png | Bin 0 -> 15600 bytes
.../ruleimages_cb/basic/introduction/And.png | Bin 0 -> 16794 bytes
.../basic/introduction/Biconditional.png | Bin 0 -> 12040 bytes
.../basic/introduction/Conditional.png | Bin 0 -> 16258 bytes
.../ruleimages_cb/basic/introduction/Not.png | Bin 0 -> 7200 bytes
.../ruleimages_cb/basic/introduction/Or.png | Bin 0 -> 16804 bytes
.../ruleimages_cb/case/And.png | Bin 0 -> 3457 bytes
.../ruleimages_cb/case/Atomic.png | Bin 0 -> 3033 bytes
.../ruleimages_cb/case/Biconditional.png | Bin 0 -> 2737 bytes
.../ruleimages_cb/case/Conditional.png | Bin 0 -> 2443 bytes
.../ruleimages_cb/case/Not.png | Bin 0 -> 2035 bytes
.../shorttruthtable/ruleimages_cb/case/Or.png | Bin 0 -> 3503 bytes
.../ruleimages_cb/contradiction/And.png | Bin 0 -> 16145 bytes
.../ruleimages_cb/contradiction/Atomic.png | Bin 0 -> 4765 bytes
.../contradiction/Biconditional.png | Bin 0 -> 11580 bytes
.../contradiction/Conditional.png | Bin 0 -> 15476 bytes
.../ruleimages_cb/contradiction/Not.png | Bin 0 -> 6681 bytes
.../ruleimages_cb/contradiction/Or.png | Bin 0 -> 16245 bytes
28 files changed, 86 insertions(+), 6 deletions(-)
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/Atomic.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/And.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/Biconditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/Conditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/Not.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/Or.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/introduction/And.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/introduction/Biconditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/introduction/Conditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/introduction/Not.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/introduction/Or.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/case/And.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/case/Atomic.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/case/Biconditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/case/Conditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/case/Not.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/case/Or.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/contradiction/And.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/contradiction/Atomic.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/contradiction/Biconditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/contradiction/Conditional.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/contradiction/Not.png
create mode 100644 src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/contradiction/Or.png
diff --git a/src/main/java/edu/rpi/legup/app/LegupPreferences.java b/src/main/java/edu/rpi/legup/app/LegupPreferences.java
index 0b88003e4..f9c3791f6 100644
--- a/src/main/java/edu/rpi/legup/app/LegupPreferences.java
+++ b/src/main/java/edu/rpi/legup/app/LegupPreferences.java
@@ -22,6 +22,8 @@ public class LegupPreferences {
public static final String ALLOW_DEFAULT_RULES = "allow-default-rules";
public static final String AUTO_GENERATE_CASES = "auto-generate-cases";
public static final String IMMEDIATE_FEEDBACK = "immediate-feedback";
+ public static final String COLOR_BLIND = "color-blind";
+
static {
defaultPreferencesMap.put(WORK_DIRECTORY, System.getProperty("user.home"));
@@ -33,6 +35,7 @@ public class LegupPreferences {
defaultPreferencesMap.put(ALLOW_DEFAULT_RULES, Boolean.toString(false));
defaultPreferencesMap.put(AUTO_GENERATE_CASES, Boolean.toString(true));
defaultPreferencesMap.put(IMMEDIATE_FEEDBACK, Boolean.toString(true));
+ defaultPreferencesMap.put(COLOR_BLIND, Boolean.toString(false));
}
static {
@@ -45,6 +48,7 @@ public class LegupPreferences {
preferencesMap.put(ALLOW_DEFAULT_RULES, preferences.get(ALLOW_DEFAULT_RULES, defaultPreferencesMap.get(ALLOW_DEFAULT_RULES)));
preferencesMap.put(AUTO_GENERATE_CASES, preferences.get(AUTO_GENERATE_CASES, defaultPreferencesMap.get(AUTO_GENERATE_CASES)));
preferencesMap.put(IMMEDIATE_FEEDBACK, preferences.get(IMMEDIATE_FEEDBACK, defaultPreferencesMap.get(IMMEDIATE_FEEDBACK)));
+ preferencesMap.put(COLOR_BLIND, preferences.get(COLOR_BLIND, defaultPreferencesMap.get(COLOR_BLIND)));
}
/**
diff --git a/src/main/java/edu/rpi/legup/model/rules/Rule.java b/src/main/java/edu/rpi/legup/model/rules/Rule.java
index 45fa28dc2..9ad026fa1 100644
--- a/src/main/java/edu/rpi/legup/model/rules/Rule.java
+++ b/src/main/java/edu/rpi/legup/model/rules/Rule.java
@@ -3,6 +3,8 @@
import edu.rpi.legup.model.gameboard.PuzzleElement;
import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.app.LegupPreferences;
+
import javax.swing.ImageIcon;
import java.awt.image.BufferedImage;
import java.awt.Image;
@@ -84,6 +86,10 @@ public Rule(String ruleID, String ruleName, String description, String imageName
*/
private void loadImage() {
if (imageName != null) {
+ LegupPreferences prefs = LegupPreferences.getInstance();
+ if(imageName.contains("shorttruthtable") && prefs.getUserPref(LegupPreferences.COLOR_BLIND).equals("true")) {
+ imageName = imageName.replace("ruleimages", "ruleimages_cb");
+ }
this.image = new ImageIcon(ClassLoader.getSystemClassLoader().getResource(imageName));
//Resize images to be 100px wide
Image image = this.image.getImage();
diff --git a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java
index 3271efabd..399406eb9 100644
--- a/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java
+++ b/src/main/java/edu/rpi/legup/puzzle/shorttruthtable/ShortTruthTableElementView.java
@@ -1,7 +1,7 @@
package edu.rpi.legup.puzzle.shorttruthtable;
import edu.rpi.legup.ui.boardview.GridElementView;
-
+import edu.rpi.legup.app.LegupPreferences;
import java.awt.*;
public class ShortTruthTableElementView extends GridElementView {
@@ -11,8 +11,11 @@ public class ShortTruthTableElementView extends GridElementView {
private static final Color FONT_COLOR = Color.BLACK;
//Square Colors
- private static final Color TRUE_COLOR = new Color(0, 130, 0);
- private static final Color FALSE_COLOR = new Color(200, 0, 0);
+ private static final Color TRUE_COLOR = new Color(0, 130, 0);//green
+ private static final Color TRUE_COLOR_COLORBLIND = new Color(0,0,255);
+ private static final Color FALSE_COLOR = new Color(200, 0, 0);//red
+
+ private static final Color FALSE_COLOR_COLORBLIND = new Color(255,0,0);
private static final Color UNKNOWN_COLOR = Color.WHITE;
public ShortTruthTableElementView(ShortTruthTableCell cell) {
@@ -42,11 +45,20 @@ public void drawElement(Graphics2D graphics2D) {
//fill in background color of the cell
graphics2D.setStroke(new BasicStroke(1));
+ LegupPreferences prefs = LegupPreferences.getInstance();
switch (type) {
case TRUE:
+ if(prefs.getUserPref(LegupPreferences.COLOR_BLIND).equals("true")) {
+ graphics2D.setColor(TRUE_COLOR_COLORBLIND);
+ break;
+ }
graphics2D.setColor(TRUE_COLOR);
break;
case FALSE:
+ if(prefs.getUserPref(LegupPreferences.COLOR_BLIND).equals("true")) {
+ graphics2D.setColor(FALSE_COLOR_COLORBLIND);
+ break;
+ }
graphics2D.setColor(FALSE_COLOR);
break;
default:
diff --git a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
index da524a5f0..dc1dc3654 100644
--- a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
@@ -21,7 +21,8 @@ public class PreferencesDialog extends JDialog {
private final static Logger LOGGER = Logger.getLogger(PreferencesDialog.class.getName());
- private JCheckBox fullScreen, autoUpdate, darkMode, showMistakes, showAnnotations, allowDefault, generateCases, immFeedback;
+ private JCheckBox fullScreen, autoUpdate, darkMode, showMistakes, showAnnotations, allowDefault, generateCases, immFeedback, colorBlind;
+
private JTextField workDirectory;
private static Image folderIcon;
@@ -212,6 +213,16 @@ private JScrollPane createGeneralTab() {
immFeedbackRow.setMaximumSize(new Dimension(Integer.MAX_VALUE, immFeedbackRow.getPreferredSize().height));
contentPane.add(immFeedbackRow);
+ contentPane.add(createLeftLabel("Color Preferences"));
+ contentPane.add(createLineSeparator());
+ colorBlind = new JCheckBox("Deuteranomaly(red/green colorblindness)", Boolean.valueOf(prefs.getUserPref(LegupPreferences.COLOR_BLIND)));
+
+ JPanel colorBlindRow = new JPanel();
+ colorBlindRow.setLayout(new BorderLayout());
+ colorBlindRow.add(colorBlind, BorderLayout.WEST);
+ colorBlindRow.setMaximumSize(new Dimension(Integer.MAX_VALUE, showMistakesRow.getPreferredSize().height));
+ contentPane.add(colorBlindRow);
+
scrollPane.setViewportView(contentPane);
return scrollPane;
}
@@ -336,6 +347,7 @@ public void applyPreferences() {
prefs.setUserPref(LegupPreferences.ALLOW_DEFAULT_RULES, Boolean.toString(allowDefault.isSelected()));
prefs.setUserPref(LegupPreferences.AUTO_GENERATE_CASES, Boolean.toString(generateCases.isSelected()));
prefs.setUserPref(LegupPreferences.IMMEDIATE_FEEDBACK, Boolean.toString(immFeedback.isSelected()));
+ prefs.setUserPref(LegupPreferences.COLOR_BLIND, Boolean.toString(colorBlind.isSelected()));
// toggle dark mode based on updated NIGHT_MODE variable
toggleDarkMode(prefs);
diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeTransitionView.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeTransitionView.java
index 0e80499e6..f63963a66 100644
--- a/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeTransitionView.java
+++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/treeview/TreeTransitionView.java
@@ -2,6 +2,7 @@
import edu.rpi.legup.model.tree.TreeElementType;
import edu.rpi.legup.model.tree.TreeTransition;
+import edu.rpi.legup.app.LegupPreferences;
import java.awt.*;
import java.awt.geom.*;
@@ -24,6 +25,9 @@ public class TreeTransitionView extends TreeElementView {
private static final Color DEFAULT_COLOR = Color.GRAY;
private static final Color X_COLOR = Color.RED;
+ private static final Color CORRECT_COLOR_COLORBLIND = new Color(0,0,255);
+ private static final Color INCORRECT_COLOR_COLORBLIND = new Color(255,0,0);
+
private static final Color OUTLINE_SELECTION_COLOR = new Color(0x1976D2);
private static final Color HOVER_COLOR = new Color(0x90CAF9);
@@ -87,8 +91,31 @@ public void draw(Graphics2D graphics2D) {
graphics2D.draw(c);
}
+ LegupPreferences prefs = LegupPreferences.getInstance();
+ boolean colorBlind = prefs.getUserPref(LegupPreferences.COLOR_BLIND).equals("true");
+
if (isSelected) {
- graphics2D.setColor(getTreeElement().isJustified() ? getTreeElement().isCorrect() ? CORRECT_COLOR : INCORRECT_COLOR : DEFAULT_COLOR);
+ Color c = DEFAULT_COLOR;
+ if(getTreeElement().isJustified()) {
+ if(getTreeElement().isCorrect()) {
+ if(colorBlind) {
+ c = CORRECT_COLOR_COLORBLIND;
+ }
+ else {
+ c = CORRECT_COLOR;
+ }
+ }
+ else {
+ if(colorBlind) {
+ c = INCORRECT_COLOR_COLORBLIND;
+ }
+ else {
+ c = INCORRECT_COLOR;
+ }
+ }
+ }
+ graphics2D.setColor(c);
+
graphics2D.fillPolygon(arrowhead);
graphics2D.setColor(OUTLINE_COLOR);
@@ -117,7 +144,26 @@ public void draw(Graphics2D graphics2D) {
graphics2D.drawPolygon(selection_triangle);
}
else {
- graphics2D.setColor(getTreeElement().isJustified() ? getTreeElement().isCorrect() ? CORRECT_COLOR : INCORRECT_COLOR : DEFAULT_COLOR);
+ Color c = DEFAULT_COLOR;
+ if(getTreeElement().isJustified()) {
+ if(getTreeElement().isCorrect()) {
+ if(colorBlind) {
+ c = CORRECT_COLOR_COLORBLIND;
+ }
+ else {
+ c = CORRECT_COLOR;
+ }
+ }
+ else {
+ if(colorBlind) {
+ c = INCORRECT_COLOR_COLORBLIND;
+ }
+ else {
+ c = INCORRECT_COLOR;
+ }
+ }
+ }
+ graphics2D.setColor(c);
graphics2D.fillPolygon(arrowhead);
graphics2D.setColor(OUTLINE_COLOR);
diff --git a/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/Atomic.png b/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/Atomic.png
new file mode 100644
index 0000000000000000000000000000000000000000..0a87b70be286478b36c32ba120b0010be4495b34
GIT binary patch
literal 5604
zcmbtY3p~^7|DToAly2z62`Sku*FtlhA(w{PhERk?78{%UT^$L@>+Wopbnq7AfbdNEd$Sq
z=r`^Qe0l9B>U3bo2SnDw2Shk@dAbnc_~s_Mw>pmzp>{N*t2o>1_wy%6T6IZhqR$(h
zFb?6qp7Xnq#!|m*8n>tt8`@wQiMvZtJNP_=HKc`FlvChEH8BM9rw5AyBIfy**
zQb})h(g``MQ}?l3Uh(~}6(zTB3QokTrkV~7CZ0=r^~^SZ=;2Ce*qqJEYF`=F(@ApG
z@fW&c&)XrdYCiepg7o11V!dxZb+P5wAC4#EveC~Ll-aGhQ)0wIYMVp2Q+^!?ucOg%
zK^E`%%xKhmbpQ9glPLr#RfV$(O42$IDJdx}
z%2ihltik!Obl^!_`kIfAmxiLEzrVkN{}}}`#Z6Hefj}rKsVJ(b$O8y@Y9PtSDL|e?
zJ+W=%Pdf$#std*4%g3EelH%EQawhxwXiH1;2Kwu>?Wd2s>)#`hs9&cAOi+>6qo}N)
zr1gaG&dK;!jn)3)ZdJ)9QLm`{<}>ZH@6y_1{izvn(j?1Ynvx
znvU{U%D1|I;`Pa%UK9eA`Yrxj-9Pb|Yh)iXutXGh7ZZ{XfdY`fj`pX6{~7U(E#AB}
zFzx{a4_gCwPXcLcd=)h%EyaJ^^KY3K|7M;!`@fjq^n7J%De_kKo0Z;9qb)6vM>-HK
z#lLb=2VxxGbq@qOFll0-hYxU=8QGWUU=`Xrx4^bDgs1E@=*Q+(S&R4YgiArLjtLqd
zOR$B$b>j9HnUy!;jo9Gct1Mwtm2#Nt%!%&da}8{s&axi(O~M-R1G7sMChAFTc|e
zN68?)k*BAZmcwTUj$id#uJvCY=8jUcKSZyzBm58hxh8M3!YDMoDcWpQ5-U)~Z2+Y9nNgeqA35n;)WOAbH5_zb)
zfE?M1kw~S?jH?}cE#bxBIG-?7emw>p9Yk_
zo0@7JV3nk_B8vo2Q7odG3K1(G_%@Rvh>%u6c`t}!!!nf>3EAy`{lIKH%}j5%6w0T
zFTL!nYmm
zqBN$wbgLZv*asLMwNiu1D_j9$
zAl7vnAN+1w{PEPCSP8mg5q5;xj~McIbtJZ#@8}Qg6)fCvqQMgHo)z@1G9~NkDmL4N
zZocmM9O?16Al!z8vu>!y!*Eja?xMwkk0oDF7^Xc!n=_Sq5`OSr?EyBX5E;}Z&sJY4
zNBgDz;w`o?TDll9Zz}>LKu*F&P$MrA2#+-d&F2@s7it`+?FKBFOo`W(6$b2Mm*O>3;Ku
zVOVyvxh~jPAWAGbG*?P?2^0AV!#pnXWO>nKTaAqjc5LDrfu?dX`f?bi#pi=a4JbPz
zCG>>_<=m?TP?sKKm$Rg-cAG<5a`#5q&O{-IYD8P-gf6FM;ogTW9{1X^K-L{MeFcG)
zEi$5ip~%vZ6eTyGA`0@(#kjc_8+}|)m9!tQS?TeBNF5iRK8?02d~H+h+MSXjSJny4
z0L2hJYn7I6zkV;e!9WBV1Z9H@;kYmC?!F553*pQ)iW-07cM#PFQ>;(?1Yb4JHWFP!
zH3MvXAS%5XO$e%;ADOVeegy8P2SKJo*`kH;ZX>#`rP|pVyL!wUYnYU$@bun7x$YdO
zI^0j;llK>t5Em}l0Sw$b5LI^>QSfG1h4Vdu{&vQ;&@W)qj6kOpg&r3O9{sc!d$}ik
zQFDi}mD`cx(8?(x4xE)LTwhm7ZuXt&_Od8O_Yu1xpL{qw2?Z*Jz}LDUpzLC>|hT>5py;xzuXHOsohA;{4(UtCB2$Zrw!4YY&^b{iD;683Mg6g
z{;{DdEc5cgzHrCDvWgmTF4gWZxb2M%!m`{9{*RdA6hyS5WFc(M&u6|FC6
z!T?`;JPz@#^GEU_2a@IREMX))8OCdRlA*ljn1Lg+n?7Z+e(pyb;EX30$0s31o1v-c@YdW;7IL>0AS
zOvvLj!&fnCS-(>u!9^fcOd)0=r6>>`h{&k+X_Dl-Qkn;4OA}U4aF#sMKHP{^?K2)jFe(``VKwo5W>EV{K6<{6x@`j!d
zP+iP?h!P0oXETJ#Dnjc{FX(X&v$(V>))>oUKx8wHc7~n+lf<417g~M@ex9EaHAw9A
zN$ON)B_}(-4xZ;4c;_8Oa)^B*fgNe3?$jk~P%hn0gqS3V0b$guwu1DYXvw6(B82e{
zyatcA<25wAHLqdgv0Hsr4Hy^>R7AYaz!rkAz164!G~fMF`6$yg@Z`>dBXR^tE{?WE
zG{@TUFdAn0H8twbGiWuQL%nwpf23w=rae%xVU4b8tW5N^#2u;6&X#D3lDiWhU)!Fc
zuFidAwCLxUFgrWzin<1Unl1qXUmNnoffDPmLM!^SC>Otr2|-TU(*=(fuid$OcNdKP
zXC;1k|FWZ_BlRxvCyB*pLF@~*?|wP13)+cdfRR$da{o8sncK?YmLPVsfy*<`b6z*=
zr)1S@=hj=Zg6lVTu$#@fb=k9&2kUF@q^Y|FrOHkgXS1|{(=7RYP_u&n2080Pulz;s
zZ%43&RrgiPtIAa?swz}71R)~O$eA<;%4ZqUyQd`^aHgjH!>Z^q-^0{^37sei?Ps9{
zSodd-w3?Q9zxdUXw*f!<6T|
zc-RR8vBUT8e+qxKd3PuR#h>_S
zLuOxJQyaOGFA5@MGNXXgXMl~(MF>QIV^UO%-Uq0UTBQ^LFFPk0(<-XMauJg~j4d_M
z7sf;1w$5U)F-%Y%zJ}MGnBFYLab-{{D=s4R5QYe=mCE^}oJ#~G%<|X^0EZ+>EUY9X
z&;K+Z;oPbCnmNpPWYbtY%)C@^srWRuC=89jt;Bip+xKl7vpH4Kf2PF->L!#P&j1TL5>>7l5=T&JpoEC->i+Yq3w&!y6Nf7
z2T$QS{>oj*YBbTz4gZO`CP$yvX4$4Uo%n*i;3xKnIY;rqhLbWK2x+AGW4nT7HK5QF
zRyT5bKW_kqUVuJCvnrGC>E{I%DI2t1=oby*C7-L=SJ;=&willIZEJ{_(eYN5eN22p
z-xJ5`fv$DdfLxdHRxo4-fm&~$kJWDLq@Ejh<(el{@>a|zPkpug7ztk_@rElOvMJCJ
zI@IZ6zyN1W`i6O=@`t^ABi1ro9D6Vdk{cob4P6jxXZ_KZ5yQ_qw7uEJ81cr1aDCc4L
zb}C;^8+?%6m~Ljjxv0l(V
z;0!-kP}Sdikqk1H(wJUrxcL`
zE%}c4_k6FSyP*@e5mZu64`I#n4dVr1t0*@}z
z>`fiBxxIb%{B;QZtB||n7=hfO?*;4}r}uAO8DW_PxtK^Hl@ZO{1G|9C-OZ{D0s8o$
z-AjP}SIfc~AXoNel%i*RJ4?m`ErcE7Q2d8fyR)Y*gk{Dwh>5iTo9Bkzv5BThp#GOh
zCP_v?PM+#SbZbS`y-0YT0DzO1!EC{>%rYa0VJ)nBtu%#obqxZ?Y
z4eKZi#u{I))+&<%CYa=2<+duW6Gs~}jScyx^_UiTSe=7=;)
zd|Pt6CTC{$QG|Slsy*B9Z5RD);L7}+xHvUKolFAmnM>kgFFPDhm^XwrgjwIoLU4PA
zkk{58#txk>gHfLEr#U^4JeY%cbQu=C2Hb($b2T0rRjHNqkN*>*n
zehzm9tyKRk^6ATCfgAf>qp8do=Rf}hxT*bjLH*ZU{;!&6wVMJlPd}0cTqeeN|IL{g
Lnj4g&uH5(^$-c^V
literal 0
HcmV?d00001
diff --git a/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/And.png b/src/main/resources/edu/rpi/legup/images/shorttruthtable/ruleimages_cb/basic/elimination/And.png
new file mode 100644
index 0000000000000000000000000000000000000000..8f486c4ec74ad9272da556f2856328d1520febc2
GIT binary patch
literal 15699
zcmbWeby!qi+Xjksr*wl#cXte>(j~3L00Ru&AkEMq(#?Pl14u}RL4$-0Qc_X^1Bj#&
z0-lZU?|bu$bIu=gU9sj?&>$%sx6ZCa8NeCGTF)%Pl?rW(TVqn}d27aOVxWJod
zP|$baAqoNl>H8RJsVB6sHP`z
zu`3_Fllekq_=(u@=2&t*ecfsC9ZRsBdP2%$qHD~SVGACPyL?2hcD*NsQeqMr4W1sS
zh2vLWLUd0HiKbVZo{PAIKKqa#>@2@hoW|d_YvYMZNHX0iPlTs@9MwMDI(t(w{Ik_Y
zj`lZWir2J$X_ZZ&+JvuBplYDY*p%BB3U?#JiME5hdd(a>!sWT(S3`A@TuGPEMix?>
zmn}550S!_1)URHgB-b132HbmFmHEZ~(We)VTaNt!A9lLf`lN3yYKv-+D_s#M{a6P_
zD9#;fzNsTu8cXcswUd~cFu!-7kSYyX{oIRR9t*X;7cB1!5m&iW`56mb9xotF5v2dY~P5WK=*=5*@wJ*7|pCWXLL%iIS8gVOir
zck7EIYaj*&_B)8NnXj3SwyeDeRM6JJ!wxJM2=xTCF)-wn0zGZ*UBSL=c3>xny8_34
z=X(w|h=T&hBMBX09ZwM08KM>J4K@naHMS3SwU=?=P*Nn650nKQK*7GYY=KZWcOTh6
z1&%*{Wr6=UuZ1|+{;2r6DsY(T=(B-5yuoY|f)awl9EyZ&^4<=PvW99Je;ET$3LMV9
zzMir|LID8*f&pTJ9^OtuA~G^ELc*d#qM`zThJa6yyRU7afV&Upjf=nePy_qedqX^Z
zAs+5*H$H9cJp6nWI5+?~+h5MXfslWAclY_L`@ld5-AIH)1cinES=|@n_&=!MNd80J
z)7it|D_u~zUuzKK>RhR{}R)G
zHQ-|$b
zb8M;Z3`TTRRR6jWHq@Y)AdzrVX-A`z=;Ot{P984ku)f;c`H#;;$0WSCOj*s=|0<$cvx-e|n8>o1fY#
zo=(9j5ON+3akR1TzsJXrqBEux?|ooaKJhEi!+uScijj&X4}~^gvcFcj9r-=&`TF@a
zdPx6KZEJ&w>!5kcOU~?kC$&8KW*1}ooukSWl9DeddCnuXQ%$q8Hl_LEqvMQ69@+IP
z&G~QFzYVxtaviCkY6jkjB#m|LPaFx-erYZ))1jG#)6{Ix*Z3K_`)S4R-o0!27C4cq
zoNE1oxoHa^ZzRcaD@#HQRi>!##0Y-X89iKco5F`&Gob5y|JRdL!@*Z}LD|
zz=#;3Kev*;r`1D_ubo4Nm0Fc#R~}#w+aRdVJqsY}&rWo9#NN6!F-uB>y+1^7MZM4j
zA*~GFc%X>+-8}3cNL<clu6dsmCF4}z
zHTN0xQ#iUiwd+M`bGnaG#J-}tAS)Tw5^BO~qVA)FO+Gm21ixV!-k?=&8lMm@+$$wQ
zmEc|By9{a*?7B>*3C1cCy=7evu#f~1QK#rvM`<88I5Kxd=xfVA0XvUyUMfG%O2
z<&uGmBJ`?oVBH(qju&0a=CB=%0ICwz5y;>Jv_F~vX_+jNZ?wV)CZ~64=idDxO;fjv
z+Z3M6Qrll$8UWe~4i>;$b+Y!jsPR-*HG11oy4=YIA_+0t(Y8u9M{S@|P4xY*~35+#ny$3x4;Ti8LR&FAublbER
zU;0L}vlJ*ZstQF(Z_Ht=`E9EIX6)-fEdh}!*UB@lwd;tVar9`2s|wJ9J6Wg>gWEz_
z@hVRDBOSkGj)971^ZLrRIq<
z9$Bl=-w%%~ecQ0RluW)bnu$(%8z6SQ?%0fMAeIR=(=1lCeUF)`tTq^sVUgP%CcOfUzS*)s$<8(7B6ERogq?ZGdsZyeM5po(!
zi>qOH>-tbn^OSTv;w{459mfYX9`l8CA!OQFt9Lz;St=TcJ0x}p4e*IAFVv?}z^urj
zCREa4V_V&mb=&w;t*&N_Dp#bJTv9Q82(7jsnXhCjOGQufBg7d&x|Efa4q^Qk`eYI(
zf19l?`g!(x?(2RF%t%9P5IETCR`Od`#0AZ9SM0v3MC|}4VZ^==BIDlc3`i2}gAind
zcsUO9ttQ}Iu)wgG?iZc5pVKj0N{Pz*b>
z&G))PzP1`ji34`yqEG`*!VSXNmXFUw?)2=ajiTEd)RS|`{iPf12cA&Y#U3Tf_}LOo
z-s@gw?=o=lBWZR%yXVDB-S{RCx@Dr~8FOSdWleO?tR6oueoG1!Z7};lO0yznE(Ky6
z_sXh&`L3`75{L|>{mXoFlzO%=qT_ky_CU`dNAU~F;OKfoi&k4J7lz9NVq*F#y5C=OwxCNDz-2Yay*c?U0O>eM&Q17eKwC?_Gmzc6{9S
z+xwSP-t-C6Bs2>5f0b_fmZOR(vcz@X5p-=|^uWglTsk0&dfn)A3<#uZFgxeGxp??oo~3A8;#z&rY2)~O
zR|B>~#Zt63oTS4y1IzkiZ7W+BzhY57;%KcxAf($y$GZ-}ve3+eUwpkk+0oTeZ3k71
zVsvWX?(BMCV8nfV=v~>gDGge-Nrz`+0xhvfKpBW%ZOWM1k+dj>IhMRG
zyNrESqx#8kawac4S2Bg4u_A~QL@i0<(O4bwT_lBlUkstT7N|W3J>LRN20<&|CKF3n
zZcbkR&XpvfA?9r;^<~)2lO%yYn0^+bv)dzxpr&Z?WKCU*LvV{W&(dh-WqX_ZSxE*u
zcYv$Bf8NjSd}t#5XkFlzs4*G;7l!i5&e3S`0o5gBrj4m$Dr2F^{Q8r;b~tCy&j7J2
z(>58Ct>^Kz_wN#ec!}QF2y(j8yF4|MXK)P82zrJKdg%t!e`IEW-Zu!K^I|k;8RO9~
z!_GEYr=BH$A*xeiJ!TEFAj@~W5b$M50QOskp_8lcg;H*khb8YSp5Ef}PN=+-95Z{R
zs>!t1(hAQcz6p#M*Zk5ucY7LrXL^rmSPjjaw{0QJyEY57z^TI+2W>4esnSJmHS6_9
zj$P9Gv0jSU3YaxfVPpbv=^y*vKPG!gt;7;j`8*DkGoo#8y9imtkIj=89JGHk-&7-y
zgA?crqqTv|-x)TR{Pa?LeG@@~t#fW^d%+!$WX_PfDqoo0F|+h_pvwm3fOe_$O-5?SMGAzdbRq+bFcTlrp|`q{^ApGJ$`
z6ODHf#s@RU<`9O4WfEj4ewtt{3Utq6vyq!2`u9vqq)H=|-LTk*)3GmAaNj
z(2RE`)(DGxl#Z3vQZ2SMJjIy#;V{LlU7$u!8vmlQB9_rR!U%R;CtAuA&LrkZF&^#Q
zlB4J``_f*5YUXO)LraL^Z%ln4()xA8a
zdRiJg-$E9;{g1t{1~!~Gs=A*wG&LK~9=w-d`NhV=;;$4x0=;$P-S*++Q|gmEQg=2-
z(>X+YZDqGfRQc3X)IF0eC+9hcHN#sjD4jdu+)O`~GK@Dd5~mcZsTN?tnvHAs(0hH#
z`@tCEDu&(oSAH0ib_81EPM?ES(hCkrs?rFl5HPZg&JCwDh-s9s%w5wn)0HvZ&nI|6
z=S<~C1CntB6a5ua$*qmzC-Y=l^e&oMiI|SQYKYZc_4Cosys}+;wVrRh3m=e+g;nbx
zkgwv$W2i09<%*}(qWN3~OIWK~=p1I+br=lrqKHktl8NQG6_6LXX*Am{#Ghkj(jbgX
z=rqT)l?y75B6>MoScR{1o1@oP7|!I_!!WQ@0h2W7UZ&&Du{52d`P|XmZm8%^)_^fo
z9r>Q%sq~-$uhe^IM0g5tY9eBvA@r|YCdUvpP8Z@@b8MLAW`9-PIURSyoaNC)?X2O(`6Z9FN@!3|=j5Kfjkp?PxitVdp2H
zsG#*pE6ZfYxk^z_J~wgy2X&KIK~!?q6^5^u-)JT!H311XrRvGYr`|i>!OU*lKM_V+Un@-X1fcuY~*gUtXUzX5rIaNC`;QnJ0P6P@4$iFt1xP|9eeMTeS!X59-KWQCXZWWQX1&|
zB^(~EERR`uAM>)b0eUH-n9FW(sklTqKOU%nOGBD#Bk6z?oeGsEt=kd<&UHy%Tg+Wo
zHkYBrzo`ek^tmc)1!L@x(Za717z4yj8D5Z?G37s$<7fD|{=W0R3apCf{Scm|1!r2*
z%Khx1-s7y9w2ofnuT5hnc|({zAB~BVHdzS@pP~l9$+ZL4fp;CzTJSFA&FoR)ofF137vt4nVer|4^L{dmY_IqyEOwStYZ^k)
zsU6*O>yMW|n@#ViQQMj^4(iYk>W;M;6%*=%ZfaM#QN{H;KQWF!Qw!31et79b3!zGiaOtAjFP7cf_xJ%I2|jk3JxwL=U{gK%AA_*_t5%Gz*lps
zh6p&s7N3q830ZTO`R0+EL{`3iSQ?FT@;VTwQ5kKkBA6C4PStJXkIz}vvSwFZ4{pR>
zF&zJyMDFv;Rk@isYx0y47PVT~Q$whl=);BTC
zal=WyQM7#Q*{tjLQ`1!Tx;QA-OLKA+kFzT_4)Tvxy@1-reKuO8dNkEubnJ2dcwg_N
zS>DkYI+BBjn^Zy@WW9Xpb&b)RU)k9nwJX1
zr=(QWO$(pH@6}rmNV!%Bw+1c9Zfb2Xj`d)
z{1O9HY3N|J`p+l(sD|g%IbSVSWuA!7K;iO6CPct&;Ql0H?;z7TI!3)kX<2lc!bE
ze>FfqL~X$XdQVcL%yRGQi>uZUGEig@S*JPZ_AkdV4!w^v!@smul!+053$Qsl9$r@J
z=HQ5{QmY!%urQ8stS`e@V2CvtM_Uo%-7)gsdb+obbl#OC29&@I$A1?iLJYr*WGp>L
zF{7|h>-x%Z=O6y(dik$1TFnbK+-1R|lu)10iFmF=9i#E@KnHqzch{A#&ei?5)g+Zl
zLk>h;anaF&;?C2Iz}koYZ59hQWp2{j%^ay~Guyiff8hY(!^_|2bjp6A=Qq->2Ub6I
zH@k)mzjq!k8%QiN&DG?%6P)u?a-e9Oia`AaiOA9Yp4LL7J-%PGoZEQCbgUKA_Z9D+
z)V)`^PgoMl*kQMic9G&i8ogElE=Tz}*s4^?r{IMvMc4GwRDA{DAb
z7>siCpzkm!aNn4|aa5R3A7)-+U0q%OgG~&%TuPzjP;INrQsSm=9UQV)8kuo}3@Kj*
zgBkG@e|2qg)r~fp`G#jQjh|``!eq6=!^7>rFLFyZ*VWaDK!8hw$G&*hY2NT%1Hq#X
zmf=jw{~eV0uR-35yi%xUB$9lL$~_%@GmxlryUj|LuI=(~uusAEv(Xib{&Hzx(G5#a
zW$o6u6?TkNj&YEW4aiy4Y*A<5#LG?)A6!q5DAN}h9=v~Kzv
zvy;>$do1}iWI6qG{jwZ$QbG*}k>oVj0M_u(Vt<&r#7+gM}7yuwGlkxw8)8e8y(LE9qbtx>s(e
zy67ip5Gnz6h+-!%S*8lUdmAq)@3Duk?++b`p{Yr|TuGss*kZC8CAIO`VyAhXQX6Mx
zBtQ3$ro~LbA1C5(ZhhAXVZ1Fxxx~PL1-(_Yer6#v44!x-Nb-5*^u?|5oumB{qaDaI
z*u}lc>&d32m3|as=^h-)HbWeCYf1nBauCL_3j?c50LW1XfSj{?U&!Wf<$u|9{ff+a
zh&xaZ>!$b+iR!n$WaQ2XCs~&0z`DTo#qq^G@kVlAV?U+J$MK?R5;}pPDYW80c{3%)
zFzR?Y4nuy4pi+c8{Kqn_B7Wzv((Q|-Sq3p($e(oYJgvfe3%lS)-$kXOEK5h=3Hq&P
z949RCb?aoIs_~*;_{86Mo4h8;=i&`ks$l|B^7K4C6x>pL)+^ju@TYoGtON$aMh71^xKWZOWfNXw
zVjj}6t6HCNNy5F)5El1A;6S6|iW7HYuRa$`ACK4(JTZ8s?
z?k|Gsd;+;+9Y#D?W+I~dofpw=&hzd)ZBybbqEO`_eFf3^CP8Nb6sfDzB9ouJE%Djo
z@>)8=Bx$aiBFastfJXj#Ho>gqFiafDy&QOO%-t(10^hN>WfC
z(Vk+7H}H)~3i8g`Fa2BWpdUj?+PhIRx7N>T`^pnOJ(1CiEook%eE)%i8XST6P6;^(
znZ%7Ep5`pnX{UUYYN+OyV6Cw)&zL$PVTUhR@(EJj!{Ig85B_O<6J<}ik(I4FpGcvl
z_HIuE1ZU-fXO?MlgwTvOL*l04-qJNV$R=McK!x#d@A28jbrpgA!d;Xb4?=l;JP)U`+QoqjW%@B~5DSDyp$2krd
z02s~_oAYF30in+o6hLsYmBRs?>hok1h~9PH)Qt4-3(`{03iNDP{Hgy_0nw>oWwEyy
z-a3);jJ!shk6Tw`(qzuP4x-}<0&0ZW*Y*HtM*hoNHNKeswT^Bh1Vz=ZYdYMNm8B&>
zKGV3>hkFvvzj3vL@f)U;+|f(tF)s~sHztYQMVhP5^5W>k73e}@oRQ!MIXWt^e2UuL
zaOw+;ufb8<#_@8$?4WM3Wv$VH+!Z7P2lJ_S8=#&hEZ@I)xLw@Oguv(e^;;tX>mRdC
z&FcrD83VTHjXx4<-d}Yu{36!05=k&WDjpffs&O}GgRYnKTG_x9rxY$
z_ejIWE6Uuj=xpcjTszE*uGoEFlGm;$ae*R7>t*m{DP+m*Bz0NE>1B!5F3{p=?s$=B
zMr@Yvg7~bkE}1g@?cA+bHMe?7V0@ph}?arDRbN?SmN|)J|)^_bPYE^
zhLR$oNuYE`{fnYzgedsPeY$^e-(X#%`o=
zSm-SiTBoh4-j>@rBC3&qY=-N`yu=ZPO0w-+BkVW`;7z@0yl!U
zlS@5(M=E0Wn-@(Pzl)$%l{YGR3_AXbi(ev#Jx?-h`1<`vesL(D9H=g_L-!lT9O?L|
z;iG25wpSuqw#-?GV*l)mT7CMD?}sB0mjVZkzs||mnPsBa+{NnnX1_@@FfZC}eoEby
zxwIn*j{&OnLUxBBkoP(-#Aj#Rpw*_$Z7p+kXsPLkQL2AKXh${x#Byiu=e1B5yN%|l
zn*NMfBOLSW9WnKM`KjJJ$iiK$`poxN;AWhTt39!=e<0tgsIdXv;^%dkHIvo&<|rGV
zm0e?sVLSi2VN9i=XX2aA?S++XSVA
z*`u#_tRR-R@Otd&6{$DTH=qRjXF_E$<>kSMm=Rb@)WaklOF6pYqfY>ugW>BPS#Ine
zGe;=>Y*ytl{;YNa0J4x8wLsy9@)J{XY!dNrq|#1Q5;Al
zbNEcV!>tr)I(@51LRA1~ktC${hrkEV_h_tm&o|Dc2+pu?BrcJ
zTVCyjmd)N$_u5}=ED45o0LtFllHGQjU1xtrb!20}&IN+B2+>gsJu=E#F8M0b*Dm
zKYu5IMd!!uP$5TeVYap`D7z`-{R>&g2SA)s*SF>*%guylB(e6e^C6!;AVYPUVTj=)
z=U4ob!&Kx+XYZ&rK7a6#s
zB)!XctgvXUWka9Eu4nNoxs~TTTv_O`Po#NwHVHM6Eq43O3iJ{Q$4~rQRarGkN;HZJ
zmwS8o@j#b0%LAuxN-s2IwZJ6PFWoE!8l4EE8nueuQB{rX#TNNeOwNZdV%uh)nJ(4N
z91Lw1z{^p3)n?Rq$KiQt;mq$e)o1T#AYZ{ns|8cqr0rMnz9hZEn67H#ObhLq@LY6t
z9^`VtOUYWLZ0UDqeD!Ut!EUncz)*=7xKwj$Ja!9YkBM!3QpE&y9DD7w2+{F*>Iy~j
z0botNFbSdqm2BGBh2qn|o=P5O*vUZXtcf7Qs^wLix>MSW=zjK@8Pc{TbaRka%#IlI
zL6D;`uRH*rSrRQo@~M$q-7->O5)do0T5124Y*bB=C2q`;)7$Jto1JTlzltGMox6P!
zHnd@^PNV;1z(faG2>+x7-B?>Y!#!CB%0$n|Jl)4JscI#7!7sa$`5Y~#BOcK6R_s@R
z%v~NI#UJJAe_~Hoji&=(onQ>&HNBC$j)>`nYL6-vMqbTq{y-I@Hw5{_OQhh~a^u?8
zMqI&h0ecm)6pL8T2m?T03G-=jrgL?XR$%!ak&(d8P?jM13%ICQDuai`On@}r&R3)t
z%Y+xri3%EuS~*2r6BDpgJ~5rrL3yFMm~Ef(^(`(Ze!o5?CMI5~dscM#Yr=cceC=@m
z)L@bZCx^mp3qG3sA&~m14O#lfEDfCjm8AKOy`IR5O3|+0EZns)&fdBKRr$g+0&I0L
z(z-Of+fe{PV&KL7S8tYNR2Zu0Qi+=vr#|ZA*}jIr^bVUQ+sp=R;s-iN#NT$kzpo3k
z_)yQou6Dolz75tA-fK0s*~u37>xbC0^R;ni44&b+iz4J?KZtIs)-pOXjsqI>BNR{I
zsMyQElRX-8B8%fo9+qxVta%2+#Xa;>eXhaRx08Wt)j(ce@`4BzP`a$TNGEe!7Q;>@
zTL(VKPBZhA;pQ@ryzJK~tkN5@!iT~{>!K@Atni4B-*Wy>hDt(@p`LoX{to2zl;n@5
zSKL30@!5w{{)t#|a`NLxb91g(Yk2K;0=bN;D>Alc*zb3>P3zqzlPPNJwOLfJLBQ9c
zbe;2vR+EtGbqgc1o2vc`Bz*XHE<`;LJx`EM1OPX*I_6Vmuc@kg6H#dE`31TFMf(6X
z1AfbvS3GMzi9GY1b-NS(Ogoof&QoL-#zg=cigwr&Z~GoXnxfn46MuL*Qu6@^^rzf^
zRDWiM_i$1%l$)lArm1l!+embXgvCA=jTwq=A!&B<)4QR^j4>L=+^VClGf(q>5i=B<
zx~4A`8r(ZD8sa2b@yse`(ovJ3TVl0&Rbs7~;qV0im`oLax#=xzK5-^~IQB0V&`Zl3
z+R1Cl|CVv`FGLi$^i*Qmt^uj(=__~s&!H;zU&M|X_$19IoZVcmRWh;ey_5g4klXgL
z&rw!EOj%Ba)0o}cZX=kFvEsY8OJlr#qiDfsQ|L_SjwHhRxQARg
zpBI#j9^l(<8ECm8YG%?x^E$e)%
z?});WG&d7i#`!3G^LBT3app2e7@aI_2h#=Ni8WdUtw;Wl{m>PH5TAyiewFr)`6xvf
zNA3UsPkcUz^X2_8reNAWgRM~XvcBBq?XqqbLS{?>*frMlEntmGY*L^@<0k_%%%qZA
zl`B+eRSPeCUR>ObN1PL&h0!GXOz)#~BXwb6m?lqU*hZ%&_q;z&TH;xd1*bwP{oH?t%^b7O6=ffnLSf^_9D8In0l!~T9#hElPnXr~-LyZM`Y(NTB
z2w9>IrVfe=w&IYdCwkVlf2cc%;D%(A%p^H>hB=RXARtb|REx)ppqhtRR+Nz*pf0NInvP0shpu(lwuoZ5*ty4s+X(%2`bgl}8$4TZ%mtaoG`
z)cJUazRg6X$3VkZC><0QdGwJqYvQjVXsm1J-gY;hyb=NTo-U9(fjInV*XuQ=Rkdo|=W)&J9VA3?H1EE9$wKKHH4f9|DCwAcE;7W_(
zrol$Tw6iNmVkg5m*(>MZDe4cGG;7XaWNwJy^VQ|;79=B)y-q+%hxMu-qPZIh+8mA1
z0?0Q*{p`>0>i&>J(KEcf*WKX3|E61_6>b-=gDlVCI1`#;^{aWq$m@bh8~4zdGaT<)
z5N==%5?~P2YEMmU-y4p4-ZSit-ZBUf_#P$R)!LiBbXs1U<({hh0rsp$cA70fnLX7I
zjC^-?dqAgLdl_f*3jyD&LCE?7g1Q$@@v=KuaS0aE4iPqy6bDE(wyKeQ)!KZpLup^1
zsgzi`?(mcjJAD4NQHAk4bbaF#cCB6?NXcFcHxo~DncF>nly6ELEoDe4Zj_U5w)A8o
zV_DOhuTvS^wk`8hi*I>Q=fkr4(vv?_mv4M=wsv&