Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Star battle #836

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9e41523
Comment out nonfunctional test
summerhenson Apr 16, 2024
3abd581
Untested fix for StarBattleBoard copy function
summerhenson Jun 7, 2024
ebc20df
Start first Clashing Orbit contradiction rule test
summerhenson Jun 7, 2024
b192b79
Create 6x6 Star Battle Normal1 visualized (DO NOT OPEN AS A PUZZLE).png
offline171 Jun 11, 2024
6d8d050
Create 5x5 Star Battle Normal visualized (DO NOT OPEN AS A PUZZLE).png
offline171 Jun 11, 2024
9dff936
Fixed first clashing orbit test
summerhenson Jun 11, 2024
8d1f230
Finished Clashing Orbit contradiction rule test suite
summerhenson Jun 11, 2024
307d8ef
Start Too Few Stars contradiction rule test
summerhenson Jun 11, 2024
cd17e87
Create FalseContradiction
summerhenson Jun 14, 2024
c0fc026
Merge branch 'master' into star-battle
summerhenson Jun 14, 2024
9ef4cd4
Merge remote-tracking branch 'upstream/star-battle' into star-battle
offline171 Jun 14, 2024
7d02f11
Finish Too Few Stars contradiction rule tests
summerhenson Jun 14, 2024
d3a677e
Too Many Stars tests
offline171 Jun 14, 2024
732bc78
Too Many Stars test suite
offline171 Jun 18, 2024
1a1bf5e
Editing Blackout test
offline171 Jun 18, 2024
1203860
Basic Surround Star direct rule tests
summerhenson Jun 18, 2024
02bf6f5
Blackout Test Suite first test
offline171 Jun 18, 2024
109293b
Merge branch 'Bram-Hub:star-battle' into star-battle
summerhenson Jun 21, 2024
b222cdc
Finishing Blackout Test
offline171 Jun 21, 2024
cd42e83
Added new Surround Star direct rule test
summerhenson Jun 21, 2024
6772071
Finish with Stars
offline171 Jun 21, 2024
ac95969
Make a rule name more accurate
summerhenson Jun 21, 2024
4a1ab37
Merge pull request #828 from summerhenson/star-battle
offline171 Jun 21, 2024
d286dda
Merge branch 'Bram-Hub:star-battle' into star-battle
offline171 Jun 21, 2024
d30206d
new 2 star puzzle
offline171 Jun 25, 2024
dbbaca6
Update 10x10 Star Battle 2star Normal1.xml
offline171 Jun 28, 2024
2e6b526
Merge branch 'star-battle' of https://github.com/offline171/LEGUP int…
offline171 Jun 28, 2024
453fe30
Added Image for PushoutAdjacentDirectRule
offline171 Jul 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Legup version="2.0.0">
<puzzle name="StarBattle">
<board size="10" puzzle_num="2">
<region>
<cells>
<cell value="0" x="0" y="0"/>
<cell value="0" x="1" y="0"/>
<cell value="0" x="0" y="1"/>
<cell value="0" x="1" y="1"/>
<cell value="0" x="0" y="2"/>
<cell value="0" x="0" y="3"/>
<cell value="0" x="0" y="4"/>
<cell value="0" x="0" y="5"/>
<cell value="0" x="0" y="6"/>
<cell value="0" x="0" y="7"/>
<cell value="0" x="0" y="8"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="2" y="0"/>
<cell value="0" x="2" y="1"/>
<cell value="0" x="1" y="2"/>
<cell value="0" x="2" y="2"/>
<cell value="0" x="1" y="3"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="3" y="0"/>
<cell value="0" x="3" y="1"/>
<cell value="0" x="3" y="2"/>
<cell value="0" x="2" y="3"/>
<cell value="0" x="3" y="3"/>
<cell value="0" x="3" y="4"/>
<cell value="0" x="3" y="5"/>
<cell value="0" x="2" y="6"/>
<cell value="0" x="3" y="6"/>
<cell value="0" x="2" y="7"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="4" y="0"/>
<cell value="0" x="5" y="0"/>
<cell value="0" x="6" y="0"/>
<cell value="0" x="4" y="1"/>
<cell value="0" x="5" y="1"/>
<cell value="0" x="6" y="1"/>
<cell value="0" x="4" y="2"/>
<cell value="0" x="5" y="2"/>
<cell value="0" x="6" y="2"/>
<cell value="0" x="4" y="3"/>
<cell value="0" x="5" y="3"/>
<cell value="0" x="6" y="3"/>
<cell value="0" x="6" y="4"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="7" y="0"/>
<cell value="0" x="7" y="1"/>
<cell value="0" x="7" y="2"/>
<cell value="0" x="7" y="3"/>
<cell value="0" x="7" y="4"/>
<cell value="0" x="7" y="5"/>
<cell value="0" x="7" y="6"/>
<cell value="0" x="8" y="6"/>
<cell value="0" x="7" y="7"/>
<cell value="0" x="7" y="8"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="8" y="0"/>
<cell value="0" x="9" y="0"/>
<cell value="0" x="8" y="1"/>
<cell value="0" x="9" y="1"/>
<cell value="0" x="8" y="2"/>
<cell value="0" x="9" y="2"/>
<cell value="0" x="8" y="3"/>
<cell value="0" x="9" y="3"/>
<cell value="0" x="8" y="4"/>
<cell value="0" x="9" y="4"/>
<cell value="0" x="8" y="5"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="1" y="4"/>
<cell value="0" x="2" y="4"/>
<cell value="0" x="1" y="5"/>
<cell value="0" x="2" y="5"/>
<cell value="0" x="1" y="6"/>
<cell value="0" x="1" y="7"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="4" y="4"/>
<cell value="0" x="5" y="4"/>
<cell value="0" x="4" y="5"/>
<cell value="0" x="5" y="5"/>
<cell value="0" x="6" y="5"/>
<cell value="0" x="4" y="6"/>
<cell value="0" x="5" y="6"/>
<cell value="0" x="6" y="6"/>
<cell value="0" x="3" y="7"/>
<cell value="0" x="4" y="7"/>
<cell value="0" x="5" y="7"/>
<cell value="0" x="6" y="7"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="9" y="5"/>
<cell value="0" x="9" y="6"/>
<cell value="0" x="8" y="7"/>
<cell value="0" x="9" y="7"/>
<cell value="0" x="8" y="8"/>
<cell value="0" x="9" y="8"/>
</cells>
</region>
<region>
<cells>
<cell value="0" x="1" y="8"/>
<cell value="0" x="2" y="8"/>
<cell value="0" x="3" y="8"/>
<cell value="0" x="4" y="8"/>
<cell value="0" x="5" y="8"/>
<cell value="0" x="6" y="8"/>
<cell value="0" x="0" y="9"/>
<cell value="0" x="1" y="9"/>
<cell value="0" x="2" y="9"/>
<cell value="0" x="3" y="9"/>
<cell value="0" x="4" y="9"/>
<cell value="0" x="5" y="9"/>
<cell value="0" x="6" y="9"/>
<cell value="0" x="7" y="9"/>
<cell value="0" x="8" y="9"/>
<cell value="0" x="9" y="9"/>
</cells>
</region>
</board>
</puzzle>
<solved isSolved="false" lastSaved="--"/>
</Legup>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/starbattle/StarBattleBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,25 @@ public int rowStars(int rowIndex) {

public StarBattleBoard copy() {
StarBattleBoard copy = new StarBattleBoard(size, puzzleNum);
for (int r = 0; r < this.regions.size(); ++r) {
StarBattleRegion regionCopy = this.regions.get(r).copy();
for (StarBattleCell cell: regionCopy.getCells()) {
copy.setCell(cell.getLocation().x, cell.getLocation().y, cell);
}
copy.setRegion(r, regionCopy);
}
/*
for (int x = 0; x < this.dimension.width; x++) {
for (int y = 0; y < this.dimension.height; y++) {
copy.setCell(x, y, getCell(x, y).copy());
}

if (x < this.regions.size()) {
copy.regions.add(this.getRegion(x).copy());
}

}
*/
for (PuzzleElement e : modifiedData) {
copy.getPuzzleElement(e).setModifiable(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ public String checkContradictionAt(Board board, PuzzleElement puzzleElement) {
int rowCount = 0;
int columnCount = 0;
for (int i = 0; i < sbBoard.getSize(); ++i) {
if (sbBoard.getCell(row, i).getType() != StarBattleCellType.BLACK) {
if (sbBoard.getCell(i, row).getType() != StarBattleCellType.BLACK) {
++rowCount;
}
if (sbBoard.getCell(i, column).getType() != StarBattleCellType.BLACK) {
if (sbBoard.getCell(column, i).getType() != StarBattleCellType.BLACK) {
++columnCount;
}
}

if (rowCount < sbBoard.getPuzzleNumber() || columnCount < sbBoard.getPuzzleNumber()) {
return null;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading