PySolFC icon indicating copy to clipboard operation
PySolFC copied to clipboard

idea: demo / solver for simple games

Open hajo4 opened this issue 1 year ago • 1 comments

Some games have no demo, But I think it might be fairly easy to come up with an algorithm for 'simple games' like Hanoi, Matrix, and maybe LightsOut.

Where would the code for such an extension go, and should that be a solver, plugin or demo ?

Also, any advice about how to start coding for pysol ?

hajo4 avatar Oct 13 '24 11:10 hajo4

The information on how to get started contributing is in https://github.com/shlomif/PySolFC/blob/master/CONTRIBUTING.md - I can answer more specific questions you might have.

I've been wanting to get demos added to the remaining games that are currently missing them - this would help support a number of new features. To add a demo to a game that's missing one, the best place to start would be the hint logic. The demo follows the hints, and the lack of hint logic for a given game is what causes the demo to be disabled. It typically has to be disabled if the default hints have issues and we've been unable to write a custom hint class. This typically happens if the hints suggest invalid or random moves, cause the demo to get stuck in a loop, or don't work with the nature of the game in question.

Look for the line "Hint_Class = None" and replace it with a working hint class to enable the demo for that game. The hint.py file contains the abstract/default hint logic.

The solver is more for integration with solver apps such as https://fc-solve.shlomifish.org/ https://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/ - it doesn't really affect the demo unless you run the demo using the solver. And plugins are more for custom add-ins outside of the main code.

joeraz avatar Oct 13 '24 18:10 joeraz