Tag Archives: Math

A Card Game to Teach Kids Computer Science and Math

Last week I was thinking (procrastinating, really) about how kids in other countries start learning computer science and programming as early as six. Scratch is great, but my kid is still too young. I’m also trying to keep her away from screens for a few more years. What I wanted was a basic card game like Memory that instead teaches basic boolean and set logic. I couldn’t find one, so I took a first pass at creating one. The goal: something easy and engaging enough for toddlers but with enough incremental complexity to entertain ages 7-10.


  • 1 standard card deck
  • Index cards or a blank deck for the operations cards
  • One standard die for the toddler version
  • (A second standard deck is needed for set logic expansion)

I found it helpful to have different colored decks for the game play cards and the operation cards.

Game Summary (Ages 3+)

The game is really quite simple. Using Ace – 10 in the standard deck, shuffle and deal cards face down into four equal piles. Ace is 1, all other cards are face value. Turn the top card up on each pile. The first pile is the “test card” pile, and it sits above the other piles. The last three piles sit in a row below the test condition and they’re the game play array.

Test card pile, game play card array, and discard pile.

Test card pile, game play card array, and discard pile.

Players take turns playing an “operation” with the test card and creating a test condition. The basic operations are > (greater than), < (less than), and equal (==).  If the test card is 6 and the game play pile is 2, 3, and 8, playing < (less than) would mean “less than 6” and the player picks up 2 and 3.

Game 1 Variation. Play until all three game play piles are gone. Whoever picked up the most cards wins.

Game 2 Variation (more strategy): Players display the cards they pick up in a sequence Ace to 10. The first player to pick up all cards in the sequence A-10 (any combination of suits) wins. Multiples of any single card don’t count except to the extent they prevent your opponent from completing the sequence.

Either version can be played solitaire or with two or more players.


Ages 3-5 roll a die to choose their operation. I’ve used a die with two sides each for >, < and == and use the labels “BIG”, “small”, and equal or “same”.


10 clubs is our test. Our play cards are 3, 8, 10. Shhh… your kid is looping over an array.

After graduating from the die roll, all players are dealt three operation cards at the beginning of the game.  Players draw new operation cards at the end of their turn to replenish their hand to three.

I again start with the three simple operation cards for >, <, and ==. The added complexity here is that kids must choose which is the optimal play. (You can start your kids by playing operation cards face up and talk them through their decisions. After that, players keep their operation cards secret from other players.)

Once kids get comfortable with those three operations, I allow them to use == in tandem with > or <. If two cards are played, the player draws two more cards at the end of a turn.

There’s two more basic operation cards to work in as player skill increases:

  • ! (not) is used in tandem with any other operation card and creates the opposite condition. Not > equates to <=, for example. It’s most powerful when combined with == to make != (not equal) to the test card value.
  • * (wildcard) can become any single basic operation card. I’ll need * for multiplication so I should think of something else…
Player on the right should play > and == operation cards in tandem to pick up all three play cards.

6 of spades is our test. Player on the right should play < and == operation cards in tandem to pick up all three play cards.

Here’s the quantity of operation cards I’ve tried in my deck:

  • > (x7) greater than
  • < (x7) less than
  • == (x2) used alone or in tandem with >, <, !
  • ! (x4) not. must be used in tandem with >,<, == or set expansion cards
  • * (x1) wildcard. Can be any single basic operator: !, <, >, ==.

Right now I’m only allowing two operation cards to be played at a time.


Set Expansion Pack

This introduces basic set logic for added complexity. With the blank deck I created cards for set A, B, C, D, E. You’ll also need another standard deck with cards A – 10 in a single suit to populate our random sets.


You can introduce from one to five sets into the game during the initial deal. For each set A-E, add those cards to the operation cards and shuffle. Next, create a line of expansion sets that sit above the test card pile. From the standard deck A-10 cards, deal out two cards at random for each expansion set.

A set contains the two random cards it was dealt at the beginning of the game plus the value of the  test card at the time at which the set card is played. In this case, the set contains 5 and 10 (initial values) plus the test card 9. If set B is played now, the player can pick up any game play cards that are in the set (5, 9, 10). Sets cards can also be played with ! (not) and any game play cards not in the set are picked up. If the test card is already contained in the set — too bad. Sets contain only distinct values.


I’m thinking in the future that addition/subtraction(+/-), multiplication, and modulus division cards ( % 2) could be used to change the value of either the test or the gameplay cards.

Game Play

If the first player can successfully play an operation, they make their play and pick up whatever game play cards they earn. If they’ve picked up game play cards, the test card is turned down into the discard pile. A new test card is turned up and new game play cards are turned up wherever cards were picked up. Play proceeds to the left. Anytime a player can’t make a play, it skips to the next player and the test card is not discarded. (An option I’m playing with here: if you can’t make a play, you may discard one operations card face down and draw a new one.) Players discard operation cards after playing them and replenish their hand to three cards at the end of their turn.

When the test pile or operation piles deplete, shuffle the discard pile for either and start fresh.

Anyway, that’s my first draft, it’s still rough. The easiest iteration is definitely simple enough for a four year old, I’m more concerned that it’s not fun enough for… well, anyone. I welcome contributions. One caveat: if we’re doing this in the open, it’s open. Let’s say Creative Commons (or would that be GPL?) so don’t go calling Hasbro if we think of something clever.