The Jo app icon: a fan of four aces on a blue card table calmjo
The greatest card game ever invented
Download on the App Store

How the computer plays

♠ ♡ ♢ ♣

The computer fills any seat that has no player in it, and takes over for a player who leaves. It follows the same rules as you and has the same information.

It cannot see your cards. It knows the cards face up on the table, how many cards each player holds, who has gone down, and which cards it saw players take from the discard pile. Every move it makes is checked by the same code that checks your moves.

Drawing

On its turn the computer takes the top discard if that card completes the goal, or if it matches cards it is already collecting for the goal. Otherwise it draws from the stock.

It does not take cards it cannot use. Every player can see what it takes, so taking a card it would discard next turn would give away information for nothing.

Buying

When it is not its turn, the computer buys the top discard only if the card helps its hand. This is the same test it applies when drawing.

It follows the same buying rules as you. It cannot buy after it has gone down. It has three buys per hand. It cannot buy back a card it discarded.

It also limits how far it lets its hand grow. Each buy gives two cards: the card bought, and a penalty card from the stock. Two buys therefore add four cards to the hand. At that point the computer stops buying for ordinary improvements, because extra cards in hand are extra points against it if another player goes out.

There is one exception. If a third buy would complete the goal, it takes it.

Going down

The computer goes down as soon as it holds every card the goal needs.

There is one exception. Early in a round, when no other player has gone down, it may wait one turn. It does this only when going down would leave it holding one or two cards it cannot use. If the next card it draws is the card it needs, it can go down and go out in the same turn, which ends the round. Waiting one turn for that is worth it. Going down first and then playing the last cards one per turn is not.

It never delays going down in order to keep buying. The goal takes six cards in round 1 and twelve cards in round 7, and these are usually the computer's highest cards. If another player goes out while it is still holding them, all of them count against its score. Cards on the table count nothing.

Adding to groups

After it has gone down, the computer adds every card it can to the groups on the table, its own and other players', before it discards.

Choosing a discard

The computer gives every card in its hand a score and discards the card with the highest score. Four things set that score.

  • Points. Cards left in your hand count against you. An ace is 15 points and a four is 4 points.
  • Use in the goal. If the goal needs threes, the computer counts the cards of the same value it also holds. If the goal needs fours, it counts the cards in the same suit that could form a four. An ace can be used at either end of a four: A-2-3-4 or J-Q-K-A. Two aces are two cards of a three, so the computer keeps them even though they are worth more points than a single king. It does not always discard its highest card.
  • Use to other players. A card that can be added to a group already on the table is a goer. The computer avoids discarding goers, because any player who has gone down can use one at once. It is also careful with cards that match what it saw a player take from the discard pile, but less so, because one card taken is weak evidence.
  • Time left. Keeping a card is only useful if the round lasts long enough to use it. Once another player has gone down, the round can end on any turn, so the computer discards its highest cards instead.

What it remembers

Every player can see which cards you take from the discard pile. The computer records them, and uses them to avoid giving you cards for the three or the four you are collecting.

It records only cards that may still be in your hand. When you play a card, it removes that card from its record. A card you discarded is a card you did not want. A card you put on the table is a goer, which the computer already avoids.

Each new hand starts with an empty record, because the cards are shuffled between hands.

Pace

If another player can still buy the card the computer is about to take, it waits a few seconds before drawing, to give that player time to decide.

How this is tested

There are two kinds of test.

The first checks the rules. Every move goes through the same code that validates your moves, so the computer cannot make an illegal move. Separate tests place it in fixed situations, such as a hand one card short of the goal, an opponent who has just gone down, or a card it saw a player take, and check that it plays as described on this page. The computer plays the same way every time it is given the same hand, so these tests give the same result on every run.

The second compares decisions. To test one decision, we create two versions of the computer that differ only in that decision, seat them at the same table, and play several thousand games from fixed shuffles. Both versions receive the same cards, so any difference in their final scores is caused by that decision.

Three decisions were tested this way.

Should it delay going down in order to keep buying?

No. Over 1,200 games, delaying added about 30 points per game to the computer's score, and its share of games won fell from about one third to under one quarter. The computer goes down as soon as it can.

Should it take a third buy?

Yes, but only when the card completes the goal. Over 2,400 games that buy improved the computer's score by about 14 points per game. Allowing a third buy for any single three or four was worth less than half as much, because finishing one group of a goal that needs two leaves the hand two cards heavier and still unable to go down.

What should it read into seeing a player take a card?

Very little. When one card taken was treated as strong evidence, the computer refused to discard any card matching it, held too many points, and scored about 14 points per game worse. Treated as weak evidence, it scored a few points per game better. The computer uses the weak setting.

A difference of one or two points per game is within normal variation and means nothing. Both results above are much larger than that. Where a change produced a difference too small to be certain of, the change was not made.