Strategy guides › Chess
How to beat our chess bot at every level, from Beginner to Strong
Three moves in, the Beginner bot’s knight has just grabbed a second pawn, on f2, and is attacking your rook. It looks like a disaster. It is checkmate, for you, on the next move: queen takes f7. The bot never looked at your reply. At its level, it can’t.
Our chess opponent is the open-source js-chess-engine, run in your browser at one of four strengths. We read its search settings, then played it in Node.js, level by level, against the engine’s own top level, and had that top level grade every move the bot made. Each of the four levels has a different blind spot, and you can aim at each one.
What each level can see
The engine searches a tree of moves and stops at a fixed depth, counted in plies (one move by one side). Our four levels are the engine’s levels 1 to 4, and its documentation lists their limits. Beginner looks exactly one ply ahead: its own move, and nothing after. Casual looks two plies, so it sees your reply, plus one more ply when a move gives check. Club adds a ply in simplified positions and a short look at captures at the end of each line. Strong searches three plies, up to five in simplified positions, with a deeper look at captures.
To see what that means in practice, we played 12 games per level, with the bot as Black against the engine’s level 5. We forced White’s first two moves from 12 different opening pairs so that the games differed, and had level 5 score every position before and after each bot move. A move that threw away 2.5 pawns’ worth or more by that score counts as a blunder below.
| Level | Games lost (of 12) | Average length | Blunders per game | First blunder, typical |
|---|---|---|---|---|
| Beginner | 12 | 17 moves | 3.4 | move 6 |
| Casual | 11 | 28 moves | 1.9 | move 11 |
| Club | 11 | 32 moves | 2.0 | move 23 |
| Strong | 4 | 43+ moves | 0.6 | rare |
Games that reached 90 plies were stopped, so the Strong row is a floor: eight of its games were still going. Level 5 is only one step stronger than Strong, so it catches fewer of Strong’s mistakes, but the difference between the levels is plain.
Beginner: bait and f7
A one-ply search grabs whatever looks good right now and has no idea what you will do next. In our games, 32 of Beginner’s 41 blunders were answered by a capture: it left a piece hanging, or took a pawn and lost a piece for it. One game went 1.d4 Nf6 2.e3 Nc6 3.d5 Nxd5 4.Qxd5, a knight for a pawn, and after 4…e5 5.Bc4 Bc5 6.Qxf7 it was mate in six.
Its other blind spot is f7, the square next to its king that only the king defends. Aim a bishop and the queen at it and Beginner will usually look the other way. We tried the Scholar’s mate idea after six different first replies to 1.e4. It worked after 1…Nf6, 1…e5 and 1…c5 with Bc4 and Qh5, and after 1…Nc6 with Bc4 and Qf3; only 1…d5 and 1…e6 stopped it. The bot’s first move is chosen at random from a few equally good ones, so if it does not bite, play on and try again next game.
The diagram is worth learning as a pattern, not just as a trick. The king (red square) is in check from a queen right next to it, so it can only escape by taking her, and she is protected. Every other square it could step to is blocked by its own pieces. Whenever a king sits at home with its own pieces still around it, a protected queen on the square beside it is often mate. Just check that nothing else can take her.
Casual and Club: two-move ideas
Casual sees your reply, so it stops leaving pieces where you can simply take them: only 9 of its 23 blunders were answered by a capture. What it cannot see is the move after your reply. That is where forks live. In one of our games it played 9…c6 and allowed Nc7, a knight landing on a square that attacks its king and rook at once. Look for a move that makes two threats; Casual will happily walk into it.
Club adds just enough to survive the opening. Its first blunder came around move 23 in a typical game, twice as late as Casual’s. After that it fails the same way, against threats two or three moves deep: a rook move that leaves its queen where a knight can take her, or a rook wandering off so that a check on its back rank wins material. Against Club, develop quietly, keep your king safe and wait for the middlegame, where the tactics get too deep for it.
Strong: keep the pieces on
Strong is a real opponent, but its search has a feature you can use. The engine adds depth in “simplified” positions, the endgames and positions with few legal moves, and searches shallowest when the board is full. So against Strong, avoid trading down into an endgame unless you are clearly winning it. Keep pieces on the board, keep the position complicated, and take your chances in the middlegame.
Strong also has a weakness that is not about chess. Apart from its very first move, which it picks at random from a few near-equal ones, the engine is deterministic: the same position always gets the same reply, at every level. We checked this by asking each level for its move in the same position five times; every answer matched. So if you beat Strong once, write the game down. When it opens the same way next time, the same moves will win it again.
Opening principles that hold up
Against Club and Strong, the classic opening principles are your best friend. Put a pawn or two in the centre (e4, d4), bring out the knights and bishops before the queen, castle early, and do not move the same piece twice without a reason. They will not win the game by themselves. They make sure you reach the middlegame, where these bots go wrong, with nothing hanging. Against Beginner you can break every one of them, as the diagram shows, but it is a bad habit to keep.
Playing it yourself
There is no seed for chess, because the bots are the puzzle. Start on Beginner and mate it on f7, then move up a level each time you win twice in a row. On every move, ask what the bot’s level could not have seen: your reply, for Beginner; your second move, for Casual and Club; the endgame you are avoiding, for Strong. Play the move it cannot see.