MENACE the clever machine

The machine made of matchboxes that learns to play tic-tac-toe — with no electricity. (Donald Michie, 1961)

How MENACE works

Each matchbox matches one situation in the game. Inside, there are colored marbles: one color = one square where MENACE can play. On the board, each square wears its color (red = square 1, orange = square 2…).

To play, MENACE shakes the box and draws a marble without looking. The color says which square to play. The more marbles a color has, the more chances it has to come out.

Click “Draw a marble” to see the pick. The drawn square lights up.
Ready to shake the box.

MENACE's box

How MENACE learns

At the end of each game, we reopen only the boxes that were used and, in each one, we change the marble that was drawn (the color of the square that was played):

Win: +3 marbles of that color
Tie: +1
Loss: −1

One box after a game

The marble we change is green here (square 4): it's the color MENACE played in this box. We touch neither the other marbles in the box, nor the ~300 other boxes.

Repeated hundreds of times, this pushes each box toward its good moves: the bad colors drop to zero, the good ones pile up. That's what learning is!

Michie's original setting: at the start, 4 marbles per square at move 1, then 3, 2, 1 for the next moves. Lots of marbles = slow, careful learning (the frequent, subtle moves of the beginning); few marbles = fast learning (the rare, obvious moves of the end).

Your turn to play against MENACE

MENACE plays the and goes first. You play the .

The box MENACE is using

Memory — the 1st box (the very first move)
Total 36 marbles. It's the only box reused every game (so it's easy to follow). But the boxes for moves 2, 3, 4 change too — see below.
MENACE0
You0
Ties0

Fast training

Make MENACE play super fast against a random opponent, and watch it stop losing.

Games0
Doesn't lose
Loses
MENACE doesn't lose   MENACE loses
The brain is shared with the “Libraries” tab: train here, then go watch the boxes fill up!

MENACE's libraries

One library per move. There are more and more possible situations, so more and more boxes: 1 → 12 → 108 → 183 (304 in all). Click a library, open a box, draw/add/remove a marble, then play to go down to the next move.

This tab is linked to the “Play” brain

Library for Move 1

3 games in a row — the marbles change

Keep an eye on the “first box”: 36 → 39 → 38 → 39. (+3 win, +1 tie, −1 loss, on the color that was played.)

+3
+1
−1
The first box holds
36 marbles
9 squares × 4 marbles at the start
Game 1 / 3
Each square has the color of its marble.

Made to discover AI while having fun • Inspired by MENACE, Donald Michie (1961)

🎙️ Chat with the characters — in beta