Solitaire simulator for finding the best strategy: Current record is 8.590%

Posted by PaulHoule 1 day ago

Counter48Comment23OpenOriginal

Comments

Comment by advisedwang 16 hours ago

Per [1] (found via wikipedia) 35% is possible!

[1] https://web.archive.org/web/20210924183919/https://www.aaai....

Comment by dacracot 30 minutes ago

New PR with unconfirmed claim of 12.188%. Will review and confirm soon.

Comment by reenorap 16 hours ago

Isn't 8.5% low?

My mom didn't use the computer much except she did play solitaire on her Windows laptop all the time. She had over a 2000 game win streak until she got dementia and stopped using the computer altogether.

Comment by InitialLastName 16 hours ago

Draw 1 is much more winnable than draw 3. With perfect knowledge (or an infinite undo stack), evidently ~80% of Klondike games are winnable. With imperfect knowledge but good strategy, humans win about 11% of draw 3 games. So given they have implemented a more rudimentary strategy (first come, first serve), 8.5% doesn't seem that low.

Comment by fishtoaster 16 hours ago

Winning 2000 games in a row sounds statistically unlikely unless the Windows version of solitaire does something behind the scenes to make the game more winnable.

https://en.wikipedia.org/wiki/Klondike_(solitaire)#Probabili...

Comment by InitialLastName 16 hours ago

I suspect that the later (Win 7+) versions of Windows solitaire (and minesweeper, for that matter) did, in fact, cull the unwinnable games.

Comment by jasperry 15 hours ago

I don't know of any algorithm to cull non-winnable Klondike games. Playing deal-1 instead of deal-3, and with unlimited flipping of the stock, the win chance is probably close to 50%, but that still makes 2000 in a row statistically impossible.

My guess is that the poster's mom was actually playing FreeCell, in which nearly every game is winnable and people do get streaks like that.

Comment by chocochunks 13 hours ago

You don't need an algorithm. You can just record seeds that are solvable. The current version of Klondike in MS Solitaire is winnable unless you play "Random" difficulty.

Comment by npinsker 15 hours ago

It’s quite doable, if you don’t mind culling some winnable games too. The object isn’t to have a perfect classifier.

Comment by reenorap 10 hours ago

As someone else mentioned I got it mixed up, it was FreeCell not Solitaire!

Comment by estimator7292 14 hours ago

The Microsoft Solitaire Pack or whatever the current branding is does, indeed do something behind the scenes to ensure the game is winnable.

I suspect they have either a massive database of proven-winnable shuffles, or before the game presents a new deck to you, it solves it in the background to prove it's winnable.

Personally I dislike this feature. Yeah it sucks to get an unwinnable shuffle, but that's just how card games work. Ensuring every game is winnable just seems like addiction engineering when it's next to the Microsoft logo.

Part of the fun is the uncertainty that a game is possible to win. If you know up front that a deck is guaranteed solvable, it really colors how you play the game.

Comment by 7bit 53 minutes ago

I appreciate it. When I play, I want a challenge that's solvable. It still is hard to actually solve it, so it remains a challenge.

Only because you can't do that with real cards, doesn't mean that's preferable or superior.

Comment by moron4hire 14 hours ago

Part of the mechanism of psychological addiction is unreliable, intermittent rewards. People feel like they are in control but can't figure out the optimal win strategy. One effective means of treating gambling addiction is to just teach people how to get good at gambling. It removes the mystery of the system and puts the subject back in control. So, making every hand winnable may actually help to make the game less addictive.

Comment by bluedino 15 hours ago

The current version, you can play on 'Easy', I think my kindergartner wins all his games on that setting.

Comment by dezgeg 15 hours ago

Could there be mixup with FreeCell?

Comment by reenorap 10 hours ago

Whoops you're right it was FreeCell! I totally got those mixed up but yes it was FreeCell that she got 2000+ games in a row, she was very proud of that. She didn't even want me to play on her computer in case I ruined her streak LOL

Comment by bluefirebrand 15 hours ago

It wouldn't be that difficult to make computer solitaire winnable 100% of the time actually. It would mean "cheating" by moving cards around behind the scenes though

There's an assumption with computer card games that the computer shuffles the deck once just like a real card game but that doesn't have to be true on the computer if you don't want it to be

Now, any reasonable player would notice if you reshuffle the deck in solitaire, but you could swap around the face down cards without any problem. You could have just one stack of face down cards in memory and always pop from the top when a card is flipped

Edit: Maybe this wouldn't be winnable 100%, but you could certainly nudge every hand towards being winnable

Comment by embedding-shape 16 hours ago

Similarly, my half-sister's mother was almost allergic to anything technology, except for to play Solitaire, which she did every single day. I think many of the games offer configurable "difficulty" though, there are modes where it's guaranteed to be solvable for example. And most of them surely are made slightly easier by default.

With a randomly shuffled real deck, wouldn't surprise me that it would be ~10%,.

Comment by dacracot 13 hours ago

Yes, it is low, but that is the challenge to fork the repo and up the winning percentage.

Comment by stronglikedan 13 hours ago

Low for a human, yes. But for a computer simulation, it's a record high.

Comment by rotexo 10 hours ago

I love seeing this. Klondike with a physical deck was my “I need to do something with my hands or I’ll go crazy” release valve during the pandemic after work. I thought about trying to build something like this, but it was far outside of my technical ability. I settled for a simulator that would run toilet solitaire so I could see the distribution of cards remaining after games with a well-shuffled deck.

Comment by Hackbraten 12 hours ago

What is 8.590% of what?

Comment by joseda-hg 10 hours ago

Chance of winning a random deck