Skip to content

add solvable klondike - #591

Merged
joeraz merged 2 commits into
shlomif:masterfrom
bwrightkc:deal-only-solvable-precomputed-pool
Aug 5, 2026
Merged

add solvable klondike#591
joeraz merged 2 commits into
shlomif:masterfrom
bwrightkc:deal-only-solvable-precomputed-pool

Conversation

@bwrightkc

Copy link
Copy Markdown
Contributor

Add a mode of Klondike that deals only known solvable games. Including 79,000 seeds that are known solvable (used ShootMe's Klondike-Solver). The seeds are not further broken down into difficulty ala Microsoft Solitaire, so it's a mix of difficulties at this time. Working on a "difficulty" level option/game choice in the future for Klondike.

@joeraz

joeraz commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Interesting approach. The challenge with a winnable games only option has always been that we'd need an algorithm to identify if a game is winnable, that works for all games. Or getting winnable seeds for every past, present, and future game. But this could work - at least unless someone comes up with a true winnable algorithm in the future.

I'd have to run some tests, but there are two comments I have so far:

  • There is no game rules documentation page in html-src. Even if it's a simple variant, I do not accept new games without a rules file (can be something as simple as "Like Klondike, but you always get a winnable deal"). If, like you mention in the comments, manually entering a seed could result in a non-winnable deal, this is something that should be mentioned in the documentation, so no users complain.
  • Currently, the pysollib/games folder just contains game definitions. Putting the seeds file there is a bit disorganized. Could you move it to a subfolder? That way, we'd have the architecture set up if we do more games this way in the future.

Sets up a shared spot for precomputed seed pools in case other games
get this treatment later.
@bwrightkc

Copy link
Copy Markdown
Contributor Author

Good points. Rules are in now, and moved the seeds to a solvable_seeds folder.

@joeraz

joeraz commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Okay, thanks.

I'm a little busy the next couple days, so I might not be able to do my proper testing until next week.

@bwrightkc
bwrightkc marked this pull request as draft July 30, 2026 23:25
@bwrightkc
bwrightkc marked this pull request as draft July 30, 2026 23:25
@bwrightkc
bwrightkc force-pushed the deal-only-solvable-precomputed-pool branch from 4977426 to e175640 Compare July 30, 2026 23:29
@bwrightkc

bwrightkc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Gonna change around a few more things as well, so converting back to draft. I've been testing different klondike solvers and I have another idea.

@joeraz

joeraz commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Okay. Just note that you might need to update the ID if I get back to adding new games first.

@bwrightkc
bwrightkc marked this pull request as ready for review August 3, 2026 22:39
@bwrightkc

Copy link
Copy Markdown
Contributor Author

I'm gonna go ahead and put this in for review. None of the other solvers I was working with are computationally more efficient. I had wondered about the possibility of generating a solvable game in real time, but even the faster A* solvers still are quite computationally expensive.

@joeraz

joeraz commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Right. I'd figured a good winnable game generator would either have to tie into the solvers (currently only supported for FreeCell and Black Hole variants), or leverage the existing hint logic (not reliable enough). I've toyed with those a few times, given how many times the solvable games idea comes up, but never really got anywhere.

I'll run some tests and get back to you.

@bwrightkc

Copy link
Copy Markdown
Contributor Author

There's a good one written in rust that I've been impressed with speed-wise, but I'm not at a point where I'm thinking of integrating it directly - just using it to create seeds now while I work on ranking game difficulties and digging into the research on Klondike solvability. It's honestly a bit fascinating.

@joeraz

joeraz commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Confirmed. Merging, thanks.

@joeraz
joeraz merged commit 9cd42cc into shlomif:master Aug 5, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants