Skip to content
UniKit

Chinese chess (Xiangqi)

Play xiangqi on a real 9x10 board with the true rules for all seven piece types (horse legs, elephant eyes, cannon screens, pawns crossing the river and the flying-general rule): click your piece, then a highlighted target square. Your opponent is either the computer (fixed evaluation plus a mate-in-one check, fully reproducible per seed) or a second human; checks, checkmates and stalemates are all computed by the real rules.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Xiangqi board

Click one of your pieces, then a highlighted target square; click the board once to use the keyboard.

Move 0 · Red to move · New game: Red moves first, the two generals may never face each other
Red pieces
16
Black pieces
16
Captures
0
Checks
0
Legal moves
44
Winner
-

Arrow keys / W A S D move the cursor, Enter selects and moves

Move log

0 move(s) in total

No move recorded yet

What this tool does

  • Play a game of xiangqi: you take Red and the computer plays Black, click your piece and then a highlighted square.
  • Play a friend: switch to two-player mode and alternate on the same board, with checks and checkmates decided by the rules.
  • Check whether a move is legal: illegal squares are never highlighted, and clicking one only shows a notice instead of moving the board.

Example

Input

Opponent = computer plays Black (seed demo); Red clicks “Cannon h2” then “e2”

Output

Move 1 · You 红炮 h2→e2 (notation)
Move 2 · The computer 黑炮 b7→e7 (its top-scoring move)
Status: Move 2 · Red to move

Notation uses ICCS coordinates (columns a-i, rows 0-9, with a0 at Red’s lower-left corner); the computer move depends only on the position and the seed.

Frequently asked questions

How do I move?

Click one of your pieces (the board highlights every legal target), then click a target square; or move the cursor with the arrow keys / W A S D and press Enter to select and again to move. Clicking an empty square or an enemy piece only reselects or does nothing — an illegal move can never be played.

How strong is the computer? Does it search?

It does not search: it enumerates all of its legal moves, scores them with a fixed evaluation (captured piece value × 4 + material balance + 3 × mobility difference) and also scans for an immediate checkmate or general capture, playing the mate at once; ties are resolved by a seed-shuffled order. So it never misses a mate, but it does not calculate deep lines.

How is the result decided? Is stalemate a loss?

If the opponent is in check and has no legal move that is checkmate; if the opponent is not in check and has no legal move that is stalemate (no legal move at all) — in xiangqi both are a win for the other side. Moves that expose the general or create a flying general are filtered out, so they cannot be played.

Can I review or set up a position?

Yes. The move log lists every move in notation (captures and checks included), “Undo move” returns to the previous position (in the computer mode it also takes back the computer reply) and “Restart this game” replays the same seed.

Keywords:xiangqi

Related tools