What you’ll do
Computers can learn to play games they’ve never been taught a strategy for. In this game, one of you plays the monkeys and the other is a computer made of paper that plays the crocodiles. At first the computer picks its moves completely at random. After every game it changes a few tokens, and slowly it learns which moves win and which ones lose.
The game
The board is three squares by three. Each side has three pieces, and every piece moves like a pawn in chess:
- It moves one square straight forward into an empty square.
- It captures one square diagonally forward. It can’t capture straight ahead.
You win if one of your pieces reaches the far row, if you capture every enemy piece, or if it’s the other side’s turn and they can’t move.
How it works
- Set up. The crocodile player lays out the move cards. Each card shows a board and every move the crocodiles could make, as coloured arrows. Put one matching token on each card for each arrow.
- Monkeys move. The monkeys always go first and can make any legal move.
- Crocodiles move. Find the card that matches the board. Close your eyes, pick a token from it, and make the move with the arrow of the same colour. Leave the token on the card’s board picture.
- Learn. When the game ends, the computer changes its tokens:
- If the crocodiles lost, take away the token from their last move.
- If the crocodiles won, add an extra token of that colour to their last move.
- If a card has no tokens left, the crocodiles give up. Take away the token from the move before.
- Play again. Put the tokens back on their cards and play another game. Keep a learning log of who wins.
Monkeys: try to win every game. The better you play, the faster the crocodile learns.
Afterward
- Look at your learning log. When did the crocodiles start winning?
- Nobody told the computer a strategy. How did it get better?
- Some cards ended up with only one or two tokens. What do those tokens say about the moves?
- The computer only changed its last move after each game. Was that move always the one to blame?
- What would happen if the computer played a new monkey player who uses different moves?
This activity is adapted from Beat the Crocodile by Annabel Lindner and Stefan Seegerer, part of AI Unplugged.