About Chess - History, Rules and How the Computer Plays

Chess is one of the oldest and most played board games in the world. Two players each command an army of sixteen pieces, and the first to trap the other king wins. This page tells where the game came from, sums up the rules and explains how the computer on PictorX picks its moves.

A wooden chessboard with the pieces in play
A wooden chessboard with the pieces in play

A short history

Chess began in India around the sixth century as chaturanga, travelled to Persia as shatranj and reached Europe through the Arab world around the year 1000. In the late fifteenth century the queen and bishop gained their long moves, and the game became the fast modern chess played today. The first official world champion, Wilhelm Steinitz, was crowned in 1886.

The board and the pieces

The board has 64 squares in eight rows and eight columns, with a light square in the right-hand corner for each player. Each side starts with a king, a queen, two rooks, two bishops, two knights and eight pawns. White always moves first.

How the pieces move

The king moves one square in any direction. The queen moves any distance along a row, column or diagonal, the rook along rows and columns, and the bishop along diagonals. The knight jumps two squares one way and one to the side, and is the only piece that can jump over others. A pawn moves one square forward, or two from its starting square, and captures one square diagonally forward.

Check, checkmate and draws

A king that is attacked is in check, and the player must get it out of check at once. If that is impossible, it is checkmate and the game is over. If the player to move has no legal move but is not in check, it is stalemate, a draw. The game is also drawn by threefold repetition, by the fifty-move rule and when neither side can possibly mate.

How the computer plays

On Easy and Medium the computer uses minimax search with alpha-beta pruning to a fixed depth: one move on Easy and two on Medium. On Hard and Expert it starts from a small opening book and then thinks for a set time, up to a second on Hard and two and a half on Expert, searching one move deeper each round. A transposition table remembers positions it has already scored, a quiescence search plays out captures so that it never stops in the middle of an exchange, and the most promising moves are tried first so that alpha-beta pruning can skip more. Moves that are unlikely to matter are searched less deeply or skipped, so it sees much further in the same time. It scores positions by material and by piece-square tables that shift from the middlegame to the endgame, and it rewards active pieces, pressure on the enemy king, the bishop pair, passed pawns and a wall of pawns in front of the king.

Frequently asked questions

Who invented chess?

No single person. Chess grew out of the Indian game chaturanga around the sixth century and changed over the centuries; the modern rules settled in Europe around 1500.

What is the best first move?

There is no single best move. 1.e4 and 1.d4 are the most popular, because they put a pawn in the centre and free the queen and a bishop.

Is chess solved?

No. Chess has far too many positions to search completely. It is solved only for endgames with up to seven pieces, which are stored in tablebases.

Why does the computer sometimes make odd moves?

On Easy and Medium it looks only one or two moves ahead, so it misses longer plans and traps, which keeps it beatable. Hard and Expert look much deeper, but they think for only a second or two and judge positions by simple rules, so now and then they still choose a move a strong player would not.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Play chess