Xiangqi

Saved games stay in this browser only.

About the game

Xiangqi is Chinese chess, one of the most played board games in the world. Two armies of sixteen pieces face each other across a board of nine files and ten ranks, split by a river in the middle, and the aim is the same as in chess: trap the opposing general so that it cannot escape capture. The pieces sit on the points where the lines cross, not in the squares, and each side has a small palace of nine points that its general may not leave.

XiangQi Wizard Light, by Morning Yellow, is a small and strong xiangqi program written in JavaScript. It searches several moves ahead, uses an opening book for the first moves, and plays at three levels, from Beginner, which answers almost at once, to Professional, which thinks for about a second per move. You can let the computer move first, give the side that moves first a handicap (a knight, both knights or nine pieces), or switch the computer off and play a friend on the same screen.

Playing it here

Everything runs in your browser and nothing is sent anywhere; the game is not saved between visits. The page is in English. The pieces are drawn for this page and use letters instead of Chinese characters: K general, A advisor, E elephant, H horse, R chariot, C cannon and P soldier. Red, at the bottom, moves first. This version has no sound.

Controls

Input Action
Click or tap a piece, then a point move the piece
New game start again, with the choices on the right
Take back undo your last move and the reply
Computer level Beginner, Amateur or Professional
List of moves step back and forward through a finished game

The rules in short

The general (K) steps one point at a time, straight, inside its palace. The two generals may never face each other on an open file. The advisor (A) steps one point diagonally and also stays in the palace. The elephant (E) moves two points diagonally, cannot cross the river, and is blocked if the point in between is occupied. The horse (H) moves one point straight and then one diagonally outwards, and is blocked if the first point is occupied. The chariot (R) moves any distance in a straight line, like a rook. The cannon (C) moves like the chariot but captures by jumping over exactly one piece. The soldier (P) steps one point forward and, once it has crossed the river, one point sideways too. You win by checkmating the opposing general, or by leaving the opponent with no legal move.

Tips

Chariots and cannons matter most. Get them onto open files early; the chariot is the strongest piece and the cannon is deadly while many pieces are still on the board.

Watch the horse's leg. A horse blocked by a neighbouring piece cannot jump, which makes it easy to trap and easy to defend.

Do not rush the soldiers. They are weak until they cross the river, and a lost soldier is hard to replace.

FAQ

Which side am I? Red, at the bottom, moves first. If you let the computer move first, you play Black and the board turns around.

Can I play against a friend? Yes: choose Two players (no computer) under Who moves first, then take turns on the same screen.

Why letters and not the traditional characters? The pieces here are new drawings made for this page, in the Western style with letters; the program itself does not depend on how they look.