Enter the maze

How do computers get to be so smart?

Computers do some miraculous things. A computer can beat the World Champion at Chess, even fly a plane more skillfully than a human ... How do they do it? How can a lump of silicon and wire appear to be smarter than a human...? Everything clever a computer does is ultimately down to a person - a computer scientist in fact - writing clever instructions: rules to be followed. Every thing you have ever seen a computer do, was just it obeying the rules written by a computer programmer probably years earlier. Even a piece of paper can play games as well as humans if it contains such rules. In fact...

noughts and crosses

With the instructions on this web page, even your kid brother can play better Noughts and Crosses than you can!

You will struggle to beat the instructions at any rate. Try. When it is your kid brother's turn to move just follow the instruction it tells you below. Then you make whatever move you want to make. It gets to go first and is X.

  • Move 1: Go in a corner.
  • Move 2: If the other player did not go there then go in the opposite corner to move 1. Otherwise go in a free corner.
  • Move 3: If there are two Xs and a space in a line (in any order) then go in that space. Otherwise if there are two Os and a space in a line then go in that space. Otherwise go in a free corner.
  • Move 4: If there are two Xs and a space in a line (in any order) then go in that space. Otherwise if there are two Os and a space in a line then go in that space. Otherwise go in a free corner.
  • Move 5: Go in the free space.

That is all a computer program is - a list of instructions that the computer follows. The instructions have to be written very precisely in special languages so that the computer can follow them without understanding them, but the idea is the same.

Computers can only do the things the programmer thought of - if things aren't as expected it won't seem so clever. I wrote the above rules expecting the paper to go first...what if it has to play second? Does it still seem so clever? That is the skill of the programmer: writing rules for every eventuality. Have a go at writing some better instructions for player 2 at Noughts and Crosses.