Connect Four – Bring It On!

Okay, I’ve submitted to temptation and finally downloaded the MobilityWare Spider Solitaire app even though it’s probably rigged – but only because I wanna try the daily challenges.

A daily challenge is a certain starting configuration that is guaranteed winnable. MobilityWare has several games (not just Spider) and solutions can be found by googling. Games include Freecell, Solitaire Draw 1, Solitaire Draw 3, Spider Suite 1, Spider Suite 2, Spider Suite 3, Crown, Tripeaks, Addiction. That’s quite a lot of variety, and I will admit I don’t even know the rules for some of these games. Although I thought the “Suite N” part was weird because it clearly should be “N suits” where N = 1,2,3 … no wait, there’s no solution for N=4?!?!?!?

If a solution is given, it means two players can play the hand corresponding to the same day and same game (e.g. Tripeaks, 5th of February) and they are presumably guaranteed to get the same starting hand. If they didn’t get the same hand and wish to check the solution, at least one player would complain very quickly! However, since I can’t find a solution for any 4-suit Spider hand, it is mathematically possible (though unlikely) that two players can play DIFFERENT 4-suit Spider hands corresponding to the same day and they would be none the wiser unless one of ‘em specifically asks the other if they get matching hands.

NOTE: in some cases only partial solutions are given (because some games take longer than others) and you have to pay some $$$$ to get the full solution. But a partial solution is more than enough to confirm two players indeed get the same hands.

Assuming two different players do get the same 4-suit Spider hands, I can play these hands with reasonable expectations they would not be ridic hard – since I can’t see a game developer with rot13(fznyy qvpx flaqebzr) punishing random novices with insanely difficult hands if my win rate is too high, even if he or she works at Zynga (or an equivalent company).

I think a fun challenge would be Connect-Four. On every day of the month I either win or lose the hand corresponding to that day. Four wins/losses in a row, horizontally vertically or diagonally means I win/lose. For instance, if I remove all eight suits on days 5-13-21-29 then I achieve a winning Connect Four, unless I also achieve a losing Connect Four earlier (such as 9-10-11-12). The downside of playing Connect Four of course is if the game ends after 6 days, then I might have to wait a while before the next month! The screen shot below is for April 2023, coming soon to a place near u.

Ultimately, I am interested in playing all the daily challenges in April 2023. Can I expect to win most hands? Also, do hands get tougher as we approach the end of the month or is it roughly uniform difficulty?

Here are the hands for N-suit Spider Solitaire corresponding to 29 March, for N = 1,2,3,4. I would be interested if readers can confirm they get the same starting hands for N=1,2,3,4.

Of course the result I am really interested in is if you get the same hands for N = 1,2,3 but different hands for N=4. Then I would know something suspicious is going on!

Toy Blast – It’s A Force Delete

It’s official – I was finally forced to delete Toy Blast from my phone. Some time ago I thought this was one of the cool games, but it seems the random number generator is rigged, just like every other game. Of course, I recognise this is only my opinion, which I can’t force onto others. All I can do is turn to page 7374 of the Big Book of Clichés and say “judge for yourself”.

The problem is if you attempt to design a game with rigged RNG, it’s probably too easy to design an experiment that can expose certain issues. The culprit is level 7374 which looks like this:

It is beyond the scope of this document to explain the rules of Toy Blast in detail. The essential points are:

  • To beat this level, one of the requirements is getting at least three slices of bread. This is difficult since there is only one toaster which cannot be accessed with ordinary cubes. Power-ups are a must.
  • The basic power-ups are rotors, TNT and Rubik’s Cube. Rubik’s Cubes are always a particular color (one face is a solid colour, other faces are random).
  • Power-ups are obtained by matching 5 or more ordinary cubes of the same colour in one move.
  • Combos can be obtained by getting two or more adjacent power-ups. Adjacent means touching horizontally or vertically, but not diagonally.
  • If the player activates a Rubik’s Cube + rotor combo then every ordinary cube with matching colour turns into a rotor that can be oriented horizontally or vertically.

Let us define a “coin-flip” as follows. The player activates a Rubik’s Cube + Rotor combo when exactly one of the four cells in the top row is a matching colour. The following four images show example of coin-flips. For instance, the first diagram has Y-B-G-B in the top row and a Yellow Rubik’s Cube next to a Rotor in column 6.

Note that if more than one cell is the matching colour, we do not count it as multiple coin flips. For instance, if the top row was Y-G-G-G and we activated a Green Rubik’s Cube + Rotor combo then I do not count that as three coin-flips. It’s not even worth one coin-flip. It’s ZERO coin-flips – the same number of points you get for playing a phoney in Scrabble.

The term “coin-flip” should be self-explanatory. If (in the first diagram) every yellow cube turns into a rotor then the yellow cube in the top row will collect one bread with 50% probability. Any other yellow cube on the board cannot collect bread, even if the player were allowed to call directions for every individual rotor. As every student of probability knows, all this assumes rotors are indeed horizontal or vertical with 50% probability.

I played level 7374 multiple times with the objective of getting as many coin flips as possible (not necessarily maximising my chances of beating the level). With enough skill and luck, it’s possible to get three coin flips in a single game. After sufficiently many games I got 50 coin flips and every time the rotor was vertical instead of horizontal. I did not hit the toaster once in 50 coin flips. Yes – Every Single Time.

On one occasion, I was down to my last move (see images above) and was destined to fail the level for multiple reasons. And the software still saw fit to give me the vertical rotor in the top row.

Just out of interest, I have already beaten level 7374 (I’m up to 7377) and managed to beat all levels without spending any coins (e.g. getting 5 extra moves or strategically changing the colour of a single cube). It’s hard to avoid the conclusion that Toy Blast is trying to punish players that are playing a little too well.

It is quite possible that something untoward happened to Peak Games (e.g. acquired by another company) when I wasn’t looking – but I do not intend to discuss this in detail. I recommend the reader google search “Peak Games” and “Zynga”.

And if you happen to be a game designer – don’t even think about it. You are not fooling anybody.

Let me repeat that for the 7374th time:

You. Are. Not. Fooling. Anybody.

It goes without saying the same holds for Spider Solitaire. I believe we have reached the point if Joe Bloggs claims the game is rigged then the onus of proof should be on the game developers, not the player.

To be fair, I should point out that Toy Blast survived far longer than some other game apps on my phone. Some really awful games (both match-three and card games) basically “didn’t even try to hide it”.

Math Just Got Weird

TreeCardGames, the rogue Spider Solitaire company that started it all, is resembling the number 3, back in the spotlight and losing its religion. This time the subject is manipulating reviews.

We’ve all seen a number of game companies that were somehow born to suck, could never release a half-decent game, and figured the only way to make a presence is to fudge the reviews and make them look better than they really are.

There are many ways to game the system, terrible pun notwithstanding. You can cherry pick the good reviews and hide the bad ones. You can write a review for your own game by posing as a customer. You can create bots to sing the praises of Hero Wars or whatever your rot13(cvrpr bs fuvg) happens to be called. You could give players chance to give a 5-happy-star review for 10 extra coins after beating every single level. If you were the CEO of Shay Dee Games, then you could demand your employees do one or more of the above. It’s been done before, and googling is left as the proverbial exercise for the reader. The possibilities are endless – you can pretty much do anything, provided it obeys the laws of physics.

Treecardgames has a small number of reviews that can literally be counted on the fingers on a single human hand. We can see the scores are 1,1,1,2,3 and yet the overall score happens to be 2.6.

I’m not sure where the 2.6 comes from. It certainly ain’t the mean or median. I doubt it would be the skew or kurtosis. It might be some fancy formula I’ve never heard of, such as computing the arithmetic and geometric mean, calling them foo and bar, then computing the arithmetic/geometric mean of foo and bar, rinsing and repeating until you converge to the limit. Maybe some of the scores are “doublers”, an idea borrowed from Cracking The Cryptic. Then the math would actually work, if you apply doublers to the right scores.

Maybe TreeCardGames was thinking if there were about 500 reviews with an average score of 1.6 then they could pretend the average score was in fact 2.6 and then the average reader will be too lazy to verify the math were correct/incorrect. But as you can see, this is not a viable dodge.

Unless I hear back from TreeCardGames explaining how to derive an overall score of 2.6 given individual scores of 1,1,1,2,3 this is one more entry to the list of reasons why rot13(GerrPneqTnzrf fhpxf!!!!!). For what it’s worth, I think the overall score should be -11123 out of 5 and deriving the number -11123 is left as an exercise for the reader.

Have you come across similar examples of hilariously bad calculation of overall scores? Bonus points if the correct overall score is LOWER than the given overall score 😊 Let me know in the comments!

The Things That Really Matter

Now that the year is drawing to a close and holidays are upon us, I now have time to revisit the things that really matter in life, including the Royal Game.

Some time ago I uploaded my Ninja Monkey code to GitHub (my username is hilarioushappystar) and now I wish to discuss this in more detail.

To generate a “result” I need two seeds which I call “Game seed” and “Monkey seed” for lack of better alternative. Let us assume a pair of seeds is written as (g,m), where g and m represent the game and monkey seeds respectively.

The game seed determines the initial position. The monkey seed determines the monkey’s behaviour. For instance, if the seeds are (27, 1) then the monkey would always start with the move “ca”, but if the seeds were (27, 2) then the monkey would prefer the move “cb” in the same starting position.

The screenshot below shows a game seed of 27 and a monkey seed of 1. The monkey loses with 24 face-down cards remaining. I do not claim this to be a paragon of virtue from a software engineering perspective.

Of course, the result is pseudo-random in the sense that with game seed = 27 and monkey seed = 1 the monkey always loses with exactly 24 facedown cards. At least that’s the result I get on my machine. Your machine may yield different results, but if your monkey loses with e.g. 16 face down cards the first time then it should lose with 16 face down cards every time.

Here are my results. Note that the game seeds are not indexed from 1 to 20. By using different seeds for monkey and game, I reduce the chances of confusion when trying to reproduce these results.

Note that these results encode the result of the game: if there is at least one face down card remaining the monkey must have lost. I assume the monkey always wins if it manages to expose every card in the tableau (otherwise I could always put an asterisk next to a zero if the unthinkable happens).

Game12345678910
2724272719101729262214
821724182092516182022
4114211011272715192017
1242693318212626302330
6227232723212621222125
311824024142516282620
9416172925152624272620
4718182021242818222623
142141121162323915199
7142713172122122188
21423333222223022322033
1071714172118181618015
32227262422262232252230
16120131514191116121212
48414141414119811011
242251505251423251923
1211720027261721271821
36426281924222018251924
18225232528262218311723
9191510131217771714

We can make a few observations:

  • Out of 20 games, there are 5 hands where Monkey scores one victory. For the other 15 hands the Monkey never wins
  • These five wins appear in only two columns. This is a statistical glitch and there is no logical reason why two games with same monkey seed and different game seed should be correlated. I blame the small sample size 😊 (about the only utility of columns is to assist in reproducing the raw results).
  • Some hands look really bad. For instance in game 214 the Monkey always has at least 20 face down cards at the end of the game.
  • Other hands look promising, for instance in game 484 the Monkey as at most 14 cards remaining

This is an example of an “exploratory analysis” (as opposed to explanatory analysis). I’m trying to get familiar with the data and I don’t have a specific hypothesis that I’m trying to prove. Of course, the more data you collect, the more chances of finding something interesting. For instance, I could have chosen to have 15 monkey seeds instead of 10, or 50 game seeds instead of 20.

Once you have completed your exploratory analysis, you might be able to form a concrete hypothesis about a spider program which you suspect to be dodgy. For instance, suppose that Shay Dee Games releases a new version of the Royal Game and we find that in every hand, either the Monkey consistently gets 10-or-less cards face-down or consistently gets 20-or-more cards face-down at the end of the game. We would suspect something is amiss, even if Shay Dee has the “correct” average win rate computed over all games. Of course, all this assumes we are able to determine the identity of every face-down card.

When testing a concrete hypothesis, things start to get technical. T’was brillig slithy toves gyre gimble wabe blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah Kolmogorov-Smirnov test blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah – or if you want the less technical version, yes we have formally proved that Shay Dee Games is indeed rigged.

Note also I have omitted certain stats. For instance, I could have recorded the maximum number of empty columns obtained at any stage of the game, number of suits removed or the number of levels in Toy Blast I manage to beat before the monkey finishes the game. I have also omitted discussion of specific programs that I suspect to be biased. The important point is the reader has something to go on if he wishes to investigate the veracity of a specific Spider Solitaire program.

Until next time, happy Spider Solitaire playing!

treecardgameS develoPs exclusive gAmes with your fun in Mind

News update: I just checked my spam folder and found EXACTLY WHAT I NEEDED: an excuse to post something meaningful in my Spider Solitaire blog after it ran dry for more than a month. I should probably check this folder more often from now on.

The word “SPAM” can be obtained by deleting the appropriate letters in the title of this post, but the word “HAM” cannot (rearranging letters is not allowed). Therefore, I have classified the image below as spam.

For what it’s worth, TreeCardGames is the software company that started it all.

Has anyone come across similar spam messages that are related to the Royal Game? If yes, how did you deduce it was spam? Let me know in the comments 😊

Spider 99 Should Be A Thing

If you’ve read this blog during the last few months then you probably know I like to spice up the Royal Game by mashing it up with other games such as Backgammon or Among Us. I’ve now decided to take it to the next level by combining the Royal Game with Tetris 99.

Tetris 99 Spider Solitaire mash-up

For those unfamiliar with the concept, Tetris 99 is an insanely cool game from the Battle Royale genre. The aim is to be the last one standing. Your playing arena is at the centre of screen, and you have 49 opponents on your left and another 49 on the right. Doing the math is left as an exercise for the reader. You can clear lines and send them to opponents, and they can return the favour. I thought it would be even cooler to have Spider Solitaire instead of Tetris, if only because both games have exactly 10 columns in the tableau.

If I were tasked with designing Spider 99, I would start with one-suit only, as shown in the diagram. After all the game is supposed to appeal to a large audience (presumably most of whom will be novices). Besides there won’t be much time to strategize for complex move sequences. Clear a suit and you get to damage other players by forcing them to prematurely deal a fresh row of 10 cards. You can get combos by e.g. clearing suits for two or more moves in a row. And don’t forget your opponents will be looking to do the same to you 😊 You can change your “settings” to target random opponents, opponents close to dying, or opponents who are attacking you. If you K.O. somebody then you win badges and your attacks become more powerful. If you top out by having too many cards in a single column then game over. Technically, it should be “bottom out” since unlike Tetris 99 stacks start from the top not the bottom. But you know what I mean.

Once you get down to 50 players remaining we can up the difficulty level by moving from 1-suit to 2-suit. And of course, 10 players remaining means we get the dreaded 4-suit level. And before you ask … rot13(haqb) is not allowed. The original Tetris 99 music is one of many reasons why that game is awesome and I see no reason to change it.

Unfortunately, I don’t have the smarts to program Spider 99 by myself, so this will remain as a thought experiment only. But at least I have a reason to add a new post to my blog. 😉 Of course if you have any other insanely cool ideas for mashing up anything with Spider Solitaire then please let me know. Until next time happy Spider Solitairing.

The Chess Scandal Everyone Is Talking About

With the Sinquefield Cup finally over, I think now is a good time to give my thoughts on the scandal.

Strictly speaking, this doesn’t really belong in a blog that purports to talk about the Spider Solitaire, the whole Spider Solitaire and nothing but the Spider Solitaire, but I believe that Chess and Spider have (at least) one thing in common: strong players always get the raw end of the deal when it comes to cheating accusations. Besides, I have an IM title or better in both disciplines 😊

The basic problem is strong players just “know” when something is off – but good luck expressing the word “know” in language that a layman and understand and a lawyer cannot argue with. I count myself lucky I was able to actually prove that dodgy Spider Solitaire servers do exist.

Here is my opinion on the whole saga – which I have listed in dot point form. I will not attempt to justify these dot points. No doubt every man, dog and millipede on the planet has formed their own opinion on the matter. Googling various facts and coming to your own conclusions is left as the proverbial exercise for the reader.

  • Niemann is an rot13(nffubyr)
  • Niemann should never have been invited to play in the first place
  • Niemann has form when it comes to being an rot13(nffubyr) and cheating
  • Carlsen has good reason to withdraw, even without evidence of cheating. If cheating is proved then that is icing on the cake if you pardon the terrible cliché!
  • Carlsen doesn’t owe anyone an apology or explanation. If the tournament organisers wish to defend 2+2=5 (i.e. invite Niemann) that’s not Carlsen’s problem. Maybe Carlsen could have handled things better with hindsight, but his options weren’t great to begin with.

FWIW, I have a proposal for solving the cheating problem in chess, called the Useless Task Protocol. This is an attempt to give more “bargaining power” to the experts. Again, I will not attempt to justify the motivation behind this protocol and leave it as an exercise for the reader. If you can see where I am coming from, then chances are you have the right analytical mindset to excel at Spider Solitaire 😊

Useless Task protocol

I wish to propose a new rule for competitive chess:

That’s all there is to it. Just move your king towards the centre and leave your opponent with the “know-what’s-coming-but-can’t-do-much-about-it problem”. It doesn’t matter if you resign, get mated or your opponent starts playing random moves. You could have a dead drawn (or indeed a winning) position and still elect to call opponent for cheating. You can take a punt, knowing the worst that can happen is your game is counted as a loss. You could end up looking like a goose but there is no possible universe where can you get sued for defamation.

If your king can’t (legally) reach the centre, you can still call your opponent if you’re willing to risk heavy penalties for a false alarm. Conversely there is no compulsion to call opponent for cheating if your King is on e4 but you believe your opponent is legit.

I proposed this rule after the cheating scandal involving Nikhil Kamath and Vishy Anand, but nobody took it seriously. I do not claim it’s a perfect solution, but something worth mulling over. The diagram above shows a plausible position that might have arisen if the Useless Task Protocol was being used (I would recommend White should wait for Black’s next move before stopping the clock).

Steve’s Game – Summary

This was a well-played game by Steve. There were no major inaccuracies and he overcame a difficult start. He kept himself in the game and only after dealing the final 10 cards he had a good position for the first time. And he duly converted. Of course I would bet my Ph. D. thesis to a brick that Steve cherry-picked that game out of over 300+ games to demonstrate it’s possible to win even with a bad start. It is highly likely a fair percentage of Steve’s victories were walkovers after a good start.

There were a few inaccuracies like not realising he can get another in-suit build at no cost, or missing the fact some column had a 5 missing (easy to do when you have a sequence like 8-7-6-4-3-2-A). But there is no individual play that screams “ThIs GuY cAnNoT pOsSiBlY bE a GM”. If I had to give a single pointer for Steve to improve his game even further, I would choose the concept of “good and bad shape in individual columns”.

Steve has a good feel for the game. He can anticipate the Job 38:11 problem several moves in advance, and either he will find a way around the problem or at least avoid acting surprised when it does hit. He does not explicitly mention “one-hole-no-card” – but that’s merely one of many ways of explaining a concept that Steve is no doubt familiar with.

Steve was unable to get close to removing a suit before the last round – but not for lack of trying. The card gods decreed there would be no reasonable prospect of doing so before the last round – and then Steve showed his skill when it mattered most:  he found a plan that guaranteed the removal of a complete suit. It was relatively straightforward to verify removing the suit was not a trap, and victory was a mere formality.

The process of finding the correct plan at the start of round 5 is not trivial, and admittedly I glossed over that. Steve gives plenty of examples of finding a good plan in complex positions in other chapters of his book. I recommend you get the book (if you haven’t already done so) and study his thought processes for the examples given by him.

As for Steve’s book, my main criticism is that his notation for moves is very unwieldy. Yes, I get that he is trying to explain important concepts like “breaks, doors, locks, delaying, etc” but I am pretty sure there is a way to get his message across without resorting to clumsy notation. Apart from that, the entire book is an extremely useful resource for someone who is serious about improving their game.

Overall Strength

Overall, I would say Steve is GM strength, or close to it. Unfortunately it’s difficult for me to judge properly unless I had access to the moves in all of the 306 games he played.

Steve Brown’s Game: Round 5(2)

I will only give the general plans and avoid giving exact move sequences. Verifying this is all legit is left as the proverbial exercise for the reader.

As a general rule, being able to visualise long move sequences is an essential ingredient to playing well at Spider Solitaire. If you struggle with this, I recommend you play with “pseudo-undo” i.e. undo is allowed provided you don’t gain information you’re not entitled to by turning over a card or dealing from the stock (note that removing a suit does not gain information). If you pardon the terrible cliché, practice makes perfect!

Another useful tip is this sort of situation is to start with the following question: “Can I remove a suit if I were willing to trash my board in every way possible?” If the answer is yes, then a more careful analysis will often yield a way to remove a suit without trashing up the board so badly. Of course, there are cases where prematurely removing a suit does cause the loss of a winnable game – but if you’re able to find a move sequence that completes a suit, then you should be good enough to work out if removing a suit is desirable.

  • Clear columns 2, 3
  • Extract the C4:Kc
  • Expose the C0:7h
  • Clear columns 7,10
  • Order column 8
  • Tidy up
  • More tidying up

By this stage even my Ninja Monkey friend is claiming the game is won.

  • Clear the Spades

The rest of the game is just a formality so the moves are omitted. The identity of the remaining face-down cards are available in the screen-dump below:

And that brings us to the end of the game. Well played Steve!

Oops – We Digress Again

Quiet Quitting

Recently I came across the term “quiet quitting” when googling/facebooking on my mobile phone. Wikipedia defines it as doing exactly what the job requires, not more or less. It is also known as “work to rule”. QQ is related to the concept of lying flat or Tang ping, not to be confused with planking.

If you’re unfamiliar with quiet quitting, your first thought could be “rot13(jul gur shpx) is it called quiet quitting?!?!?”. That was my first thought as well. I was even on the verge of asking this question on Facebook, but my gut told me not to bother since several others must have done the same by now.

After searching various sources, I concluded quiet quitting was a term invented by some rot13(ceb-ohfvarff nffubyr) trying to push a narrative that employees are lazier and more entitled than what they really are. Although to be fair, “work to rule” does have a whiff of rot13(junggurshpxrel) as well.

Quiet Quitting and Spider Solitaire

For our purposes, the important question is “what does quiet quitting look like in Spider Solitaire?” We have already seen the results of quiet quitting when you’re proof-reading your Ph. D. prior to submission, but that was a “one-off digression within a digression” for lack of better phrase.

I would define QQ as playing on auto-pilot. This could manifest itself in various ways:

  • If you find a good move (or plan) don’t bother looking for a better one
  • Don’t bother looking for a chance to remove a complete suit.
  • Consulting a random number generator when faced with a difficult decision

A general theme is QQ tends to affect decision-making skills, rather than knowledge of the fundamentals. For instance, if you have some experience in the Royal Game you probably know that with two empty columns a run of four cards like 8-7-6-5 can be shifted onto a Nine, even if they were all different suits – and this is not something you are likely to forget, even if you were in quiet quitting mode.

I believe the average player is more likely to quiet quit if a game is going extremely well or extremely badly (since small errors are less likely to result in the loss of a game that should be won). Yes, there are other “human factors” such as tiredness, or something else bothering the player that is not Spider Solitaire related. Of course, that raises the question of why a player chose to play the game in the first place. Then again, somebody could be “born to quiet quit” and never reach their full potential despite playing for an extended period of time. I know of one such Scrabble player at work who is very low-rated despite playing the game for umpteen thousand umpteen hundred and umpty ump years. She was probably there for the “social aspect” of the game, rather than the love of  problem-solving or the thrill of finding a power-play with lousy-looking tiles.

QQ in a nutshell

In a nutshell, if I were pressed to come up with a reasonable definition of QQ in the context of SS, then QQ means playing without thinking. Regardless of your playing strength, this should imply a lesser win rate than expected. How much of a loss would be anybody’s guess, and I don’t see anyone writing their Ph. D. on this topic any time soon.

I do not see myself playing Spider Solitaire unless I put in my absolute best effort. That’s just my nature. I need a compelling reason to not go above and beyond. If I am tired or bothered by something unrelated to the Royal Game, I wouldn’t be playing in the first place.

Okay I agree that QQ is a garbage term and I only used it here in order to “score” a third digression before Steve’s game draws to a close. It really should be something as bland as “playing on autopilot” but then there would be no reason for me to blog about it in the first place 😉

What are your thoughts on quiet quitting (with or without a Spider Solitaire context)?