The tablebase answers every position

Best play for both sides, move by move.

Under the board, the tablebase lists every legal move in the position shown, whether it wins, draws or loses for the side to move (named at the top of the table), and in how many moves. The shaded row is the move the line plays. Hover any row to see its move on the board, or click it to play it and keep going from there. Your moves appear in the move list as a branch under the move you left from, and clicking any of the game’s moves takes you back.

Red wins by running black out of spare moves

Pieces in banqi move one step along a rank or file, and a piece takes one of equal or lower rank, so two chariots can take each other. Count the steps between them. Every chariot move changes the count by one, and a capture needs a count of one. If it is your move and the count is odd, it is even on every turn your opponent gets, so they can never take you and you can walk toward them. The tablebase agrees for all 992 ways to place two chariots alone.

FOUR STEPS APART: BLACK LOSES
THREE STEPS APART: BLACK WINS

Black to move in both. Black loses four steps apart (c2 to f3) and wins three steps apart (c2 to e3).

A move by any other piece leaves the count alone and hands the turn over, so it flips who has the odd count. Red has two of these spare moves to black’s one, so red can always answer black’s with one of its own. Red’s plan is to trade horses, which leaves black with no spare move and red with its soldier. Setting up the trade is what takes so long: black’s chariot takes red’s horse on move 44, and red’s chariot takes black’s horse on move 45.

Banqi on Mistboard now draws at 60 moves

With best play nothing is captured for 43 moves, so the old 40-move rule drew a game that red wins. A rule set used for computer banqi programs in Taiwan (PDF) allows 60, enough for red to play the whole win out. That is our rule now: a new banqi game draws after 60 moves without a capture or a flip, and a game already under way when the rule changed keeps 40. The rule was turning won games into draws, and in this ending it no longer does.

Play BanqiOpen the studyBanqi rules