Feb. 24th, 2006

davidn: (bald)
There's been good news with the project today, because I finally got around to putting in a hashmap so that the program could quickly check for duplicated states instead of having to trawl through a gigantic path tree each time. Just ignore that last sentence and have a look at the screenshot.

Quite a wide screenshot )

So basically, the program reads in a rules file and represents piles of cards as they're shown there (I may make them look slightly more like cards if I ever feel like it). On a click of the Solve button, the other window pops up as the program attempts to find a path to a state where all the cards are in the foundations at the top right, while paying attention to all the rules that have been laid out.

If it finds one, it reports how many moves it took to get there and fills the solution list with the moves that it made. These can be stepped through with the "Do" button, or alternatively the "Play" button can be pressed and the cards will swap around and zoom into the foundations unaided. You can guess what the rest of the buttons do for yourself.

It's matured a lot from the initial prototype I made months ago that could intermittently solve games involving moving three cards around at random. In fact, it can now solve full Freecell reasonably easily - I'd say there was about a 50-50 chance of it working (though I still use my "Easy Freecell" game for testing, just to be safe).

I also wanted to save this screenshot in particular because it's an example of a reasonably difficult game, with a lot of low cards buried near the base of the tableau. It took 444 moves to solve it in the end, which is pretty high compared to the average 120-160, but I'm not about to find out if there are any better solutions by hand.

Expand Cut Tags

No cut tags

May 2020

S M T W T F S
     12
3456789
1011121314 15 16
171819 20 212223
24252627 28 2930
31      

Most Popular Tags

Style Credit

Page generated Aug. 28th, 2025 06:07 pm
Powered by Dreamwidth Studios