Cheevo, away we go!

We’ve all been there.

Playing Spider Solitaire is no longer fun. Winning is too easy, even at the four-suit level, sans ZeeKee (as George will say) and playing an online server that is known to be biased #yeahright. Not enough frustration in our lives? Do you need more challenges to keep life meaningful?

Enter our old friend, the Cheevo.

Originally used to describe achievements earned through various games on the Xbox360 and other platforms, the C-word has been made universal throughout all kinds of games, including cerebral pursuits that don’t involve the curse of Nintendo Thumb. Cheevos are not the official goal(s) the protagonist is trying to obtain, but are optional extras invented by game fanatics who crave an extra challenge.

For instance, I once beat a very strong chess player without moving my queen off her starting square. My opponent blundered horribly and had to give up the material equivalent of four pawns for no compensation. He immediately resigned – but had he been paying more attention to my queen throughout the game he might have continued playing out of spite, just to wreck my cheevo. Chess fans may recall that Magnus Carlsen pulled off a similar feat against Viswanathan Anand (and also promoting a pawn to a second queen!) Similarly, a poker expert might hope to win first prize in a home game without ever showing down AA in Texas Holdem. And of course, every serious bridge player above the legal drinking age knows the significance of the Seven of Diamonds!

So, what possible cheevos can we have in Spider Solitaire? The short answer is you are only limited by your imagination.

For instance, one cheevo is to remove all eight suits in the last eight moves of the game. I suspect this will be very difficult with four suits sans ZeeKee, even for an expert player. Another cheevo might be some form of multi-tasking, such as improvising a rap song describing your thought processes while simultaneously playing to the best of your ability. What other cheevos can you think of? Remember that you are only limited by your imagination!

The Final Problem

In the middlegame or endgame it is often wise to think beyond turning over cards and building in-suit. What would you do in this position?

Note: This isn’t part of our on-going game but I wanted to discuss an interesting concept in the middlegame.

We have one empty column and are about to lose it. We can obtain a new turnover in column j or f, but as usual it is good strategy to look beyond the obvious.

An experienced player might well consider turning over a card in column d. One advantage is if we get this “difficult task” out of the way first then columns j and f will be easier in the future. Alas, we soon hit a snag: there is a double Seven in the first eight cards (T-9-8-7-7-6-5-4). We don’t even get to shift the Ten of Clubs onto the Jack of Spades.

An experienced player would also know too often that the 7-6 offsuit in column e is a problem. On the next row of ten cards, an Eight will appear and it is impossible to recover an empty column precisely because the 7-6 is off-suit. So it may be feasible to compromise by not turning over a new card. For instance we can play (eb) and deal another row, hoping to win back the empty column later. Not terribly exciting but perhaps we can improve it by <eb,ce> getting a run of hearts from Seven to Ace.

Further analysis shows we can in fact do better still with <hb,eh,ce> obtaining two in-suit builds in the red suits. This not only yields good chances to recover a hole in column b or e, but it also gets to work on column h. If the cards fall well, we might be able to turn over a number of face-down cards in that column. There is also a strong possibility of obtaining a run of hearts from Jack to Ace in the future. The basic principle is we suffer a small loss, in exchange for (hopefully) a large gain in the future.

Of course, all this is possible only because the stock is not empty. If the stock were empty then we would have to go all-in, turning over at least one card and saying 70,85,67,75 73,84 even if it entails trashing our position in every way possible. There are no consolation points for a “pretty loss” – a loss is a loss is a loss is a loss.

I in fact chose the plan <hb,eh,ce> in the game and managed to win. Fiddling with rot13(haqb) – after obtaining a clearly winning position😊 – suggests that turning over a card in column j or f would probably have resulted in a loss.

In depth Spider 4-suit strategy discussion

A few days ago I belatedly checked my gmail and apparently someone has started a reddit blog about strategy in 4-suit solitaire. Let’s hope he can get some traction happening.

Bart Wright claims a win rate of 25% on 4-suit sans ROT13(haqb). This is nothing to sneeze at if you excuse the terrible cliché. He also mentions he did get through the book Spider Solitaire Winning Strategies, so Bart is doing something right.

Bart cites the following:

 If you have a choice of several cards to reveal in the initial deal, suppose you have two columns that have 6 at the end, then turning over a 5 is an excellent choice. I think of it as the “market value” of 5s is low so it’s a good time to buy — there are two columns that demand it and only one to supply. That would be my choice over an in-suit move. Even after you move that 5, you still have space for another 5 if it comes up.

Here is an example to illustrate Bart’s point (Microsoft refuses to give an example with two Sixes and a Five, so this will have to do):

There are two options: shift the 9d onto one of the Black Tens or to build in-suit. Personally I prefer to build in-suit because the chances of getting a good card do not decrease.

To be more specific: suppose a card is good if it increases our minimum guaranteed turnovers (2 in this case). In this example, the good cards are A34679JQ (regardless of which option we choose). I usually prefer to build in-suit. You never know – perhaps the next two cards will be the Nine of Spades and Nine of Clubs. But I agree in this particular example, the difference is small. With three tens exposed, I might be swayed towards shifting the Nine.

The reason this difference is small is because most of the time we will shift both the 9 and 8 of diamonds in some order. But in an alternative universe we might find only one option is available, but not both (this usually happens after at least one row from the stock is dealt). Then it becomes a judgment call. For instance we might choose option A because it is closer to obtaining an empty column, or we might choose option B because that avoids exposing an Ace.

Until next time, happy Spider Solitaire playing.

A closer look at the Hole-In-One game

In the last post I looked at the “hole-in-one” game, where the aim was to get an empty column before being forced to deal another row of 10 cards from the stock. I asked the following questions:

  • What are the chances of winning, assuming perfect play and a “proper” random number generator?
  • How would you go about estimating it?

The first question was intentionally difficult. It is not trivial to find a perfect strategy, even for this simplified game where the player doesn’t have to worry about what happens after 10 cards are added to the tableau. Even I don’t have a definitive answer. Instead I wanna focus on the second question.

If you know anything about research, you might think the win rate can be estimated by playing a large number of games, tallying up your wins and losses and then doing some basic math to arrive at a winning percentage between 0 and 100. Or if you want to spice things up, you might guess a winning percentage before playing and see how accurate your guess was 😊

In this case, I estimated my win rate should be 30%. I played 30 games (to give myself the chance of an exact guess if I happened to win exactly nine games). Alas I won ten games out of 30, one too many – so my estimated win rate should be 33%.

This figure should be taken with a few pinches of NaCl because:

  •  my sample size of 30 games is small. Ergo, 33% could be an overestimate or underestimate.
  • Even the noble Spider GM may not have played the perfect strategy, so the correct win rate has been underestimated.
  • A more subtle point is optimal strategy may change when we only focus on empty columns. In a real game nobody would trash their game in every way possible just for the sake of increasing their miserly chances of getting that hole-in-one from 2% to 3%. In other words, 33% could be an over-estimate of our chances of getting that hole-in-one.

The real point of the exercise is to give the student a feel of how the simplified game works. If you have played 30 (or more) games of hole-in-one you may have come across some interesting decisions. Here is an example:

There are a number of options to consider:

  • Two of Clubs onto the Three of Hearts, turning over a new card in the only column containing only three face-down cards.
  • Three of Hearts onto the Four of Clubs, ensuring the previous option won’t decrease our minimum guaranteed turnovers.
  • Two of Hearts onto the Three of Hearts, turning over a new card in a column containing four face-down cards but building in-suit
  • Ace of Clubs onto the Two of Clubs, keeping the above options open.

Although a win-rate of 33%  is to be taken with a pinch of NaCl we could still conclude that:

  • If you do obtain an empty column before dealing from the stock then you are probably in good shape
  • If you don’t get the empty column then you are not necessarily in bad shape. I know from previous experience I can clear all eight suits about half the time sans ROT13(haqb). If you were close to an empty column but didn’t quite make it, you are probably doing okay.

Until next time, happy Spider Solitairing 😊

The Hole-In-One game

This is a simplified 4-suit game designed for beginners. The aim is simply to obtain one empty column. It doesn’t matter if you expose five Aces and seven Kings in the process. Any empty column means victory. The bad news is you’re not allowed to deal any cards from the stock. As usual ROT13(haqb) is not allowed.

The purpose of this game is to allow the beginner to actually win something at Four-Suit Spider Solitaire. More seriously, I think this will help the beginner improve his game by focussing on one concept at a time. As a chess analogy, suppose you wanna teach a child how to play for the first time – unless he, she or it is exceptionally gifted chances are it will be overwhelmed by the sheer complexity of the game. So we could consider simpler games e.g.

  • Pawns only: you win if a pawn reaches the 8th rank, or opponent has no legal moves.
  • Kings Rooks and Pawns only
  • Kings Bishops and Pawns only
  • To win, capture 5 enemy pawns or pieces.
  • … etc

In this way, it will most likely figure out interesting concepts by itself, e.g. zugzwang for the “pawns-only” game or the fact friendly bishops and pawns can protect each other (but rooks and pawns cannot). Although I haven’t tested this method myself (I haven’t even googled), I won’t be surprised if this method actually works.

Admittedly Hole in One ain’t the greatest pun, but “hole” refers to empty column and “one” means no help from the stock – if you need to deal the stock once before getting an empty column that’s a hole-in-two and so on. This means, for example, if an exposed Nine of Hearts is covered by another card, that other card will always be an Eight of any suit.

Here is an example game, with start and end game state shown. This game is lost because there are no legal moves left (apart from dealing another row) and we don’t have an empty column.

Some questions for the reader:

  • What are the chances of winning, assuming perfect play and a “proper” random number generator?
  • How would you go about estimating said winning chances?

Until next time, happy Spider Solitaire playing 😊

How Can I Win This Game?

In the opening phases of the game we are always concerned with turning over new cards and building in-suit. But in the middle-game or end-game things are different.

By this stage a decent player will be able to evaluate the position. After performing some multi-dimensional calculus on the back of an envelope, he she or it will be able to estimate winning chances and decide on a plan of action.

Unfortunately, an in-depth discussion of multidimensional calculus is beyond the scope of this post but a useful general principle is the following:

  • If things are going okay, we should continue to play our normal game. Turn over new cards, build in-suit whenever possible, and start thinking about removing complete suits.
  • If the game is going badly, start looking for miracles. You need them to win, and miracles never occur if you don’t look for them.

Conversely if the game is going extremely well, you might consider playing safe, but that’s another lesson for another time.

In the diagram position you don’t need a Grandmaster Title from the International Federation of Spider Solitaire to work out the prospects are bleak. The stock is exhausted, several cards are yet to be exposed etc, etc. But all hope is not lost if you excuse the terrible cliché. We can quickly obtain an empty column and turn over cards in columns a or h. Since we probably need good cards to win, we might ask ourselves “if we could call the next card what is the best case scenario when turning over column a or h?”

A closer look reveals all cards in the Spade suit are already exposed. Assuming we focus all our effort into removing a full suit of Spades how much luck do we need? Perhaps a good card or two in column a, or perhaps we can tidy things up a little and hope for luck on the next deal – no scratch that, the stock’s already empty.

It turns out we don’t need any luck – it is possible to remove the Spades without exposing any new cards. Of course, we need to expose cards to win the game eventually, but the point is we are guaranteed to remove Spades regardless of the permutation of unseen cards. One sequence would be: is <bg, id, ih, ia, jf, dj, cd, ch, jd, cj, d2=j1, hc, hc, fg, fd, fh, fa, d1=f1, f2=h2, hc, cj>. Whoosh – the Spade suit goes onto the foundations!

If you found this sequence of moves well done. Of course, it might be possible to do better than that – remembering that removing one suit is not synonymous with winning the game. But at least it’s a fallback position: we can choose this option if we find nothing better.

Avid readers might have recognised the exact same position from an earlier post, and would keenly deduce the game is winnable since I managed to beat it without undo. If you spotted this then again well done 😊

Spider Solitaire Notation

When discussing a sequence of one or more moves it is clearly more convenient to say something like “<ac>” rather than “move the Jack of Hearts from column 1 onto the Queen of Diamonds on column 3.” This is especially true when we talk about long series of moves to achieve a desired goal such as an empty column or increasing the number of in-suit builds.

Steve Brown has developed his own notation for moves in Spider Solitaire in his excellent book Winning Spider Solitaire Strategies. The notation is theoretically sound, but I think it is rather technical and counter-intuitive for most players so I decided to make some slight variation of it. I prefer to illustrate important strategy concepts through the use of silly stories 😉

Most of the time, specifying a source and destination column is enough to uniquely identify a legal move. For instance if the top cards of columns 1 and 3 are a Seven and Jack respectively, then we know that exactly four cards are being moved from column 1 to column 3 (unless the move is illegal). But there are one-and-a-half exceptions.

The one exception occurs when the destination column is empty, in which case the number of cards being moved may be ambiguous (of course most of the time you wanna move the maximum number of cards to avoid losing an in-suit build). The half-exception concerns the use of supermoves. Many players will be familiar with the concept of supermoves from Freecell and they turn out to be very convenient for dealing with longer move sequences.

I will use the letters abcdefghij to denote the ten columns from left to right. Therefore the simplest example of a supermove could be <ab2,ac5,bc3> to shift five cards from column 1 to column 3, assuming 2,5,3 represent the number of cards being shifted for each individual move. Of course most of the time the numbers are unnecessary so it is simpler to write <ab,ac,bc>. The supermove notation is <ac> in lieu of <ab,ac,bc>. Going back to an earlier example, if the top cards of column 1 and 3 are a Seven and Jack respectively then <ac> means we are shifting exactly four cards. If they are not suited then we check if the conditions for a supermove exist (for instance we might have an empty column and a spare Nine).

A related concept is superswap where we want to swap the partial contents of two columns. For instance if we have 8C-7D in column 1 and 8D-7S-6S-5S in column 7 then it might be desired to swap the 7D with 7S-6S-5S to build in-suit with 8D-7D. This can be notated as <a1=g3>. Obviously, this can only be achieved with a spare Eight of any suit or an empty column.

With more empty columns and cards in play deeper superswaps are possible. It is not hard to imagine a move like <c6=g8> to tidy up suits, which might take over 30 individual moves to achieve. Note that without the numbers 6,8 there may be ambiguity with e.g. <c5=g7> or <c4=g6> etc.

In the example below we might start the game with <eh>,<ji> for two in-suit builds. Assuming the exposed cards are 4D and 3D respectively the third move could be <ie>, which is also in-suit.

notationexample-05172020

You may have noticed the use of angle brackets – these correspond to single actions, i.e. move sequences that expose at least one new card. For example <eh>,<ji> means we shift the Seven of Spades, examine the card underneath and then decide the best move is to shift the Four of Clubs. If we ignored the face-up card underneath the Seven of Spades, then the notation would be <eh,ji> which is technically not an action (although the loss in “equity” is very small).

Until next time, happy Spider Solitaire playing 😊

Four-suit Master Level – let’s do this!!!

Another working day over and done with, I guess it’s time to play a 4-suit hand at Master level 😉

Avid readers of this blog may recall I discussed the difference between an “expert” level and “grandmaster” level hand – but conveniently omitted the “master” level which is somewhere in between. Recall that Microsoft Spider Solitaire gives the player the option of choosing a difficulty level as well as number of suits. In this case we know (before touching a card) that

  • The game is guaranteed winnable
  • The difficulty should be “average” because 4-suit hands have four difficulty levels namely: expert, master, grandmaster and random

A cursory analysis of the opening position suggests our prospects are good: we have five guaranteed turnovers (only one in-suit but we can live with that), and we have nine different ranks (only Fives are duplicated). If this were a random deal, I would consider myself a favourite to win this game, but at master-level difficulty I’m not so sure.

This could be a “honey-trap” – Microsoft may want to encourage players to accept whatever starting hand they get, and then unleash a surprise or three on the next 30 cards in the stock 😉 (players can refuse a starting hand without having a loss officially recorded in their stats, but I always play every hand). However I’m not making any accusations of foul play without any concrete evidence. This could be a future project, but for now let us focus on winning the game.

start-05132020

FUN FACT: if the opening hand contains ten different ranks we are guaranteed at least six turn-overs with proper play.

Easy Difficulty

Continuing my experimentation with Microsoft Spider Solitaire, I decided to try five hands on Expert difficulty level.

Recall that Expert is the easiest possible setting when you play with 4 suits. We therefore expect Expert hands will be easier than random hands.

Indeed when I tried playing Five hands at Expert level I crushed it. I won the first four hands and probably should have won the fifth, but for a lapse in concentration.

Getting trips (or even quads) when dealing a row of 10 cards occurred very rarely, and I had a healthy number of turnovers in round 0. Once I removed two complete suits the game was pretty much in the bag.

However, I should emphasize that removing two suits most definitely does not guarantee victory for Grandmaster level. And don’t get me started on Rogue Solitaire.

Recall that in a previous post, I ran the Gauranteed Minimum Evaluation Score on hands of various difficulty. Ninja Monkey said that he could win 4 Experts hands out of 50, but zilch on Master and Nada on Grandmaster.

I haven’t experimented with what various difficulty levels look like with fewer than 4 suits. Perhaps that’s some material for a future post 😊

Personally I like the idea of giving players the option of choosing a difficulty level as well as number of suits, and Spider Solitaire lends itself to this type of choose-your-difficulty. In contrast, the same cannot be said of games like Klondike or Freecell (one-suit is perhaps too easy even for a newbie)

Until next time, happy Spider Solitaire playing.

Choose Your Difficulty

The classic Microsoft Spider Solitaire software gives a Four-suit expert player a choose between Expert, Master, Grandmaster or Random hand.

With the pandemic not going away any time soon, I thought now is a good time to play three more hands of Spider Solitaire on my PC, choosing difficulty levels of Expert, Master and Grandmaster (while also honing my writing skills!). I easily won an Expert hand, but bombed the Master hand. I briefly entertained some miracle hopes on the Grandmaster hand, but quickly came crashing down to earth if you excuse the terrible cliché.

Ninja Monkey’s Guaranteed Minimum Evaluation Score algorithm yields a win rate of 4/50 on the Expert but 0/50 on the Master and Grandmaster hands.

Here is the Grandmaster board:

Round 0 looks promising with 4 turnovers (the average should be a tad under 4). Moreover, two of these turnovers are suited – but problems appear later.

After a promising initial deal it’s trips galore in almost every round. This reeks of a cold deck – if you’ve ever played late-night poker with some dodgy folk in the neighbourhood then you’ll know what I’m talking about. Then again, I did ask for Grandmaster difficulty.

In contrast three of a kind never occurred in any round of the Expert hand.

It is not clear if arranging three of a kind on nearly every round is an effective way to make the game harder (maybe the permutation of face-down cards in the tableau is also relevant) but it does suggest Microsoft is trying. In defence of Microsoft, they explicitly made it clear that the player will face a difficult challenge to win without boop. In fact I have no problem with the game being “rigged” if the player knows in advance the cards are not properly shuffled (in math terms we say a properly shuffled deck has 104! possible permutations of starting hands, ignoring equivalence of identical cards, and each permutation is equally likely). A player who chooses Grandmaster difficulty can’t say he wasn’t warned!

I will not discuss the strategy in detail. Rather I wanna discuss how easy it is for Microsoft to construct “easy” or “difficult” hands.

There are several ways one might go about constructing a difficult hand:

  • “Crowdsourcing”: give each hand a unique identifier (like a hash). If only e.g. 10% of players can win even with the help of boop, then chances are the game is difficult. If a good percentage of Microsoft employees like to slack off in their spare time this shouldn’t be too hard 😊
  • Design an evaluation function e.g. number of guaranteed turnovers for Round 0, or number of guaranteed turnovers if we pretend we start with the 10 cards in Round 3 instead of Round 0. The main difficulty is finding a good evaluation function.
  • Design an AI to play the game with or without boop. The main difficulty is designing a good AI is not trivial.

It is not clear which method Microsoft uses (my best guess is crowdsourding), but I agree they succeeded in arranging matters so that Grandmaster is harder than Expert (Master is perhaps equally hard as Grandmaster but I only have a sample size of three games, so I won’t jump to conclusions any time soon!)