Bram-Hub / LEGUP

Logic Engine for Grid-Using Puzzles - a better way to learn formal logic
GNU General Public License v3.0
34 stars 82 forks source link

[BUG] Tree Tent Cannot Reopen Saved File Containing Lines #757

Closed jadeandtea closed 7 months ago

jadeandtea commented 7 months ago

Description

After connecting a tree and a tent with a line and saving, the file no longer is valid when attempting to reopen the puzzle. Instead, the program says, "File does not exist or it cannot be read."

Steps to Reproduce

  1. Open a tree tent puzzle in the puzzle solver.

    Screenshot 2024-03-13 at 10 42 07 PM
  2. Create a tent space next to any tree on the board.

  3. Connect the newly placed tent and any adjacent tree. (Click on a tent, drag it onto an adjacent tree, then release.)

    Screenshot 2024-03-13 at 10 42 40 PM
  4. Save the file. (File > Save)

  5. Quit back to the startup menu. (File > Exit)

  6. Attempt to reopen the file you just saved.

    Screenshot 2024-03-13 at 10 43 26 PM

Expected Behavior

The puzzle should reopen in the same state in which the user last saved it at.

Screenshots

No response

Puzzle Files

examplePuzzles.zip

Additional Context

No response

jadeandtea commented 7 months ago

Seems like saving a line anywhere in the proof tree causes the puzzle file to be invalid.

jadeandtea commented 7 months ago

The problem comes from the "makeTransitionChange" function when recreating the proof tree upon importing a file. It only handles changes to cell values, but Tree Tent puzzles are a special case where lines are placed over cells. Thus, the importer denotes it as an "unknown node in transition". I do not know what the best way would be to fix this.

jadeandtea commented 7 months ago

I currently have a fix in my TreeTentTestSuite Branch and will merge as soon as I finish creating test cases for the remaining rules.