Bram28 / LEGUP

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

The caching of board state and transition validity should be reworked/removed for version 1 #33

Closed daniel-bulger closed 11 years ago

daniel-bulger commented 11 years ago

The caching makes it easy for many bugs to appear in the code. This feature could be quite useful in future versions, but for the release it makes it much more difficult to develop.

aweinstock314 commented 11 years ago

BoardState.leadsToContradiction() used the "status" mechanism, which appears to be cache partial verifications. leadsToContradiction() now uses a boolean variable which is recursively set when a contradiction is applied.

aweinstock314 commented 11 years ago

The variable BoardState.status appears to have been the variable in which validity was cached. I removed the "if(status == -1)" line from BoardState.getStatus(), and as a result, getStatus() will recompute the value every time it is called.