← Pocket Change home

Play chess against the computer

Play the computer on Easy, Medium or Hard, or play a friend on the same phone or computer. New to chess? There's a How to play guide, hints, and an Undo button for second thoughts.

What's really happening? (for the curious)

How the computer plays. The computer player is a small chess program built into this page. It isn't an AI chatbot: it uses the classic method chess programs have used since the 1950s. It tries each move it could make, then each reply you could make, then its answer to that, and so on. This is called looking ahead or searching. It gives each position a score by counting the pieces (pawn 1, knight 3, bishop 3, rook 5, queen 9) and how well placed they are, then picks the move that leaves it best off, assuming you'll play your best too.

The levels. On Easy it only looks at its own next move, and adds a bit of chance, so it makes mistakes a beginner can catch. On Medium it looks three moves ahead (counting each player's move separately) and follows any swaps of pieces to the end. On Hard it looks up to five moves ahead and thinks for up to about 2½ seconds. The 💡 Hint button asks the Hard level what it would do in your place.

The move list. Moves are written in the usual short way, called chess notation. Each square has a name: a letter for the column (a to h) and a number for the row (1 to 8), shown along the edges of the board. e4 means a pawn moved to e4. The other pieces have a capital letter: N knight, B bishop, R rook, Q queen, K king, so Nf3 means a knight moved to f3. An x means a capture, + means check, # means checkmate, O-O is castling on the king's side and O-O-O on the queen's side.

Remembering your game. The page saves the moves of your game in your browser's local storage, a small space each website gets on your own device. That's how a game is still there when you come back. It never leaves your device, and pressing New game replaces it. Clearing your browsing history removes it. There are no cookies.

All of this happens inside your web browser (the program you're using to view this page, such as Chrome, Edge or Safari). Once the page has loaded, the game even works without the internet.