Logic & Strategy›Xiangqi
V0.96 · CHINESE CHESS

Xiangqi Game

Play a full game of Chinese Chess against browser-local computer opponents. The engine enforces the 9×10 river board, 3×3 palaces, cannon screens, horse-leg blocks, elephant eyes, soldier river rules, flying-general safety and Xiangqi endings.

Complete piece movement3 AI levelsBrowser-local

A real Xiangqi rules engine, not Western chess with different icons

Xiangqi shares the idea of protecting a royal piece, but its movement rules are distinct enough that a reskinned chess board would be misleading. This specialist uses its own 10-rank, 9-file board model. Every candidate move is generated from the current Xiangqi piece rules and then rejected if it leaves that side’s general under attack. That final king-safety pass is also what prevents the two generals from being left facing each other on a clear file.

The palace changes how the general and advisors move

Each general stays inside its own 3×3 palace and normally moves one orthogonal point at a time. Advisors also stay inside the palace but move exactly one point diagonally. These restrictions mean king safety develops very differently from ordinary chess: the general cannot simply walk into the center, and a small number of palace intersections can become crowded or tactically overloaded.

The flying-general rule is enforced as legality, not decoration

If the red and black generals occupy the same file with no piece between them, the position is illegal because they attack each other directly. The engine therefore rejects any move that exposes that open file. It also recognizes the direct long-file capture when a general has an unobstructed line to the opposing general. This rule matters whenever a central blocker moves away.

Cannons move and capture in two different ways

A cannon travels through empty intersections like a chariot when it is not capturing. A capture requires exactly one occupied piece between the cannon and its target; that intervening piece is the screen. With zero screens the cannon cannot capture, and with two screens the line is blocked. The move generator scans each orthogonal direction separately so the first screen changes the interpretation of every square beyond it.

Horses can be blocked at the leg

The Xiangqi horse reaches the familiar long-and-short L-shaped destination, but it does not jump. Before a two-by-one move can occur, the adjacent orthogonal “leg” intersection must be empty. A single nearby blocker can therefore remove two horse destinations at once. Legal move highlighting comes from this exact rule instead of showing destinations that would later be rejected.

Elephants have an eye and cannot cross the river

An elephant moves two points diagonally. The midpoint, often called the elephant eye, must be empty. Red elephants also remain on the red side of the river, while black elephants remain on the black side. Because they cannot cross, elephants are defensive pieces and cannot chase an opposing general deep into the other half of the board.

Soldiers gain sideways movement only after crossing

Before crossing the river a soldier advances one point straight toward the opponent. After it reaches the far half, it may also move one point left or right. It never moves backward. The app computes river status from the soldier’s current row on every turn, so a soldier’s legal destinations expand at the correct moment rather than being tied to a remembered flag.

Chariots remain the cleanest long-range pieces

Chariots move any number of empty intersections horizontally or vertically and may capture the first enemy piece on the line. Their simple movement makes them powerful, but the board’s cannons and palace restrictions mean open-file tactics often require more care than a similar rook move in chess. The local evaluator therefore values chariot activity without changing the actual legal-move contract.

Stalemate is a loss in Xiangqi

When the side to move has no legal move, that side loses even if its general is not currently in check. The status function distinguishes checkmate from stalemate for explanation, but both produce a win for the opponent. For endless local practice loops, this browser version also declares a draw on an identical position appearing three times. That browser repeat rule is disclosed instead of being presented as federation tournament adjudication.

Easy, Standard and Hard never change the rules

All three local AI levels receive the same public board and same legal-move list. Easy adds more seeded variation among reasonable moves. Standard prefers material, activity, checks and advanced soldiers. Hard searches an extra reply layer while using the identical legality engine. The labels are product difficulty settings, not invented ratings or claims of professional strength.

Practice seeds keep the session reproducible

Practice receives a seed that is written into the URL. The seed determines seeded-random color assignment and breaks ties between equally evaluated computer moves. Your choices still create the actual game tree. Refresh and autosave return to the same session identity, while Fresh Practice intentionally creates another seed.

Hint, Undo and Restart remain visibly Assisted

Hint uses the strongest local evaluator to suggest one legal move. Undo restores the exact state from before your previous move, including the computer response that followed it. Restart rebuilds the same deterministic opening contract. Because those actions expose extra information or replay an earlier decision, they mark the game Assisted instead of pretending the result was unaided.

Daily Xiangqi stays separate from Today’s 6

The specialist Daily mode maps each date to a stable seed and player color, then stores its own browser-local history and streak. It does not insert Xiangqi into the frozen main Daily rotation and does not write a Xiangqi result into the Today’s 6 `days` state. That containment is part of cumulative release QA.

Private practice without fake ratings or wagering

Game state, autosave, local wins and Daily history stay in this browser. There is no account, remote Elo ladder or global percentile, and there is no wagering, chips, prizes, stakes or paid-random mechanic. The goal is transparent strategy practice: learn the palace, river and piece interactions through actual legal play.

PLAY NOW

Start with the Standard computer

Select a piece to reveal only legal destinations. The board, coach, move log and AI all use the same Xiangqi engine.

Open Xiangqi →