Winnable Spider Solitaire Games



A program named plspider has played a number of games of standard Spider Solitaire.

plspider wins a typical game of Spider in a couple minutes, often floundering comically with baffling moves when the game is all but won. Perhaps surprisingly, plspider was not developed under a cost-plus defense contract.

Some of the results of plspider's play are listed below.

Inside plspider.zip are:


Installation

On a Debian/Ubuntu/etc. PC:
cd      a_directory_of_your_choice
unzip   wherever_you_put_the_zip_file/plspider.zip
cd      plspider_source

plspider    -c              # run the program forever (H or control C to quit)

cd  src                     # or switch to the plspider_source/src sub-directory
m                           # and compile the C program to plspider_source/src/plspider


Run the program

plspider    -h              # tells you command line options

plspider    -c              # plays forever random unplayed games, or lost games (interspered with occasional random won games)
plspider    -a -e -s 1234   # plays game number 1234

The program appends play results to plspider_cshd.txt or, if the command line includes the -w option, winspidr_cdhs.txt, at the end of its play. The program reads one of these files at start-time to aid in choosing random games to play.


Glossary

"Game Number"

The game number is a number that you may specify to the PySol program (Windows Version) to choose a specific deal of the cards to play.

In fact, the game number corresponds to the arrangements of the shuffled cards and to their order when dealt by the logic in the classic Windows FreeCell game. (Better FreeCell program: Freecell Pro )

plspider does not play the special game numbers -1 and -2, nor does it play the modern Window Free Cell games numbers between 32001 and 1,000,000.

Note: plspider plays Spider, not Free Cell. "game numbers" refer to the arrangements of the shuffled cards and to their order when dealt.

Below, the game number of un-won games may be followed by a number indicating the maximum number of empty stacks plspider has been able to achieve. Until the last deal, plspider is very eager to create empty stacks. On the last deal, moving cards out of play takes highest precedence.

"Moves"

The least number of moves that plspider has used to win the game.

... Or the most moves plspider has been able to make at any time in a losing game.

Note: The program also reports losing games' movements to get to the situation with the highest evaluation score of all situations found with at least one empty stack.

In won games, plspider's moves are stripped of most redundant movement.

"Time"

The shortest (won games) or longest (lost games) play-times in minutes:seconds.


Note:

Game number 14934 appears to be unwinnable. It looks like this (printout from showdeal.py):


    Game number 14934

    10S   2H   4S   QD   3D  10D   9H   AS   JS   JD
     3C   4H   3H   QH   8C  10H   3D   4D   8H   AH
     KS   KC  10C   7C   8S   3S   7D   3S   6C   5C
     4C   3H   4D   7S   2S   3C   5C   8C   QC   5S
     JH   KH   2H   QC   JH   6H   QS   2C   KD   KS
     5S             2D             6H             5D

     6D   AH  10H   9S   9C   6C   AC   6S   9D   4C
     5D   9H   6D   8D   9C   KD   AS  10D   QH   JS
     JC   4H   2S   6S   7H  10C   KH   8D   8H   AD
     5H   2C   2D   4S   8S   AC  10S   7H   5H   7C
     9D   KC   AD   QD   JC   JD   7S   7D   9S   QS

    
The visible cards after the initial deal are the 5 of spades, king of hearts, etc.
The row of cards starting with the 6 of diamonds are the first cards dealt from the stock.
The row of cards beginning with the 9 of diamonds are the last 10 cards to be dealt.

First, remember this:

If the first 10 cards showing are, say, of only two card-values (e.g. all 6's and 8's), and all 16 cards that those two cards go on top of are underneath (e.g. all the 7's and 9's have been dealt face down), then the game is unwinnable, no matter what the distribution of the rest of the cards.

A special case of this unwinnable game is when one of the two card-values are a king. In that case, only the 8 cards that the other card-value may be played on must be hidden for the game to be unwinnable.

A further variant of this type of game allows the 10 cards to be anywhere in the deal, so long as the cards they play on are in unexposable positions underneath them.

So, examine game 14934, as shown above:

Notice the positions of the 3's, 2's, kings, and 6's. All stacks but the 6th and 7th have kings or 2's in them. The stacks other than the 6th and 7th cannot be emptied unless another stack is empty (to move a king to), or unless a 3 is exposed (to move a 2 to).

Simplified, that means that, unless 3's are available for the 2's to be played on, only the 6th and 7th stacks can be emptied. (And, without an empty stack, nothing can be done but play a whole suit built up on a king ... which won't happen if a 2 cannot be played on the king's stack.)

But the only 3's available to be played on are on the 6th and 7th stacks. Unfortunately, all of these 3's are hidden by 6's ... which cannot be moved before they are covered by kings ... which cannot be moved because there are no empty stacks to move them to.


And:


    Game number 1748

     AH   3D   4S   5H   6H   6H   8H   6C   6S   8C
     6D   2C  10C   5D   6C   6D   7D   KC   3C   QC
     2H   QD   5S   7D   QS   3D   2C   5S   8S   7H
     QH   KD   8D  10S   7C   5H   3S  10D   5D   5C
     KS   QC   4H   3H   KS   QH   6S  10D   KD  10C
     9H             AD             KH             8S

    10H   7H   5C   QS   8C   9H   JD  10H   9S   KC
     QD   9C   4C   4H   AH   3H   8H   AS   JS   KH
     9D   4C   JD   AS   JH   2H   4S   7S   2D   4D
     2S   9S   4D   AD   AC   JH   JC   8D   9C   7S
     JC   2S   JS   3S   9D   3C   AC   7C   2D  10S

    
Examine the 6's and 5's. Players will have a hard time moving 5's in this game. And all stacks have 5's and kings.

Game 1748 appears unwinnable, too.


How many games are like these? That is, games that simply don't go anywhere.

Recent (April 8, 2005) versions of plspider print out whether plspider ever emptied a stack or not.

As of May 1, 2005, there are 4 games that plspider has not emptied a stack on. Games 14934 and 1748 appear to the eye to be unwinnable. Game 10957 also appeared unwinnable, but Mark Stierlin won it in 2020.

Figuring that there exist unwinnable games that a stack can be emptied in, my guess of the unwinnable rate of Spider games is now somewhere around 1 in 3000. The bounds for this guess are given by plspider's current (May 1, 2005) results: that is, there must be more than 1 in 16000 games (though 2 unwinnable games isn't a high enough number to imply that this ratio is accurate), and fewer than 1 in 500.

November 2, 2014

Things have changed. It looks more like there are only 3 unwinnable games out of the 32,000. Two other un-won games, 12177 and 24560 have the makings of being winnable.

Max Schamschula is finding convoluted means to solve games that are unquestionably hard to solve. plspider's has been recompiled with settings tuned more toward looking deep in the move tree of un-won games rather than being quick to find solutions to "normal" games. So, time will tell.

Anyway, it appears 1 in 10,000 is closer to the frequency of un-winnable, random Spider games than 1 in 3000.


Most recent game won for the first time


    Game number 10957

    10H   6H   KS   JC   3S   7S   4C   AC   9S  10C
     KD   4D   8C   9D   7D   5D   7S  10C   3C   4S
     4D  10S   3H   JS   9C   5S   2C  10D   3H   7C
     4H   6C   KD   5D   7H   4S   JD   AS   QS   7D
     2D   4H   3D   KH   8D   KS   KC   8H   6S   QD
     4C             2S            10D             KH

     JD   6H   9H   6D   6D   8S   2H   QS   8S   2C
     JC   2D   5C   JH   6S   7H   3C   3S   3D   8D
     AC   9S   5C   AH   5S   9D   QC   9C   QD   8H
    10S   2H   AD   JH   QH   5H   AH   9H   2S   6C
     QH   5H   7C   8C   AD  10H   AS   QC   KC   JS


    


Committed moves

May 5, 2005

A "committed move" is a move that cannot be undone by normal play. That is, it must be undone with an "undo" function. Dealing the 10 cards from the stack is an example of a committed move. Moving a King to a free stack is another example. Any move that flips (reveals) a card is another example.

A script was run to determine what the longest run of un-committed moves in each game has been.

What is the longest run of un-committed moves in all won games?

10 - in game numbers 20221, 27803, and 31842. plspider has played none of these games very many times, so their 10-runs may be easily lowered.

What is the shortest maximum run of un-committed moves?

2 - in game numbers 3370, 7490, and 15938. Interestingly enough, plspider has won these games in 215-217 moves. That is, they are not notably short games.

What is the most common maximum number of un-committed moves per game?

4 - in roughly double the number of games as 5. And roughly triple the number of runs of 3.


Updates

October 21, 2014

Maximilian Schamschula has solved 8881, 20830, and 24614. Herculean effort.

Insprired by Max, with some settings changes, plspider has solved 288, 6654, 8881, and 27320.

And, Max, with the aid of a sequence from plspider setting up 4 empty columns, won game 19638.

October 22, 2014

Max has solved 14686.

October 23, 2014

Max has solved 16749 and plspider has won 19638 by itself.

October 24, 2014

Max has solved 12057.

plspider has solved 28241.

October 26, 2014

plspider has solved 25521 and 12057.

October 31, 2014

plspider has solved 24614.

November 1, 2014

Max solved 14992 and plspider solved 16749 and 20830.

November 2, 2014

Max solved 28023.

November 3, 2014

Max solved 24560.

November 4, 2014

plspider solved 12177.

May 1, 2020

Mark Stierlin solved 10957.

May 10, 2020

Able to shuffle and deal all WINSPIDR (by John A. Junod) games. (But restricted to playing games numbered below a million until after April 13th 2024.)

April 18, 2024

Challange: WinSpider games 1..32000 not won yet

plspider has solved solved almost all WinSpider games from 1 though 32000. Four games remain unsolved.

Probably easiest (2 columns have been emptied):


    WinSpider game number 24323

     6S   5D   KS   2H   9S  10H   9H   2C   2S   3S
     QD   2C   QC   AC   3D   3D   JH   8D   AD   JC
     9S   KH   6D   QS   4C   5S   6H   AH   7C   9D
     QH   9C   7C   5C   3S   4C   JD   7S   JH   6D
     5H   AC   6S   JS   KD  10C   JS   8H   2S   9D
     2D             7S             2D            10C

    10S   4H   KC   6C   9H   QH   9C   KD   JD   KS
     KH   8S   AS   2H   8S   7D   AS  10D   8D   5C
     6H  10H   AH   4D   KC   4H   JC   AD   QS   4S
     QC   5S   7H   7H   QD   8C   8C  10D   5D   8H
     7D   4S  10S   3H   3C   3C   4D   5H   3H   6C

Unoptimized moves to 2 empty stacks:Lost 24323   0:50    50 seconds    0 keys  149 moves  2 empties V0.62 Wed, 10 Apr 2024 00:30:34 GMT
2#1>1 1#1>7 2#1>6 7#1>1 1#1>9 8#1>6 4#1>6 9#1>1 3#1>8 1#1>7 D 6#1>8 4#1>6 4#1>8 4#1>6 4#1>10 9#1>10 1#1>10 5#1>10 D 7#1>4 9#1>7 6#1>2 4#1>9 6#2>2 6#1>5 D 9#1>5 2#1>7 D 4#1>6 4#1>9 6#1>7 D 5#1>7 7#1>2 4#1>7 4#1>2 10#1>1 2#1>6 4#1>6 4#1>2 9#1>4 9#2>1 7#1>1 9#2>1 9#1>5 9#1>10 9#1>2 4#1>7 9#1>7


    WinSpider game number 8231

    10S   5H   6H   AH   QH   3H   7C   3S  10S   2C
    10H   2H   6H  10C   QD   6C   9D   JC   8S   JC
     JS   QC   4D   QH   5S   5D   3H   5D   8C   5C
     QS   JS   4S   AD   9C   3C   3S   KC   JD   2D
    10C   KH   7S   9C   AH   5S   8H   AC   2S   4C
     9S             4S             2D             9S

     2C   KS   QD   KC   KD   2H   8S   KH   2S   7D
     JH   5H   8D   4D   8D   7D   7H   JH   KD   KS
     8C  10D   6D   6S   AD   QS   3C   AC   QC  10D
     AS   8H   4C   3D   7C   AS   5C   JD   7H  10H
     4H   6S   3D   9D   9H   6D   6C   7S   4H   9H

Unoptimized moves to 2 empty stacks:Lost  8231   4:05   245 seconds    0 keys  212 moves  2 empties V0.57 Thu, 27 May 2021 02:55:40 GMT
5#1>9 4#1>6 D 3#1>5 3#1>7 D 7#1>3 3#1>5 4#1>2 6#1>3 D D D 3#1>1 1#1>9 7#1>8 7#1>8 3#1>8 9#1>8 8#1>1 7#1>8 7#2>4 7#1>1 7#1>10 7#1>9 3#3>5 7#1>3 5#3>7 8#4>4 2#1>8 2#1>5 7#4>2 4#4>7 8#2>10 2#5>8 1#2>2 7#5>5 3#1>7 6#1>4 9#1>3 7#1>9 2#3>7 2#1>4 7#3>4 6#1>4 6#1>7 6#1>9 6#2>10 7#1>2 8#6>7 6#1>1 1#1>10 9#3>6 7#6>2 6#3>7 6#1>2 6#1>9 10#1>1 7#3>2 6#1>10

    
Probably harder (1 column emptied, at best):

     WinSpider game number 1295

     5D   2D   3C   4H   AC   6C   7C   9H   6H   AH
     6D   JC   2S   5C   6S   4D  10H  10C   6D   6H
     QD   7S   AS   9D   2H   5S   6S   4C   8D   6C
     3H   JS   8C   9S   AC   2C   8S   9C   8H   5H
     KS  10S   2H   9S   4D  10H   4S   KH   KC   7C
     QH             2D             5C             AH

     4H   4C   8D   KH   KD   QS   5S   KS   7D   2C
     7H   KD   3D   7S   8H   3D  10D   AS   3H   7D
     9D   JC   8C  10S   JD   3S   QD   9H   QH   QS
     JS   4S   AD   JH   5D   QC   QC   JD   3C   KC
     AD   9C  10D  10C   5H   JH   7H   3S   2S   8S

Unoptimized moves to 1 empty stack:Lost  1295   3:36   216 seconds    0 keys  106 moves  1 empties V0.50 Thu, 01 Apr 2021 20:50:40 GMT
1#1>8 5#1>7 5#1>4 10#1>5 D 6#1>5 D 1#1>5 3#1>1 10#1>3 D 3#1>8 3#2>1 3#1>6 2#1>9 7#1>2 1#3>7 7#4>9 6#1>1 D 1#1>7 3#1>1 D 3#1>6 3#1>2 2#2>6 3#1>9 3#1>8 3#1>2


    WinSpider game number 9259

    10D   4C   5D   AS   8H   6C   6S   6H   4C   7H
     AC   5H   8D   9C   3S   3C   2D   2H   KC   5C
     7C   QD  10H   4H   AC  10S   JH   QS   4D  10S
    10D   QS   QD  10H   QH   KS   JD   3S   3D   AD
     JH   AD  10C   4H   KC   7D   8H   6H   8S   2H
     9S             AS             KD             3H

     9C   5S   JD   5S   5D   6C   6D   JS   JS  10C
     7S   5C   4D   2C   7C   9S   7H   KD   KH   AH
     9D   QC   9H   9H   5H   8D   KH   3C   4S   KS
     2S   3H   JC   7S   9D   2D   2C   QC   3D   JC
     8S   6S   4S   8C   6D   7D   2S   QH   AH   8C

Unoptimized moves to 1 empty stack:Lost  9259   1:01    61 seconds    0 keys  103 moves  1 empties V0.64 Wed, 10 Apr 2024 16:02:49 GMT
9#1>1 1#2>3 6#1>3 8#1>3 D D 10#1>4 6#1>10 2#1>6 6#2>5 3#1>5 5#1>2 D 6#1>1 2#1>10 2#1>5 10#1>6 8#1>5 9#1>2 D D 6#1>1 2#1>1 2#1>3 2#2>1 3#1>1 2#1>6 7#1>1 9#1>1 9#1>3 7#1>3 2#1>7 2#1>9 2#1>5 2#1>5


    
Note: number of "moves" reflects the most moves made at any time, not the number of listed moves (which lead to empty stacks).



Results

GreenWon
GrayHuman-won
OrangeLost
RedLost with no empty stacks made.

Shortest GamesMoves   LongestMoves   FastestTime   SlowestTime   Shortest LossesMoves   Slowest LossesTime   Most PlayedPlays
23181168   22641393   65770:16   146863:59:54   1748:092   1748:025:36   109572072
14900170   28078393   266420:16   245603:39:42   14934:092   14934:015:59   12177264
693172   21260392   63040:17   109572:46:39       24560227
25360173   3692385   76940:18   208302:39:00       28023216
718176   19952383   11430:21   246142:37:12       24614214
19167176   21320381   24380:21   264662:34:11       288211
13492177   22544377   175130:21   169302:21:46       14686209
28226177   4258376   278360:21   88812:19:49       20830201
27959178   4237375   8830:22   81382:09:42       14992194
5425179   14346374   64290:22   167491:59:13       16749180
25462179   1563371   197030:23   2881:53:59       28241158
15993183   7512371   237920:23   282411:52:35       14934154
30152183   9280371   20730:25   242341:46:41       1748146
3899184   10719371   31680:25   232281:45:18       25521133
18992184   8081370   182030:25   83181:40:08       19638125
20578184   10322370   232500:25   311061:39:45       12057120
7435185   28614370   287140:25   279821:38:44       2732098
14398185   10475369   303390:25   294411:38:20       665494
21585185   11460369   14130:26   217411:34:36       888171
26906185   19470368   106440:26   285391:28:57       95063
24127186   4353366   158680:26   149921:28:26       260861
25457186   12366366   159820:26   73851:27:33       576060
1527187   9920365   191670:26   111431:23:54       773258
5361187   20914365   202820:26   273201:22:40       1286557
8224187   30908365   224160:26   203841:21:14       604856
19752187   24782364   242170:26   26361:19:17       2299254
23943187   4397363   313740:26   47191:18:00       263649
27347187   7917363   166030:27   46051:16:25       762649
27976187   10682363   239120:27   66541:15:46       813848
28097187   23731363   271590:27   172191:14:36       1772248
2597188   30057363   297020:27   280231:14:36       2839947
5437188   2068362   16090:28   269391:13:32       2278843
13865188   5718362   42960:28   129371:13:28       2782843
16271188   6161362   143980:28   81171:12:24       2790341
29884188   6817362   173020:28   153131:12:08       134940
8100189   7631362   440:29   96911:11:41       2205140
9987189   8678362   910:29   244321:11:02       831839
11533189   9397362   46850:29   45081:10:27       1531339
17658189   11136362   137900:29   1381:10:15       3115639
23005189   13164362   188470:29   285821:10:12       1085838
3870190   16453362   230960:29   92341:10:01       1386638
6264190   16875362   233870:29   9661:09:56       1919637
9036190   22961362   281380:29   108581:09:56       471934
10816190   23416362   53690:30   42581:09:43       2419833
18286190   24923362   89090:30   96111:08:07       2853933
20392190   26313362   126510:30   20831:07:55       1080432
20435190   28275362   126940:30   174421:07:45       1693031
26228190   7012361   129580:30   87011:06:11       1078630
30749190   8079361   143110:30   149721:06:07       2423430
10094191   8112361   144270:30   183641:05:31       670428
13999191   8485361   169160:30   71671:05:27       1628428
15186191   9087361   173680:30   225441:04:23       1676828
16301191   9409361   220810:30   238601:04:00       2200028
19703191   12302361   262530:30   213181:03:49       1337927
22081191   16003361   298750:30   286751:03:47       1964026
27937191   19077361   315980:30   275511:03:27       620925
2144192   19214361   96270:31   269931:02:48       1705025
2522192   20069361   125860:31   142111:02:17       3102325
7483192   25903361   146200:31   59861:02:10       219924
8064192   26579361   154400:31   269141:01:37       870124
17869192   26662361   163520:31   83291:01:28       2989324
21791192   31605361   186990:31   282371:01:21       1976623
22664192   110360   213830:31   281991:01:15       2517623
23209192   342360   264340:31   84111:01:03       21022
23284192   937360   268720:31   56851:00:59       36022
25127192   1308360   291000:31   278321:00:54       462722
30164192   1791360   315650:31   26801:00:47       593922
190193   3158360   29440:32   108041:00:23       805722
216193   4861360   85770:32   305711:00:21       2167822
753193   5727360   92080:32   524559:52       295721
4072193   8828360   115130:32   1585659:24       500121
5495193   9086360   123860:32   537459:22       1293721
7395193   15918360   124550:32   1217759:09       1293821
13156193   17919360   129340:32   3154658:54       1505221
17810193   19268360   161450:32   1863858:43       1508021
19935193   20639360   186520:32   805758:13       1863721
23387193   20873360   216900:32   2015958:13       1896721
31831193   21316360   227910:32   2986258:11       2693921
31933193   22659360   262430:32   3139258:08       31320
3499194   23835360   301430:32   2984057:59       55920
5145194   27327360   315200:32   829157:47       99620
14895194   27378360   316000:32   3022257:26       425820
15598194   29712360   10190:33   149557:20       616920
17501194   29917360   14140:33   1160257:19       1060420
22416194   31066360   36000:33   1137657:08       1497220
26602194   31112360   38770:33   156056:38       2507520
26868194   2014359   43230:33   2342856:24       2658920
545195   9521359   62400:33   1954156:23       1865819
1312195   12614359   63580:33   2507856:18       2468619
3093195   13017359   85130:33   1425156:10       2653219
6271195   16672359   212880:33   16356:05       2729619
9113195   18968359   214430:33   2125456:05       3154619
9399195   19073359   247110:33   1198555:44       3177919
12189195   20563359   249180:33   1198755:40       52818
13894195   21345359   276120:33   2918055:38       367018
15824195   22421359   293010:33   2143655:31       376918
16541195   23056359   31550:34   2578455:31       592918
19973195   23482359   38140:34   2864755:15       1027818
22257195   28607359   44180:34   3151754:54       1378118
23250195   29509359   69320:34   531954:46       1587918

  64608 games played
  32000 unique game/deals played.
  31998 ---  99.99% of unique games have been won.
 Median  won-game, number of moves:  273 in     1:36
 Median lost-game, number of moves:   92 in    20:48



plspider.htm
Sun Apr 21 22:37:55 2024
plspider at tranzoa dot com
Copyright (C) 2024 Tranzoa, Co. This plspider.htm file is generated by webresults.py