Skip to content

Commit

Permalink
Retrofit because I forgot to merge for two weeks (#764)
Browse files Browse the repository at this point in the history
* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee6.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310.

---------

Co-authored-by: Chase-Grajeda <chase.grajeda@gmail.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Skyscrapers Test Suite (#708)

* Simplify rule names

* Contradiction Test Suite

* checkstyle

* Update Exporter

* Revert "Update Exporter"

This reverts commit bae1a1f.

* Case Rule Test Suite

* Update SkyscrapersExporter.java

* allow null transitions

* Update TreeTransition.java

* Direct Rule Test Suite

* added tests pass

* Update DirectRule.java

Commenting out print statement

---------

Co-authored-by: ThisMatt <popem@rpi.edu>
Co-authored-by: ThisMatt <98851950+ThisMatt@users.noreply.github.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Update ThermometerBoard.java

* Skyscrapers puzzle editor (#720)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee6.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310.

---------

Co-authored-by: Chase-Grajeda <chase.grajeda@gmail.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Implementing Puzzle Editor

Removing Extraneous TreeTent Code
Allowing setting tile number

* Allow for editing clues on all axies

* Remove Extraneous Code

Removed functionality required for TreeTent but unnecessary for Skyscrapers

* Remove Extraneous Code

* Clue Tile in Editor

Editor now requires selecting the clue tile to edit clues
Added images for the tiles

* Merge branch 'dev' into skyscrapersPuzzleEditor

* Checkstyle Requirement

* Necessary Code

* Allow for test functionality

---------

Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Co-authored-by: Chase-Grajeda <chase.grajeda@gmail.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Created element files

* Element/rule images

* Java Autoformatter (#728)

* Create java-autoformat.yml

* Setup Java

* Run spotless on repository

* Adding spotless dependency during build

* Adding spotless dependency during build

* Give permissions to run spotless

* Syntax

* Adding Debug Tag

* Check for modified files

Also removed debug tag

* Automated Java code formatting changes

* Test command syntax

* Correctly Identify modified files

* Test autoformatter

* Test autoformatter

* Test autoformatter

* Debugging

* Debugging

* Change method for detecting changed files

* Try building before calling spotless

* Update java-autoformat.yml

* Update java-autoformat.yml

* Update java-autoformat.yml

* Purposely bad formatting

Purposely adding some bad formatting to see if the auto-formatter triggers

* Update build.gradle

Disabling Checkstyle in build so the auto-formatter can trigger

* Update java-autoformat.yml

Have auto-formatter trigger when more commits are added to a pull request

* Debugging

* Adding more awful formatting

* Update java-autoformat.yml

* Changing repo URL

* Going back to checkout v1

* Trying URL change

* Trying out using env

* Trying this now...?

* Introducing more horrible changes

* Spotless formatting using google format v1.19.2

* Manual formatting fix

* Automated Java code formatting changes

* Different format type

Trying to get it to pass checkstyle

* Disable checkstyle temporarily

* Automated Java code formatting changes

* Default google formatting style

* Automated Java code formatting changes

* Comments and reordering styles

* Adding extra newlines

* Automated Java code formatting changes

* Changing tabs from 2 to 4 spaces

Supposedly the only difference that aosp makes is the 2 spaces?
Hopefully it doesn't break anything else

* Remove solo } requirement and reactivate checkstyle

* Automated Java code formatting changes

* Update checkstyle.xml

Removed problematic LeftCurly and RightCurly requirements

* Changing back to tabWidth

* Add newline to test formatter + build

* Automated Java code formatting changes

* Trying some ChatGPT stuff

* Getting rid of problematic experimentation

---------

Co-authored-by: Bram van Heuveln <bram28@users.noreply.github.com>
Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Co-authored-by: charlestian23 <charles.tian23@gmail.com>

* Java21 (#714)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee6.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310.

---------

Co-authored-by: Chase-Grajeda <chase.grajeda@gmail.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>

* Change Java version to 21 and setup JPackage to bundle Java with the app

* Setup gradle action for java 21

* Fix distribution in gradle.yml

* Fix java version in tests

* Fix java distribution in tests

* Add jpackage task

* Add Linux to jpackage task

* Fix jpackage task

* Add java setup to jpackage tasks

* Separate build into separate tasks for different operating systems

* Fix mac jpackage not working and changed names of artifacts

* Potential macos installer build fix

* Potential macos installer build fix attempt 2

* Potential macos installer build fix attempt 3

* Add quotes around executable name for macos installer

* Add logo and shortcut prompt

* Update version in build.gradle

* Make installer name different to app (It's a weird way to do it, it renames the file in a gradle task).

* Update java-autoformat.yml

Added check to make sure the pull request is not from a fork

---------

Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Co-authored-by: Chase-Grajeda <chase.grajeda@gmail.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>
Co-authored-by: charlestian23 <charles.tian23@gmail.com>

* Update build.gradle (#741)

* Update build.gradle

Fixing the deprecation issues in the autoformatter

* Update build.gradle

* Update build.gradle

* Update to use Java 21

* Automated Java code formatting changes

---------

Co-authored-by: Bram van Heuveln <bram28@users.noreply.github.com>

* Updating to version 6.0.0

Changing to 6.0.0 since Java upgrade may break backwards compatibility

* Too many mercury 1st draft

* Too few mercury contradiction rule

* error fixes

* misc cleanup

* Starting on case rules

* Rest is Empty direct rule and getHead for vials

* Prior is filled rule and getTail functionality

* Prior filled small fix

* Retrofit because I forgot to merge for 2 weeks

* Rest empty quick fix

---------

Co-authored-by: Charles Tian <46334090+charlestian23@users.noreply.github.com>
Co-authored-by: Chase-Grajeda <chase.grajeda@gmail.com>
Co-authored-by: Chase Grajeda <76405306+Chase-Grajeda@users.noreply.github.com>
Co-authored-by: ThisMatt <popem@rpi.edu>
Co-authored-by: ThisMatt <98851950+ThisMatt@users.noreply.github.com>
Co-authored-by: Jaden Tian <56417002+jadeandtea@users.noreply.github.com>
Co-authored-by: Bram van Heuveln <bram28@users.noreply.github.com>
Co-authored-by: charlestian23 <charles.tian23@gmail.com>
Co-authored-by: Fisher Luba <145061313+FisherLuba@users.noreply.github.com>
  • Loading branch information
10 people authored Mar 15, 2024
1 parent 11179a8 commit fc95133
Show file tree
Hide file tree
Showing 19 changed files with 251 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public boolean containsCell(ThermometerCell cell){
return false;
}

public ThermometerCell getHead(){return cells.get(0);}
public ThermometerCell getTail(){return cells.get(cells.size());}

//checking for discontinuous flow inside of vial
public boolean continuousFlow(){
//bool which is true until it runs into an empty/blocked cell in the vial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class HeadTileBlck extends PlaceableElement {
public HeadTileBlck(){
super("Therm-PLAC-0003", "Head Tile Block", "The tile corresponding to the blocked head of a thermometer", "edu/rpi/legup/images/thermometer/HeadBlock.png");
super("Therm-PLAC-0003",
"Head Tile Block",
"The tile corresponding to the blocked head of a thermometer",
"edu/rpi/legup/images/thermometer/HeadBlock.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class HeadTileEmp extends PlaceableElement {
public HeadTileEmp(){
super("Therm-PLAC-0001", "Head Tile Empty", "The tile corresponding to the empty head of a thermometer", "edu/rpi/legup/images/thermometer/HeadEmp.png");
super("Therm-PLAC-0001",
"Head Tile Empty",
"The tile corresponding to the empty head of a thermometer",
"edu/rpi/legup/images/thermometer/HeadEmp.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class HeadTileFill extends PlaceableElement {
public HeadTileFill(){
super("Therm-PLAC-0002", "Head Tile Filled", "The tile corresponding to the filled head of a thermometer", "edu/rpi/legup/images/thermometer/HeadFill.png");
super("Therm-PLAC-0002",
"Head Tile Filled",
"The tile corresponding to the filled head of a thermometer",
"edu/rpi/legup/images/thermometer/HeadFill.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class ShaftTileBlck extends PlaceableElement {
public ShaftTileBlck(){
super("Therm-PLAC-0006", "Shaft Tile Blocked", "The tile corresponding to a Blocked middle segment of a thermometer", "edu/rpi/legup/images/thermometer/ShaftBlock.png");
super("Therm-PLAC-0006",
"Shaft Tile Blocked",
"The tile corresponding to a Blocked middle segment of a thermometer",
"edu/rpi/legup/images/thermometer/ShaftBlock.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class ShaftTileEmp extends PlaceableElement {
public ShaftTileEmp(){
super("Therm-PLAC-0004", "Shaft Tile Empty", "The tile corresponding to an empty middle segment of a thermometer", "edu/rpi/legup/images/thermometer/ShaftEmp.png");
super("Therm-PLAC-0004",
"Shaft Tile Empty",
"The tile corresponding to an empty middle segment of a thermometer",
"edu/rpi/legup/images/thermometer/ShaftEmp.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class ShaftTileFill extends PlaceableElement {
public ShaftTileFill(){
super("Therm-PLAC-0005", "Shaft Tile Filled", "The tile corresponding to a filled middle segment of a thermometer", "edu/rpi/legup/images/thermometer/ShaftFill.png");
super("Therm-PLAC-0005",
"Shaft Tile Filled",
"The tile corresponding to a filled middle segment of a thermometer",
"edu/rpi/legup/images/thermometer/ShaftFill.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class TipTileBlck extends PlaceableElement {
public TipTileBlck(){
super("Therm-PLAC-0009", "Tip Tile Block", "The tile corresponding to the Blocked tip of a thermometer", "edu/rpi/legup/images/thermometer/TipBlock.png");
super("Therm-PLAC-0009",
"Tip Tile Block",
"The tile corresponding to the Blocked tip of a thermometer",
"edu/rpi/legup/images/thermometer/TipBlock.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class TipTileEmp extends PlaceableElement {
public TipTileEmp(){
super("Therm-PLAC-0007", "Tip Tile Empty", "The tile corresponding to the empty tip of a thermometer", "edu/rpi/legup/images/thermometer/TipEmp.png");
super("Therm-PLAC-0007",
"Tip Tile Empty",
"The tile corresponding to the empty tip of a thermometer",
"edu/rpi/legup/images/thermometer/TipEmp.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class TipTileFill extends PlaceableElement {
public TipTileFill(){
super("Therm-PLAC-0008", "Tip Tile Fill", "The tile corresponding to the filled tip of a thermometer", "edu/rpi/legup/images/thermometer/TipFill.png");
super("Therm-PLAC-0008",
"Tip Tile Fill",
"The tile corresponding to the filled tip of a thermometer",
"edu/rpi/legup/images/thermometer/TipFill.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class DiscontinuousMercuryContradictionRule extends ContradictionRule{
private final String INVALID_USE_MESSAGE = "Contradiction must be a vial";

public DiscontinuousMercuryContradictionRule() {
super("DiscontinuousMercury",
super("THERM-CONT-0003",
"Discontinuous Mercury",
"A vial has a filled cell after an empty or blocked cell",
null);
"edu/rpi/legup/images/thermometer/MercuryInBody.png");
}


Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class MercuryOrBlockedCaseRule extends CaseRule {
public MercuryOrBlockedCaseRule() {
super("MOB",
super("THERM-CASE-0001",
"Mercury or Blocked",
"Each unassigned tile must be filled with mercury or blocked.",
"edu/rpi/legup/images/thermometers/cases/MercuryOrBlocked.png");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package edu.rpi.legup.puzzle.thermometer.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.thermometer.ThermometerBoard;
import edu.rpi.legup.puzzle.thermometer.ThermometerCell;
import edu.rpi.legup.puzzle.thermometer.ThermometerFill;
import edu.rpi.legup.puzzle.thermometer.ThermometerVial;

import java.util.ArrayList;

public class PriorFilledDirectRule extends DirectRule {

public PriorFilledDirectRule() {
super(
"THERM-BASC-0002",
"Prior is Filled",
"All tiles proceeding a filled tile in a vial must be filled",
"edu/rpi/legup/images/Thermometer/PriorIsFilled.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) {
ThermometerBoard initialBoard = (ThermometerBoard) transition.getParents().get(0).getBoard();
ThermometerBoard finalBoard = (ThermometerBoard) transition.getBoard();

ThermometerCell cell = (ThermometerCell) finalBoard.getPuzzleElement(puzzleElement);
if (cell.getFill() != ThermometerFill.FILLED) {
return super.getInvalidUseOfRuleMessage() + ": Cell is not filled at this index";
}

ArrayList<ThermometerVial> allVials = finalBoard.getVials();
ThermometerVial host = null;
for(ThermometerVial vials: allVials){
if(vials.containsCell((cell))){
host = vials;
}
}
if(host == null) return super.getInvalidUseOfRuleMessage() + ": Something went wrong - 1";
int x = (int)cell.getLocation().getX();
int y = (int)cell.getLocation().getX();

//Identifies next cell from tail location, checks if it is filled
if(host.getTail() == cell){
return super.getInvalidUseOfRuleMessage() + ": rule can not apply to tail";
}else if(host.getTail().getLocation().getX() == x){
if(host.getTail().getLocation().getY() > y){
if(initialBoard.getCell(x, y + 1).getFill() == ThermometerFill.FILLED){
return null;
} else{
return super.getInvalidUseOfRuleMessage() + "rule does not apply to this cell";
}
}else if(host.getTail().getLocation().getY() < y){
if(initialBoard.getCell(x, y - 1).getFill() == ThermometerFill.FILLED){
return null;
} else{
return super.getInvalidUseOfRuleMessage() + "rule does not apply to this cell";
}
} else return super.getInvalidUseOfRuleMessage() + ": Something went wrong - 2";
}else if(host.getTail().getLocation().getY() == y){
if(host.getTail().getLocation().getX() > x){
if(initialBoard.getCell(x + 1, y).getFill() == ThermometerFill.FILLED){
return null;
} else{
return super.getInvalidUseOfRuleMessage() + "rule does not apply to this cell";
}
}else if(host.getTail().getLocation().getX() < x){
if(initialBoard.getCell(x - 1, y).getFill() == ThermometerFill.FILLED){
return null;
} else{
return super.getInvalidUseOfRuleMessage() + "rule does not apply to this cell";
}
} else return super.getInvalidUseOfRuleMessage() + ": Something went wrong - 2.1";
}
return super.getInvalidUseOfRuleMessage() + "Something went wrong - 3";
}

@Override
public Board getDefaultBoard(TreeNode node) {return null;}
}
Loading

0 comments on commit fc95133

Please sign in to comment.