Skip to content

Commit

Permalink
EmptyCellinLight tested (#696)
Browse files Browse the repository at this point in the history
* BulbsInPathContradictionRuleTest looks good. I added one more function to check for the BlockInHorizontalPath test case.

* I think I might have run into a problem on the testing function. I will confirm this problem next time and will write another test case.

* I made another puzzle and test case to check what would happen if the cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases.

* I made another puzzle and test case to check what would happen if the cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases.

* Test suite branch -- BulbsInPathContradictionRuleTest (#674)

* Region Based Changes (#559)

Co-authored-by: Hanson Gu <[email protected]>

* Short Truth Table Puzzle Editor (#451)

* Created files for STT elements

* Renamed Tiles classes to Elements to match package name

Also added an elements reference sheet and renamed rules reference sheet accordingly

* More progress made

This won't compile, just saving progress made

* More progress being made

* Fixed file name typo and added placeholder tiles

* Added image paths

* Created element classes and added placeholder tile images (#452)

* Renamed Tiles classes to Elements to match package name

Also added an elements reference sheet and renamed rules reference sheet accordingly

* More progress made

This won't compile, just saving progress made

* More progress being made

* Fixed file name typo and added placeholder tiles

* Added image paths

* Set the current board on boardView

* Fixed typo and turned on STT puzzle editor for testing

* Added preliminary valid dimensions checker

This will most definitely change in the future, hopefully can change to accept a number of statements

* Fixed image file paths

* Added ActionListener

Allows us to determine what puzzle is selected by the user

* Hide rows and columns input for Short Truth Table

* Added text area for Short Truth Table

* Added scrollbars to show up as needed

* Reformatted code

* More code reformatting

* Even more reformatting

* Separate the data from the TextArea into different lines

* Did some researching/testing

Tested certain variable values with a STT file with no true/false values

* Made more progress

Added new methods to handle creating Short Truth Table boards from an array of strings

* Added a bunch of TODOs

- Implemented a couple functions to be used later
- Added a bunch of TODO comments for future work

* Made some more progress

* Implemented abstract methods from PuzzleImporter

* Added abstract methods to Fillapix and added other exception reporting

* CheckStyle formatting

* Removed a TODO comment

* Statements show up in puzzle editor

Fixed a bug where the importer was not properly being initialized. Statements now show up in the puzzle editor.

* Removed empty statements

* Changed InvalidFormatException to IllegalArgumentException

* Remove argument that has already been caught

* Removed elements that will not be used

* Added puzzle editor cell clicking functionality

* Added ability to toggle certain logical elements

* New icons and more functionality implemented

* Fixed a bug where spacer rows could be modified

* Added statement error checking

* Fixed formatting

* Only one logic symbol element needed

* Changed InputMismatchException to UnsupportedOperationException

* Renamed variables to not be STT specific

* Finding initial issue and starting fix

* Issue is statement copying and modifying

* STT exporter now working. Overrode setCell for STTBoard.

* Added code documentation

* removed testing println()

* Gradle fixes

* Revert "Merge pull request #545 from MMosley502/puzzle_editor-short_truth_table-file_saving"

This reverts commit 2e82547, reversing
changes made to beb60a2.

* Saving files now works

* Fixed the blank element to be categorized as a placeable element

* Fixed a bug where file wouldn't save due to batch grader updates

* Reformatted code in STT

* Reformatted code again

* MORE REFORMATTING

Pls like my code CheckStyle

---------

Co-authored-by: Matthew Mosley <[email protected]>
Co-authored-by: MMosley502 <[email protected]>

* Have null changes be valid and fix IsolatedBlackContradicitonRule error message (#561)

* Get Tests to be called

Revert "Create first cypress test template"

This reverts commit 3e50909.

First commit

Finish Lightup tests

* Add more tests

Update TestRunner.java

* Somehow ended up in the wrong spot

Fix Import

* Please let this be the fix

Update TreeTransition.java

Update TreeTransition.java

Update DirectRule.java

Check to see which is not correct

Update ElementController.java

Revert "maybe the null is making it think that it's not valid"

This reverts commit 7bf1de0d66ced6749ee37fbb9c252636b2fcdc79.

Just trying to change color

Revert "Just trying to change color"

This reverts commit ec44695ee578d664055d135a668927a0fd900f5d.

Revert "maybe the null is making it think that it's not valid"

This reverts commit 3f162fbdc32e6fbd23da321a14a6af96f0ff520d.

Check to see which is not correct

Revert "Check to see which is not correct"

This reverts commit 136b0a41b9d103e6f3e9a7f8cd5d970bf76b050b.

Update TreeTransition.java

Update TreeTransition.java

Revert "Update TreeTransition.java"

This reverts commit cde45bb9001cfbfa4f6e2a49b4e9990d2fa7ad33.

* Fix error with isolated Black

Fix error message with isolated black

* Removed excess whitespace and imports. Added short JavaDoc for `TestRunner.java`

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Corppet <[email protected]>

* Fixed a bug

* Update BlackTile.java

Black tile should not be placeable

* Added unknown tile stuff

* ID error

* Some Fixes to Recently Discussed UX Bugs (#563)

* frame and panels default sizes, default pos on screen

* hardcoded version number

* homepanel default size

* set panels' own sizes

* some changes

* Removed unused import

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Corppet <[email protected]>

* Oops pushed the wrong file

Yeah some tiles work now but this is the ID error

* Number Tile working

* Update Exporter (#627)

* Update Exporter

* Delete Test_Save

---------

Co-authored-by: Charles Tian <[email protected]>

* Create run-tests.yml

* Update run-tests.yml

* Update run-tests.yml

* Update run-tests.yml

* Update run-tests.yml

* Windows things

* Added print messages

* More Windows things

* Debugging

* Update run-tests.yml

* Update run-tests.yml

* Maybe this will work now?

* Didn't work

* Update run-tests.yml

* Update run-tests.yml

* Create DummyTest.java

For debugging purposes

* Added another dummy test

* Update run-tests.yml

* Update run-tests.yml

Get rid of all this info

* Deleted the dummy tests

* BulbsInPathContradictionRuleTest looks good. I added one more function to check for the BlockInHorizontalPath test case.

* I think I might have run into a problem on the testing function. I will confirm this problem next time and will write another test case.

* I made another puzzle and test case to check what would happen if the cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases.

* I made another puzzle and test case to check what would happen if the cells could actually be lit, meaning there would be no contradiction. The test case passed and so I think CannotLightACellContradictionRule works correctly for all cases.

---------

Co-authored-by: Antonio Orta <[email protected]>
Co-authored-by: Hanson Gu <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Matthew Mosley <[email protected]>
Co-authored-by: MMosley502 <[email protected]>
Co-authored-by: Viane Matsibekker <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Corppet <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>

* Revert "Test suite branch -- BulbsInPathContradictionRuleTest (#674)" (#687)

This reverts commit 6afa15c.

* Finished testing EmptyCellinLightDirectRule. I editet the test puzzle to include testing if a cell is unknown and changed the test code accordingly.

* Forgot to remove this print statement

* Forgot to remove this print statement as well

* Finished testing EmptyCornersDirectRuleTest. Testing in case the rules was not being used correctly was not done so I remade the puzzle for the test and changed the testing code accordingly.

* Reverted changes to make another branch to make pull request.

---------

Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: Antonio Orta <[email protected]>
Co-authored-by: Hanson Gu <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Matthew Mosley <[email protected]>
Co-authored-by: MMosley502 <[email protected]>
Co-authored-by: Viane Matsibekker <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Corppet <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
  • Loading branch information
12 people authored Dec 13, 2023
1 parent ca9fef9 commit 4df66c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,33 @@ public void EmptyCellinLightDirectRule() throws InvalidFileFormatException{
cell7.setData(LightUpCellType.EMPTY.value);
board.addModifiedData(cell7);

LightUpCell cell8 = board.getCell(3,0);
cell8.setData(LightUpCellType.EMPTY.value);
board.addModifiedData(cell8);

LightUpCell cell9 = board.getCell(3,2);
cell9.setData(LightUpCellType.EMPTY.value);
board.addModifiedData(cell9);

LightUpCell cell10 = board.getCell(2,3);
cell10.setData(LightUpCellType.EMPTY.value);
board.addModifiedData(cell10);

LightUpCell cell11 = board.getCell(0,3);
cell11.setData(LightUpCellType.EMPTY.value);
board.addModifiedData(cell11);

//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
//cells (0,0) and (2,2) are not empty because they have lightbulbs, (1,1)
//because it is a black tile, and (1,3),(3,1),(3,3) because they are not lit. 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)){
if ((i == 0 && j == 0) || (i == 2 && j == 2) || (i == 1 && j == 1) || (i == 1 && j == 3) || (i == 3 && j == 1)
|| (i==3 && j==3)){
Assert.assertNotNull(RULE.checkRuleAt(transition, c));
}
else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Legup>
<puzzle name="LightUp">
<board width="3" height="3">
<board width="4" height="4">
<cells>
<cell value="0" x="1" y="1"/>
<cell value="-4" x="0" y="0"/>
Expand Down

0 comments on commit 4df66c8

Please sign in to comment.