-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #832 from summerhenson/star-battle
Star battle
- Loading branch information
Showing
9 changed files
with
345 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/test/java/puzzles/starbattle/rules/ColumnsWithinRegionsDirectRuleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package puzzles.starbattle.rules; | ||
|
||
import edu.rpi.legup.model.tree.TreeNode; | ||
import edu.rpi.legup.model.tree.TreeTransition; | ||
import edu.rpi.legup.puzzle.starbattle.StarBattle; | ||
import edu.rpi.legup.puzzle.starbattle.StarBattleBoard; | ||
import edu.rpi.legup.puzzle.starbattle.StarBattleCell; | ||
import edu.rpi.legup.puzzle.starbattle.StarBattleCellType; | ||
import edu.rpi.legup.puzzle.starbattle.rules.ColumnsWithinRegionsDirectRule; | ||
import edu.rpi.legup.save.InvalidFileFormatException; | ||
import java.awt.*; | ||
import legup.MockGameBoardFacade; | ||
import legup.TestUtilities; | ||
import org.junit.Assert; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
public class ColumnsWithinRegionsDirectRuleTest { | ||
|
||
private static final ColumnsWithinRegionsDirectRule RULE = new ColumnsWithinRegionsDirectRule(); | ||
private static StarBattle starbattle; | ||
|
||
@BeforeClass | ||
public static void setUp() { | ||
MockGameBoardFacade.getInstance(); | ||
starbattle = new StarBattle(); | ||
} | ||
|
||
//single column w/in single region one square outside | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...test/resources/puzzles/starbattle/rules/ColumnsWithinRegionsDirectRule/OneColumnOneSquare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="3" puzzle_num="1"> | ||
<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="0" y="2"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="0"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="2"/> | ||
<cell value="0" x="1" y="2"/> | ||
<cell value="0" x="2" y="1"/> | ||
<cell value="0" x="1" y="1"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |
29 changes: 29 additions & 0 deletions
29
...sources/puzzles/starbattle/rules/ColumnsWithinRegionsDirectRule/OnePartialColumnOneSquare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="3" puzzle_num="1"> | ||
<region> | ||
<cells> | ||
<cell value="-1" x="0" y="0"/> | ||
<cell value="0" x="1" y="0"/> | ||
<cell value="0" x="1" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="0" y="1"/> | ||
<cell value="0" x="0" y="2"/> | ||
<cell value="0" x="1" y="2"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="2"/> | ||
<cell value="0" x="2" y="0"/> | ||
<cell value="0" x="2" y="1"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |
29 changes: 29 additions & 0 deletions
29
...ources/puzzles/starbattle/rules/ColumnsWithinRegionsDirectRule/OnePartialColumnTwoSquares
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="3" puzzle_num="1"> | ||
<region> | ||
<cells> | ||
<cell value="0" x="0" y="0"/> | ||
<cell value="-1" x="1" y="0"/> | ||
<cell value="0" x="2" y="0"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="0" y="1"/> | ||
<cell value="0" x="1" y="1"/> | ||
<cell value="0" x="2" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="0" y="2"/> | ||
<cell value="-1" x="1" y="2"/> | ||
<cell value="0" x="2" y="2"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |
40 changes: 40 additions & 0 deletions
40
src/test/resources/puzzles/starbattle/rules/ColumnsWithinRegionsDirectRule/TwoColumns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="4" puzzle_num="1"> | ||
<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="2" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="0" y="2"/> | ||
<cell value="0" x="1" y="2"/> | ||
<cell value="0" x="2" y="2"/> | ||
<cell value="0" x="0" y="3"/> | ||
<cell value="0" x="1" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="0"/> | ||
<cell value="0" x="3" y="0"/> | ||
<cell value="0" x="3" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="3" y="2"/> | ||
<cell value="0" x="2" y="3"/> | ||
<cell value="0" x="3" y="3"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |
40 changes: 40 additions & 0 deletions
40
src/test/resources/puzzles/starbattle/rules/TooFewStarsContradictionRule/NotEnoughSpace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="4" puzzle_num="5"> | ||
<region> | ||
<cells> | ||
<cell value="-2" x="0" y="2"/> | ||
<cell value="-1" x="1" y="2"/> | ||
<cell value="-1" x="0" y="3"/> | ||
<cell value="-1" x="1" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="-1" x="2" y="2"/> | ||
<cell value="-1" x="3" y="2"/> | ||
<cell value="-2" x="2" y="3"/> | ||
<cell value="-1" x="3" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="-1" x="0" y="0"/> | ||
<cell value="-2" x="1" y="0"/> | ||
<cell value="-1" x="0" y="1"/> | ||
<cell value="0" x="1" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="0"/> | ||
<cell value="-1" x="3" y="0"/> | ||
<cell value="-1" x="2" y="1"/> | ||
<cell value="-2" x="3" y="1"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |
40 changes: 40 additions & 0 deletions
40
src/test/resources/puzzles/starbattle/rules/TooFewStarsContradictionRule/TwoStarColumn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="4" puzzle_num="2"> | ||
<region> | ||
<cells> | ||
<cell value="0" x="0" y="2"/> | ||
<cell value="0" x="1" y="2"/> | ||
<cell value="-1" x="0" y="3"/> | ||
<cell value="0" x="1" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="2"/> | ||
<cell value="0" x="3" y="2"/> | ||
<cell value="0" x="2" y="3"/> | ||
<cell value="0" x="3" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="-1" x="0" y="0"/> | ||
<cell value="0" x="1" y="0"/> | ||
<cell value="-1" x="0" y="1"/> | ||
<cell value="0" x="1" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="0"/> | ||
<cell value="0" x="3" y="0"/> | ||
<cell value="0" x="2" y="1"/> | ||
<cell value="0" x="3" y="1"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |
40 changes: 40 additions & 0 deletions
40
...resources/puzzles/starbattle/rules/TooFewStarsContradictionRule/TwoStarFalseContradiction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<Legup version="2.0.0"> | ||
<puzzle name="StarBattle"> | ||
<board size="4" puzzle_num="2"> | ||
<region> | ||
<cells> | ||
<cell value="-2" x="0" y="2"/> | ||
<cell value="-1" x="1" y="2"/> | ||
<cell value="0" x="0" y="3"/> | ||
<cell value="-1" x="1" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="-1" x="2" y="2"/> | ||
<cell value="0" x="3" y="2"/> | ||
<cell value="-2" x="2" y="3"/> | ||
<cell value="-1" x="3" y="3"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="-1" x="0" y="0"/> | ||
<cell value="-2" x="1" y="0"/> | ||
<cell value="-1" x="0" y="1"/> | ||
<cell value="0" x="1" y="1"/> | ||
</cells> | ||
</region> | ||
<region> | ||
<cells> | ||
<cell value="0" x="2" y="0"/> | ||
<cell value="-1" x="3" y="0"/> | ||
<cell value="-1" x="2" y="1"/> | ||
<cell value="-2" x="3" y="1"/> | ||
</cells> | ||
</region> | ||
</board> | ||
</puzzle> | ||
<solved isSolved="false" lastSaved="--"/> | ||
</Legup> |