Program


What the program is

The program, Bill's Solitaire Tester, reproduces a game of Windows Solitaire. At each step in the game all possible legal moves are determined. Each of these moves are categorized and then prioritized according to a logic table. The best move is then made, and so on until the game is over.


What the program isn't

The program isn't very sophisticated. It does not "remember" cards that have previously been dealt from the deck in that it does not use this information to make decisions about subsequent moves. Nor does it "peek" under the dealt dealt stack to see the cards just dealt. In the Windows version of Solitaire a human player can do this. It has no artificial intelligence - it has no means of changing it's strategy based on previous results.

It should go without saying, but the tool does not cheat in any way or form. Unlike you or me though, it doesn't make silly mistakes.


The interface:

Download

Version 4.0 is available for download as an executable in a zip file

 

Version History

Version 4 (July 2011)

I discovered Microsoft VB 2010 Express in June 2011, and finally made the big move away from Visual Basic 6 to the VB Net framework. Converting the program to this new language gave me a really good excuse critically go through every line of code.

I started from a completely blank page with the initial objective of just concentrating on playing the game as fast as possible – so no graphics at all. The initial results were staggering. I was seeing up to 5000 games being played every second – up from 150 or so with the old VB6 version. This improvement was due far more to poor code in the old program than any intrinsic speed advantage of VB Express (which is not inconsiderable of itself).

The next step was to slowly add back in all of the “pretty” bits of the coding in such a way that the option to play at max speed was not compromised. This has now been successfully achieved, and V4.0 has pretty much all the functionality of V3.6 but with the ability to run at an incredibly fast speed to test out the different logic strategies. The logic has also been improved and the user now has more options to discriminate between moves of equal priority.


New for 3.6:

After doing some research about how the Visual Basic RND() random number generator works (and being mortally horrified by what I found out), I have now switched to using a method called the "Mersenne Twister" to generate random numbers to shuffle the deck before each game. The reason for this was: the intrinsic VB random number generator repeats the number sequence every 16.77 million numbers due to its crude algorithm; and the Mersenne Twister (apart from just sounding incredibly cool) - doesn't (more details here). Anyway, after implementing this tweak, the results didn't really change and since it didn't add any significant run time it's going to stay.


New features now available in V3.5 include:


Updates included in V3.4:


Features inherited from previous versions: