Monkey Algorithm – In Depth (alternative version)

IM Bartacus and IM Bug had successfully beat the four-suit version of the Royal Game with the help of a few expert friends. Some of the advice was good, some not so good, but eventually they managed to remove all eight suits, albeit with some difficulty.

Meanwhile, Ninja Monkey had tested is new improved algorithm and reported a win rate of 6% inside a sanitised environment with Spider GM overseeing his every move. Now was the time to play with the big boys and see what it was really like.

Unfortunately, the first game did not get off to a good start. No sooner had the game started, Ninja Monkey was immediately ejected from the playing hall.

“What are those things?” says Ninja Monkey.

“Ngrmmph” replies Spider GM with the demeanour of a Scrabble player mega-tilting after picking up way too many consonants against a weak opponent.

“Eeeek!!! Monkey don’t understand Ngrmmph!!!”

“They are among my best and brightest students – but also the rudest” growled Spider GM.

“Tell me about it!”

“Rot13(Svpxyr nf shpx). One day Orange will play at GM strength. The next time Orange will play like a rank beginner and pin the blame on Dark Green whenever something goes wrong. Then everybody starts arguing for the better half of a minute. I don’t remember the last time somebody didn’t end up in detention!”

“This is the position when I got ejected from the playing group”, says Monkey.

“Okay, I see what happened”, says Spider GM. “You correctly calculated the minimum guaranteed evaluation score to be 61. That’s assuming 10 points for a turnover and 1 point for an in-suit build. In the worst case scenario we get six turnovers and one in-suit build guaranteed: even my Dad can do the math.”

Ninja Monkey nods in agreement.

“Now there are several ways to get 61. You can start with id, db, ec, eg or ei”. Any of those moves allows you to get 61, even if you turned over six Kings. Therefore any moveblock starting with the correct first move would score the maximum-minimum-guaranteed-score if you will.”

“Of course we should start with ib” replies Captain Obvious. “If our very first move is an in-suit build then we never lose any guaranteed turnovers.”

“Shifting the Five of Spades is entirely reasonable, since we have three Sixes” replies the Wise Snail, the world’s slowest player and Monkey’s best friend.

“When I ran my algorithm a second time,” says Monkey, “I indeed got the move ec”.

“Note that if we did get six Kings, all these opening moves are equally good,” says Spider GM. “But under normal circumstances, db is clearly bad because we lose a turnover if we expose a Nine. Monkey’s algorithm only considers the worst-case scenario when all cards turned over are bad”.

“Maybe you can think of a way to improve Monkey’s algorithm even further so it doesn’t start with moves like db”, says Captain Obvious.

“True,” replies Spider GM. “Unfortunately, even I have my limits, and I wanna enlist the help of some other friends – who either speak the Monkey’s language, or know something about the Royal Game, or preferably both.”

“The fact I win 6% of the time does mean looking ahead and calculating the consequences of bad cards is more important than getting the opening moves right” says Ninja Monkey.

“I agree you’ve come a long way since you first started Spider Solitaire with your famous random move algorithm”, replies Spider GM.

Spider GM leads his students towards a seedy-looking venue with a sign saying “Crazy House”.

“We call this place Git Hub” says Spider GM.

“Rot13(V jnf ubcvat sbe cbea uho)” moaned the Bad Idea Bears and rot13(Yhpl Gur Fyhg) in perfect unison.

“It’s a place for gits, pricks, dorks and old farts playing Bingo,” says Spider GM, “and the occasional unkempt computer nerd(s). A lot of us stay up late at night, against our collective better judgment. When you enter, you have no idea who you might bump into. Could be anybody from around the world …”

Confused looks from everyone else.

“I know it’s complicated but I’m hoping to find some really smart people among the nerds. Hopefully they will have some idea of how to play the Royal Game, or how to communicate with the Monkey to help him improve his win rate”

“Not sure if monkey like this!” squeals the Monkey

“Can’t be worse than those horrible coloured Blobs,” replies Spider GM.

“True,” says Monkey “Always true! Spider GM is always true!”

Ninja Monkey leaps into the air and into the arms of Spider GM. He cradles the monkey and assures everything will be okay …

Spider GM and his students enter the Git Hub. Meanwhile, Rot13(Yhpl Gur Fyhg) is looking rather bored.

The End

The Ideal Game of Spider Solitaire Among Us

You and five friends wake up on a deserted island. Luckily you have brought two decks of cards and all your friends are fanatics of Among Us and Spider Solitaire. How would you design the rule-set for a Spider Solitaire Among-Us mashup?

I came up with the following:

  • There are four cool mates and two impostors. Both impostors know the identity of the other impostor.
  • Cool mates win by removing eight suits or by ejecting both impostors.
  • Impostors win by stalemate (i.e. eight suits are never removed) or ejecting enough cool mates to achieve numerical parity.
  • At each “turn” all players discuss what is the best move or sequence of moves (it is not necessary to turnover one or more cards). Cards can only be moved after unanimous agreement by all remaining players.
  • Any player can call an ejection(*) if they believe someone is acting stupid.
  • You can call ejections as many times as you want! Beware that calling too many ejections without purpose will likely result in yourself “winning” an ejection
  • If an ejection is called, all active players have a minute to vote to eject any player of their choice or pass. The player with most votes gets ejected. Ties mean nobody gets ejected.

(*) We all know it should be “emergency meeting” but I can’t resist the bad pun!

Sanity Checking

To verify these rules are reasonable one can observe the following:

  • If the game is “guaranteed winnable” regardless of the distribution of unseen cards then the cool mates can force a win (unless the impostors already have numerical parity). All they have to do is agree on the same winning move and eject anybody who suggests a move that doesn’t guarantee a win.
  • If the impostors achieve numerical parity with cool mates then they can easily force a stalemate by always voting to move no cards and voting for the same cool mate in every ejection.

Spider Solitaire Among Us in Real Life

Of course, in real life it is not really possible to get an ideal game of Spider Solitaire Among Us. I can’t pull 6 random people off the street and demand they be expert players with plenty of spare time on their hands, so during the last few weeks I had to compromise somewhat by playing multiple roles of blogger, cool mate, impostor etc. On the other hand, it should be feasible to convert any solo-player game into an Among Us mashup – particularly if the game is already popular. For instance, you can have six Chess or Backgammon friends play as a team against an AI. If you’re really mad, I guess you can have two Chess teams of six players each but with one impostor per side. You’re really only limited by your imagination. Anything goes as long as it obeys the laws of physics!

Any thoughts on how to play an ideal game of Spider Solitaire Among Us are more than welcome!

Post-Mortem Analysis – Round 5

Link to Round 5 is here

Link to PMA Round 4 is here

This is a critical point of the hand. At the risk of sounding like a broken record, a lot can change when 10 cards are dealt simultaneously instead of sequentially. Moreover, once the stock is empty the effects of a bad draw can be catastrophic, or we could come up golden and reach a position where it’s virtually impossible to lose (unless all three blobs were impostors) – or it could be somewhere in between.

In this case, we got an excellent draw. The main point in these situations is not to panic at the sheer number of cards in the tableau. Careful analysis shows we can indeed remove one full deck of cards (including the Diamonds that have already been removed) regardless of the permutation of unseen cards. It’s not necessarily the best course of action, but at least we have a fallback if analysis reveals nothing better.

All three blobs wanted to “delay” this decision by not turning over any cards – and I believe IM Bartacus and IM Bug chose the wrong plan. They ended up in the following situation:

If we ignore the fact the newly turned over card in column 2 is a K of Spades, then we have three suits removed and two guaranteed turnovers. Now let’s look at Blue’s suggestion: “id,ai,ai,hi,hf,ha,ei,ea,gi,gj (h12=i8)” leading to this position:

This is much better. We can play fe,df,jd,jh,ie,fi,cg,cb,ci,(e7=h7),bi,ei,be,(b1=h6) to reach this position with four suits removed and also two guaranteed turnovers

No wait – in the actual game we get three suits removed and THREE turnovers. We weren’t allowed to count the fact the newly turned over card is a King of Spades (giving a home for the Queen in column 7) but we can count the fact we turned over something in column 2. This means Blue’s suggestion was not clearly superior to the actual continuation, and the team had every right to believe Blue was the impostor. Rot13(SHPX SHPX SHPX SHPX SHPX SHPX SHPX SHPX SHPX!!!!!).

Blue thought he was being clever, by using the Queen of Hearts in column 8 instead of column 6 (indeed using the Q in column 6 would be egregiously bad) but this turned out to be a miscalculation. To be more specific, the actual game continuation achieved one more guaranteed turnover at the expense of one more suit – and this is a good trade-off because the biggest danger of losing this game is if the next 2 or 3 cards are bad. There is little danger of losing because we removed too few suits.

In case you didn’t follow all of the above the TLDR version is rot13(Fcvqre TZ shpxrq hc).

In the endgame, Blue insisted on clearing the mess in column 8 early to avoid column 8 becoming a problem later. This is a good general principle:

KNOWLEDGE BOMB: From a position of strength, it is often wise to identify a “difficult task” and get it out of the way before it becomes a problem later (remember the dangers of one-hole-no-card).

The situation Blue wanted to avoid was this one:

This image is from the back cover of Steve N Brown’s excellent book “Spider Solitaire Winning Strategies”. When I saw this image, I immediately recognised it for what it was – most probably thanks to playing far too many games on a Spider Solitaire server that I am convinced is biased. If Steve played on that server, I would bet my Ph. D. thesis he would not have written the words “this game could have been won if only a little more care had been taken”.

Unfortunately for Blue, this knowledge bomb turned out to be unnecessary – the simple plan of turning over everything outside Column 8 was sufficient, even if the impostor were allowed to call the remaining face-down cards in column 8. My calculations say that ten columns in the tableau is just barely enough to get the job done (and I fully trust IM Bartacus and IM Bug are more than capable of reaching the same conclusion) and the actual cards were nowhere near the worst-case scenario. With winning reduced to a mere formality, Blue had no chance to redeem himself. He tried to inject a little humour by rapping in the Iambic pentameter but it was all in vain.

In summary, a great game with both Team Good and the Impostor having legitimate chances to win until the very end. IM Bartacus and IM Bug navigated most of the traps but let a few bad ones through, and the position looked desperate at one stage. But we managed to pull everything through in the end – until Blue had an absolute brain-fart, miscalculating a critical decision at the start of round 5 and giving IM Bartacus a good reason to believe Blue was the impostor. IM Bug tried to salvage the situation by explaining that “1 impostor” was written in red font and therefore the impostor should be Red. But my Random Number Generator app would have none of that and Blue was declared the impostor anyway on the tie-break. In the end, honours were shared with Team Good winning 100VP out of a possible 200.

Post-Mortem Analysis – Round 4

Link to Round 4 is here

Link to PMA Round 3 is here

Link to yet another silly story is here

At first sight, the situation looks desperate: With two Kings popping up on columns 8/9 we are most definitely not swapping the ladies on those columns any time soon. But what’s lost on the swings can be made up on the round-abouts if you pardon the terrible cliché, and we suddenly find Spades are looking promising.

We also took care to “almost-expose” the Ace of Hearts in column 3. Although exposing Aces is usually undesirable, we might be close to completing Hearts, so a reasonable compromise is to have the Ace buried by only one or two cards.

This highlights one of the necessary skills for the improving player – the ability to change gears when necessary instead of stubbornly sticking with the wrong plan. Our game plan should be “Spades or bust”. We have every card except the Jack. Moreover, we can arrange these cards into two columns: one for the KQ and the other for T98765432A. Team Good finally gets some luck from the tableau with some useful cards in column 10. The critical decision arrived at “Score=419”.

Spades are looking promising

Red suggested “jf” on the basis that (1) it avoids exposing another Ace and (2) if we get our million-dollar card then we still get to remove Spades. The big hole in Red’s suggestion is if we get a bad card then our “almost-Spade-suit” is separated into three columns, which is a lot worse than only being separated into two columns. Hence Team Good correctly went with “0xcbdbafad”. No wait, Spider is played with 10 columns, not 16. I meant to say Team Good correctly went with “cb,db,af,ad”. It is much more important to set up Spades than to be scared of an extra Ace. Poor Red probably needs to sneak through just one more bad decision to regain control of the hand, but Team Good isn’t giving an inch. Any game involving blobs from Among Us is not for the faint-hearted!

With no more turnovers available, 17 face-down cards in the tableau seem daunting, but experienced players know that if we can catch a lucky break or two, everything can quickly collapse with victory to the good guys. Oh yes, having one suit already removed definitely helps!

Post-Mortem Analysis – Round 3

A short but highly eventful round. The card gods saw fit to give us Three Turnovers. The card gods also saw fit to give us the Three of Diamonds, enabling us to remove the Diamond suit. Unfortunately, they also threw in that nasty logical disjunction operator instead of the logical conjunction that Spider players and mathematicians so dearly love. To put it in layman’s terms, we were able to take three turnovers or remove diamonds, but not both.

The interesting part of this round was Red suggesting we not remove Diamonds and keep flexibility, thus effectively backtracking on what he said the previous round. As I mentioned earlier, a lot can change after 10 cards are dealt simultaneously instead of sequentially. And indeed, all the signs are pointing to the Diamond suit: we received the Three of Diamonds and plenty of Jacks. Hence the Queen of Diamonds in Column 4 is suddenly a good card. Also, we are nowhere near completing any other suit and the number of cards is dangerously high, so there is little chance we could progress without removing Diamonds.

In the end, we turned over only bad cards in the tableau, achieving only 2 turnovers instead of a guaranteed minimum of 3. But it’s not all doom and gloom if you pardon the terrible cliché. Clubs and Hearts are starting to look promising. It would have been nice if we could “swap the ladies” in columns 8 and 9 but this turned out to be not quite possible.

KNOWLEDGE BOMB: in the latter stages of the game, it’s often wise to think about “how can I progress after getting the next turnover or empty column” rather than “how can I maximise the chances of getting my next turnover or empty column”. In the context of our current game, I would be happy to accept a Backgammon doubling cube centred at 2, despite turning over only 2 cards in Round 3.

After reading the comments, I got the feeling the readers may have cottoned on to the fact Red is the impostor. What should Red’s game plan be? Should he start playing innocent and hope the game will rot13(shpx) itself up by natural causes?  Or is it necessary to sneak just one more bad decision through? I guess a true impostor would have already memorised the official blockchain of suggestions and start thinking about how to convincingly pin the blame on Blue or Green. But as the purpose of this blog is to help improve the reader’s skill at Spider Solitaire I have mainly focussed on that – so the Among Us component plays second fiddle if you pardon the terrible cliché!

Before dealing a new row, the team decided to add the move “cb”. Technically this should not have been allowed but I was willing to let it slide. But it is a good sign that my readers are paying attention to “the little details” since this is exactly what is needed to improve to IM level or beyond.

And the less said about that Spider-GM joke, the better 😊

Final position of Round 3



Post-Mortem Analysis – Round 2

Link to round 2 is here

Link to PMA Rounds 0 & 1 is here

I believe the team made a significant error on the very first decision. What usually happens is the most interesting decision of a round occurs immediately after dealing ten new cards. Subsequent decisions are usually easier because much of the important analysis has already been taken care of.

Red suggested “ge,gd,if,ie,ie”. I don’t like this option on two counts: first, we expose the Ace of Diamonds. Secondly, we lose the important Seven of Spades in Column 8, together with several in-suit builds such as K-Q of Clubs. This would later turn out to be important.

“Hang on”, you say. “Doesn’t the alternative play expose the Ace of Clubs in Column 5?”. To which I reply, “yes, but not all Aces are equal. We anticipate it is difficult to avoid exposing the Ace of Clubs. After all, an empty column is an empty column – so if we don’t take it now, there’s a good chance we’ll be taking it later. Whereas if we found an excuse to not turn over Column 9 then there’s a decent chance the Ace of Diamonds stays buried for some time”.

I like Blue’s option of “hd,fj,fj,ha,hj,(d1=h3), hf”. That results in the following position before turning over column 8.

Game State after Blue’s option

By not messing with the low cards in Column 9 we retain much more flexibility with other low cards in columns 2,3,5. True, having a King in column 6 rot13(fhpxf) after we worked so hard for that empty column, but the worst-case scenario says we still have atomic runs in columns 5 and 7. That’s plenty as far as our chances of winning back an empty column are concerned.

The other problem with Red’s play is that by not sorting out column 8, we risk “one-hole-no-card”. Note that there are very few columns that can be turned over at the cost of only one column – and therefore a strong chance we will run out of things to do once all cards in column 9 are face-up. And sure enough, this is exactly what Red had intended all along:

We have an empty column after “ed”. If we could ask an innocent child to extend his hand and hold the Six of Hearts for a few seconds then everything is happy and we can turnover a card in column 8.  Unfortunately, someone would probably accuse us of cheating – this sort of “injustice” is typical when your position is not flexible enough to withstand bad cards.

Red was also entertaining thoughts of almost-completing the Diamond suit but the team managed to avoid that trap, correctly diagnosing it was not worth chasing the Diamonds when the likely reward is exposing a relatively useless Queen. So Red did not get everything going his way. Still, the game was very close in the end, so Red only needed to sneak a few bad ones past the team to achieve his nefarious ends.

In summary Round 2 was a great success – for the impostor. The sharp-eyed reader may have noticed Red pointed out the problem after the damage had already been done (Red was hoping when he tries to rectify the situation after the damage is done, it only makes things worse, and it makes him look like a good guy 😊) And having an excess of even-numbered cards certainly didn’t help Team Good!

KNOWLEDGE BOMB: if you ever find yourself in a situation where you can’t turn over any cards despite having one or more empty columns, there is a fair chance you failed to extract maximum value from a position of strength. Use the zee-key (after the game is over, obviously) to find out where you could have played more strongly.

Voting Results Are In! (alternative version)

Red and Green had done it. They had beaten the Royal Game at the highest difficulty level, without undoing any moves, and all this despite the shenanigans by Blue.

But the big winner was social media. With expert live-commentary entertaining all viewers and dissecting every decision, every good, and every bad card in simple language, social media platforms had every right to boast how they had successfully connected blobs all over the world. Red and Green were relative newcomers. It was well-known the game was beatable with expert play, but nobody expected them to achieve awesomeness on the big stage. But achieve awesomeness they did. The post-match interviews were a blast and Green even improvised a rap song in the iambic pentameter at one point, to thunderous applause.

Red: This is gonna be massive.

Green: Thanks to the wonders of technology, the Royal Game would finally take its rightful place among the likes of Chess, Poker, Bridge or even Tetris 99 Battle Royale. Hang on a moment. What is this?

Green watches a video on his mobile phone. A Blue-skinned player has dealt a row of cards and is considering his options. The video alone has three million views and counting, and one didn’t need a Ph. D. to realise this is statistically significant at the α = 0.05 level.

Green: Blue eventually finds a way to remove a complete suit of Hearts, but in the process, she made it mathematically impossible to win regardless of the permutation of unseen cards. Hence the hashtag “#blueboo”.

Red does not share the slightest concern, his eyes fixed firmly on his own mobile phone.

Red: Incredible Game 5. Magnus Carlsen looks horribly passive but he has correctly calculated there is no way for White to improve his position. A well-earned draw with the Black pieces. No way I could escape like that.

Green: There are a large number of #blueboo tweets going viral thanks to the likes of RojoTheGreat123, RojoTheAwesome456 and RojoTheGM789. Hmmm … these look like bot accounts with a profile pic of a Spanish flag.

Red: I never heard of this #blueboo. When did you –

Green: The overarching narrative seems to be anybody with blue skin is inherently bad at Spider Solitaire. Now you and I both know that even if our Blue-skinned team member played poorly, there is no logical reason why all other Blues on this planet would be just as bad –

Red (squirming in his seat): What does it matter? We proved we can wield a mean deck of cards, who cares what the others th–

Green: You don’t understand. Suppose you took the entire population of Blobs, then add an order of magnitude and have every one of them chant “Red Is Sus! Red Is Sus!” How you would feel … wait a minute, you’re not –

Red stands up and glares at Green. Green races towards the exit only to find the doors locked. <sarcasm> How convenient! </sarcasm> Red pulls out a knife and Green can only stew at the injustice of it all. If only the Random Number Generator had yielded an odd number instead of an even. Red would have been voted off instead of Blue and all the good guys would have lived happily ever after. Instead, here he is – cornered by an Angry Red Blob and having approximately three nano-seconds left to live.

The end.

Post-Mortem Analysis – Rounds 0 and 1

Link to Round 0 is here

Link to Round 1 is here

Round 0

Not much in the way of tricky decision making. Unless we get a really good round with many turnovers it’s virtually impossible to suggest an egregiously bad line of play without arousing a disproportionate amount of suspicion.

That being said, when no more turnovers were available, Red tried to rot13(shpx) things up by increasing the number of in-suit builds at the expense of “junk-piling” a column with a Queen. Even though Queens were cheap because supply exceeded demand, I believe it is a definite error in the long run.

Red tried to rot13(shpx) things up with “he” before dealing

I’ve played enough games to know that the supply-demand relationship can change drastically. This phenomenon occurs because the rules of the game demand 10 cards to be dealt simultaneously instead of sequentially. This problem is exacerbated when you’re forced to deal two rounds in quick succession. Before we know it there are too many Jacks and Kings in play and the once-hated Queens suddenly become our only hope of salvation. All this trouble just for the sake of one measly extra in-suit build!

Needless to say, IM Bartacus and IM Bug weren’t falling for Red’s shenanigans this early in the piece 😊

Round  1

A fairly good result with three columns containing no face-down cards – thus we have fair chances of getting back at least one empty column on the next deal. We have 10 out of 13 cards in the Diamond suit, but the cards are scattered in various columns and it’s odds-against the Jack, Five and Three appearing soon – therefore now is not the time to think about the Diamond suit, unless we somehow manage to satisfy the proverbial “all other things being equal”.

Decision 19 stands out as a particularly interesting moment when all three Kolourful Kibitzers suggested a different line of play.

Red suggested “hb, he, hf, hg, fh, eh, ef” which I didn’t like because burning the 4 of Hearts costs some flexibility if we need to work on column 9 – not to mention column 2 becomes harder to work on. If we did burn the 4 of Hearts we could at least try to get “compensation” by lining up the 7-6-5 of Spades (as per Blue’s suggestion) and turning over Column 1. Admittedly, but the difference is small and hard for even a GM to argue convincingly. All things considered, the three blobs were well behaved that round.

A difficult decision … hard to criticise the impostor here

Voting Results Are In!

Schistocerca Americana (a.k.a. IM Bug) has voted RED
Bart Wright (a.k.a. IM Bartacus) has voted BLUE

Random Number Generator (tie-breaker) has BLUE

Blue was Ejected.

Blue was not the impostor.

(Red was the Impostor)

Oh well. Random Number Generators can be fickle beasts. At the start I kinda wanted Red not to be the impostor because of the usual association “red-means-danger” but the RNG decreed otherwise, and who am I to argue with the RNG? So no bonus 100VP for the team. But Bart and Bug got their IM titles and that’s the main thing right?

In the next few posts, I will discuss some key moments in the game and dissect where the players and blobs went right or wrong.

Bart Wright and Schistocerca Americana awarded IM Titles

It’s official: after achieving victory on the Four-Suit version of Spider Solitaire sans rot13(haqb), with one impostor trying to rot13(shpx) things up at every opportunity I have decided to award both Bart Wright and Schistocerca Americana the title of International Master. It’s a bit of a misnomer in that we don’t get to travel all over the world to play in tournaments and prove we can mix it with the best – but I will stick with the IM title because it is considered the next level below GM and both players certainly displayed an extremely high level of skill. The other reason for the IM title is because it allows Spider GM to showcase himself at his brilliant worst. If you would like to guess the punchline before reading on, I have inserted the usual spoiler blocker.

In Chess, all titles are obtained by playing in enough tournaments and getting a sufficiently high score against decent opposition. Players can achieve “norms” in individual tournaments and you need enough norms to prove you didn’t get lucky in a single tournament. Your rating also needs to be sufficiently high. The good news is you don’t lose your title after a dip in your rating (or a string of bad tournaments), so you keep your title for life – save for something incredibly stupid, such as an arbiter finding compromising images of Stockfish recommending the best move on your mobile phone. This is fair enough: if there was no guarantee of keeping your title there would be much less incentive to achieve it in the first place. A GM title implies that your ability/talent is enough to mix it with the world’s best, provided you are willing to put in the time and effort and life doesn’t get in the way. An IM title is pretty much the same thing except “the next level down”. Then you get Federation Master titles and of course you can also add a W-hook (using the Scrabble vernacular) for female players. Hence WGM, WIM and so on.

Unfortunately, IM Schistocerca Americana is a bit of a mouthful even for somebody who recently composed a work-related rap song to the tune of Million Voices by Otto Knows. Therefore, he gets the indignity of being renamed IM Bug. And Bart Wright suffers an even worse fate: