Contemporary Development With Functional Programming

Cassino Rules (Original Variant)

Cassino is a classic two-person card game using the standard 52-card deck. In our version, your opponent is the computer inside your iPhone (iPod Touch, iPad). There are many variants of the basic Cassino game. Starting with Version 1.1, Psellos Cassino plays three variants. This note describes the original variant, a kind of royal Cassino with simplified scoring. The other, more advanced variants are described on a separate page.

At any given point in the game, you have a hand of cards, face up at the bottom of the screen. The computer also has a hand, face down at the top of the screen. You take turns trying to capture cards in the middle. You should think of the cards in the middle as being on a table between the two of you. The object of the game is to capture more cards than your opponent, the computer.

At the beginning of the game, there are four cards in each hand, and four on the table. At each turn, you play one of your cards. Then the computer plays one of its cards, and so on. When you and the computer run out of cards, you each get four more from the deck. A game consists of six rounds like this.

There are three types of plays that you can make when it is your turn: capture, build, and trail.


The basic point-scoring play is to capture a card on the table with the same value of card from your hand. You can also capture several cards if their values add up to the value of the card from your hand. In fact, you can capture any number of groups of cards that add up to this value.

When you capture, you remove the card from your hand and the captured cards from the table. In a game with real cards, you would pile them up in front of you and count them at the end to get your score. In our version, we add the cards to your score as you go along. You win the game if you’ve captured more cards than the computer after all six rounds have been played.

Figure 1, capture possibilities

Figure 1

Capture Possibilities

The numeric value of a card is the one appearing on the card (2, 3, 4, etc.), with the following special values:

Jack   11
Queen   12
King   13
Ace1 or 14, your choice

In Figure 1, you could capture the ace on the table with the ace from your hand. You can always capture a card with another card of the same value. You could also capture the three and four on the table with the seven from your hand, because their values add to 7 (3 + 4 = 7). In fact, your seven can capture the three, four, ace, and six in the same play, because the ace (counted as 1) and six also add up to 7.

When making your turn, you can choose to count each ace (in your hand or on the table) as either 1 or 14. The flexible value of the ace is part of the fun. In this example, you could capture the ace, six, three, and four on the table with the ace from your hand. It works because you can count the ace on the table as 1 and the ace in your hand as 14. The 14 in your hand can capture the 3 + 4 + 1 + 6 on the table.


You can also use your turn to build a pile of cards to capture later. You add one card from your hand to one or more cards on the table, to make a pile that can be captured at a later turn.

Figure 2, build possibilities

Figure 2

Build Possibilities

Figure 2 shows the same game situation as above, but with cards selected for a build. You could add the ace in your hand to the six on the table to make a build of 7 (1 + 6 = 7). You would then expect to capture this pile with your seven at a later turn. Even better, you can add the ace to the six, three, and four on the table to make a larger build of 7. As with captures, this works because the three and four make a second group of 7.

You can only make a build if you can capture it with a card remaining in your hand. So here you can make a build of 7 only because you have a seven in your hand after the build. The capturing card is reserved for capturing the build; as long as the build exists and belongs to you, you can’t use the card for another purpose. If the computer makes a build, you know that it has a capturing card in its hand afterward, too.

A build is a riskier play than a capture, because your build is not reserved for you. The computer can capture or extend (steal) your build if it has the right cards. You can also steal the computer’s builds, of course. The likelihood that the computer will steal your build depends on whether it is a single or multiple build.

Single and Multiple Builds

Once you make a build, its cards always stay together. You can’t split a build apart, but you (or the computer) can add cards to make an even bigger build. In Figure 3, you can add the two from your hand and the three from the table to your build of 5 to make a larger build of 5. It is common to extend a build this way, even several times.

Figure 3, extending a build

Figure 3

Extending a Build

In Figure 3 you could also add the five from your hand and the three from the table to your build of 5 to make a new build of kings (13), expecting to capture it later with your king. It is rare to extend your own build to a larger value in this way, but not so rare to extend the computer’s build in an attempt to steal it. You know the computer has the capturing card for the original build, but it might not have the right card to capture it at the new value. When you extend the computer’s build in this way it becomes your build. The computer is allowed (as usual) to steal it if it can.

These are the two different ways to extend a build. In the first case (adding a two and three to the build), the build keeps its value. You just append another group or groups of cards that add to the build value. In the second case, you change the value of the build to a larger number, from 5 to king. This is a more radical change, and it is not always allowed. In particular, it is allowed only if the original build is a single build.

A single build is one that contains just one set of cards that adds to the build value. The build of 5 above, consisting of a four and an ace, is a single build. A single build acts just like a single card with the build value. It can be captured with a card of the build value, of course. But it can also be extended to a build with a larger value, as we just discussed. And it can be captured along with other cards, just as if it was a single card.

A multiple build is one that contains more than one set of cards that add to the build value. A multiple build is fixed in value: it can only be extended to a larger build of the same value, or captured by a card of the value.

Figure 4 shows the same situation as Figure 3, after extending to a larger build of 5.

Figure 4, multiple build

Figure 4

Multiple Build

In Figure 4, your build of 5 is now a multiple build, and is thus fixed at its value of 5. It’s now the computer’s turn, but the computer can’t try to steal it by extending it to a build with a larger value. The computer also can’t steal your build of 5 by capturing it along with other cards. It couldn’t capture the build of 5 and the nine on the table with its own ace, for example. The computer can only capture the build with a five if it has one in its hand.

Because of its inflexibility, a multiple build is harder to steal. So a multiple build is usually a safer play than a single build.


If you can’t (or don’t want to) capture or build, you can simply put one of your cards onto the table. This play is called a trail. The only limitation is that you can’t trail if you have a build on the table; you must capture the build first.

Last Capture Bonus

At the end of the game, any cards left on the table are awarded to the player that made the last capture. These extra cards can make the difference between winning and losing, so it’s a good idea to delay your last capture if you can.