# Xiangqi

Xiangqi (/ˈʃɑːŋtʃi/; Chinese: 象棋; pinyin: xiàngqí), commonly known as Chinese chess or elephant chess, is a strategy board game for two players. It is the most popular board game in China. Xiangqi is in the same family of games as shogi, janggi, Western chess, chaturanga, and Indian chess. Besides China and areas with significant ethnic Chinese communities, this game is also a popular pastime in Vietnam, where it is known as cờ tướng, literally 'General's chess', in contrast with Western chess or cờ vua, literally 'King's chess'.
The game represents a battle between two armies, with the primary object being to checkmate the enemy's general (king). Distinctive features of xiangqi include the cannon (pao), which must jump to capture; a rule prohibiting the generals from facing each other directly; areas on the board called the river and palace, which restrict the movement of some pieces but enhance that of others; and the placement of the pieces on the intersections of the board lines, rather than within the squares.

## Board

Xiangqi is played on a board nine lines wide and ten lines long. As in the game Go (围棋; or Wéi qí 圍棋), the pieces are placed on the intersections, which are known as points. The vertical lines are known as files (Chinese: 路; pinyin: lù; lit. 'road'), and the horizontal lines are known as ranks (Chinese: 線/綫; pinyin: xiàn; lit. 'line').
Centred at the first to third and eighth to tenth ranks of the board are two zones, each three points by three points, demarcated by two diagonal lines connecting opposite corners and intersecting at the centre point. Each of these areas is known as 宮 gōng, a palace.
Dividing the two opposing sides, between the fifth and sixth ranks, is 河 hé, the "river". The river is usually marked with the phrases 楚河 chǔ hé, meaning "River of the Chu", and 漢界 hàn jiè, meaning "Border of the Han", a reference to the Chu–Han War. Although the river (or Hanchu boundary) provides a visual division between the two sides, only two pieces are affected by its presence: soldiers have an enhanced move after crossing the river, and elephants cannot cross it. The starting points of the soldiers and cannons are usually, but not always, marked with small crosses.

## Rules

The pieces start in the position shown in the diagram above. Which player moves first has varied throughout history and from one part of China to another. Different xiangqi books advise either that the black or red side moves first. Some books refer to the two sides as north and south; which direction corresponds to which colour also varies from source to source. Generally, Red moves first in most modern tournaments.
Each player in turn moves one piece from the point it occupies, to another point. Pieces are generally not permitted to move through points occupied by other pieces, the exception being the cannon’s capturing move. A piece can be moved onto a point occupied by an enemy piece, in which case the enemy piece is captured and removed from the board. A player cannot capture one of their own pieces. Pieces are never promoted (converted into other pieces), although the soldier gains the ability to move sideways after it crosses the river. Almost all pieces capture using their normal moves, while the cannon has a special capture move described below.
The game ends when one player checkmates the other's general. When the general is in danger of being captured by the enemy player on their next move, the enemy player has "delivered a check" (照將/將軍, abbreviated as 將 jiāng), and the general is "in check". A check should be announced. If the general's player can make no move to prevent the general's capture, the situation is called "checkmate" (將死). Unlike in chess, in which stalemate is a draw, in xiangqi, it is a loss for the stalemated player.
In xiangqi, a player—often with a material or positional disadvantage—may attempt to check or chase pieces in a way such that the moves fall in a cycle, preventing the opponent from winning. While this is accepted in Western chess, in xiangqi, the following special rules are used to make it harder to draw the game by endless checking or chasing, regardless of whether the positions of the pieces are repeated or not:
* Perpetual checks with one piece or several pieces are not allowed; doing so results in a loss.
* Perpetual chases of any one unprotected piece with one or more pieces, excluding generals and soldiers, are similarly prohibited.
* If one side perpetually checks and the other side perpetually chases, the checking side has to stop or be ruled to have lost.
* When neither side violates the rules and both persist in not making an alternate move, the game can be ruled as a draw.
* When both sides violate the same rule at the same time (note that unlike in western chess, a mutual perpetual check is possible) and both persist in not making an alternate move, the game can be ruled as a draw.
* Mutual perpetual check
* A mutual perpetual check occurs with (see #Notation below for notation) 1.Hd7+ Hf4+ 2.Ae2+ Hh3+ 3.Af3+ Hf4+ 4.Ae2+ etc.
Different sets of rules set different limits on what is considered perpetual. For example, club xiangqi rules allow a player to check or chase six consecutive times using one piece, twelve times using two pieces, and eighteen times using three pieces before considering the action perpetual.
The above rules to prevent perpetual checking and chasing, while popular, are not the only ones; there are numerous end game situations.

### Pieces

Each player controls an army of 16 pieces; the armies are usually coloured red and black. Pieces are flat circular disks labelled or engraved with a Chinese character identifying the piece type, and in a colour indicating which player has ownership. The black pieces are marked with somewhat different characters from the corresponding red pieces.
Even in mainland China, most sets still use traditional Chinese characters (as opposed to simplified Chinese characters). Modern pieces are usually plastic, though some sets are wooden, and more expensive sets may use jade. In more ancient times, many sets were simple unpainted woodcarvings; thus, to distinguish between pieces of the two sides, most corresponding pieces used characters that were similar but varied slightly. This practice may have originated in situations where there was only one material available to make the pieces from and no colouring material available to distinguish the opposing armies. The oldest xiangqi piece found to date is a 俥 (chariot) piece. It is kept in the Three Gorges Museum.

#### General

Generals (or kings) are labelled 將 (trad.) / 将 (simp.) jiàng ("general") on the black side and 帥 (trad.) / 帅 (simp.) shuài ("marshal") on the red side.
The general starts the game at the midpoint of the back edge, within the palace. The general may move and capture one point orthogonally and may not leave the palace, with the following exception.
If the two generals face each other along the same file with no intervening pieces, the 飛將 ("flying general") move may be executed, in which the general to move crosses the board to capture the enemy general. In practice, this rule means that creating this situation in the first place means moving into check, and is therefore not allowed.
The Indian name king for this piece was changed to general because of Chinese naming taboos; China's rulers objected to their royal titles being given to game pieces. Despite this, the general is sometimes called the "king" by English-speaking players, due to their similar functions as royal pieces.

#### Advisor

Advisors (also known as guards and less commonly as assistants, mandarins, ministers or warriors) are labelled 士 shì ("scholar", "gentleman", "officer", "guardian") for Black and 仕 shì ("scholar", "official", "guardian") for Red. Rarely, sets use the character 士 for both colours.
The advisors start on either side of the general. They move and capture one point diagonally and may not leave the palace, which confines them to five points on the board. The advisor is probably derived from the mantri in chaturanga, like the queen in Western chess.
There is some controversy about whether "士" really is intended to mean "scholar", "gentleman" which would be "士人", or "guard", "guardian" which would be "衛士" (simplified Chinese: 卫士). One argument for the latter is that their functionality seems to be to guard/protect the general. The common Western translation "advisor" does not reflect this layer of meaning.

#### Elephant

Elephants (or bishops) are labeled 象 xiàng ("elephant") for Black and 相 xiàng ("minister") for Red. They are located next to the advisors. These pieces move and capture exactly two points diagonally and may not jump over intervening pieces; the move is described as being like the character 田 Tián ("field"), in reference to the board's squares. Blocking an elephant with a diagonally adjacent piece is known as "blocking the elephant's eye" (塞象眼).
Elephants may not cross the river to attack the enemy general, and serve as defensive pieces. Because an elephant's movement is restricted to just seven board positions, it can be easily trapped or threatened. The two elephants are often used to defend each other.
The Chinese characters for "minister" and "elephant" are homophones in Mandarin (Listen) and both have alternative meanings as "appearance" or "image". However, in English, both are referred to as elephants, and less commonly as "bishops", due to their similar movements.

#### Horse

Horses (or knights) are labelled 馬 mǎ for Black and 傌 mǎ for Red in sets marked with Traditional Chinese characters and 马 mǎ for both Black and Red in sets marked with Simplified Chinese characters. Some sets use 馬 for both colours. Horses begin the game next to the elephants, on their outside flanks. A horse moves and captures one point orthogonally and then one point diagonally away from its former position, a move which is traditionally described as being like the character 日 Rì. The horse does not jump as the knight does in Western chess, and can be blocked by a piece of either colour located one point horizontally or vertically adjacent to it. Blocking a horse is called "hobbling the horse's leg" (蹩馬腿). The diagram on the right illustrates the horse's movement.
Since horses can be blocked, and the path of a horse from one point to another is not the same as the reverse move, it is possible for one player's horse to have an asymmetric attack advantage if an opponent's horse is blocked, as seen in the diagram on the right.
The horse is sometimes called the "knight" by English-speaking players, due to their similar movements.

#### Chariot

Chariots (or rooks or cars) are labelled 車 jū for Black and 俥 jū for Red in sets marked with Traditional Chinese characters and 车 for both Black and Red in sets marked with Simplified Chinese characters. Some traditional sets use 車 for both colours. In the context of xiangqi, all of these characters are pronounced as jū (instead of the common pronunciation chē). The chariot moves and captures any distance orthogonally, but may not jump over intervening pieces. The chariots begin the game on the points at the corners of the board. The chariot is often considered to be the strongest piece in the game due to its freedom of movement and lack of restrictions.
The chariot is sometimes called the "rook" by English-speaking players, since it moves identically to the rook in Western chess. Chinese players (and others) often call this piece a car, since that is one modern meaning of the character 車.

#### Cannon

Cannons are labelled 砲 pào ("catapult") for Black and 炮 pào ("cannon") for Red. The names are homophones, though sometimes 炮 is used for both Red and Black. The 石 shí radical of 砲 means "stone", and the 火 huǒ radical of 炮 means "fire". Both colours' pieces are normally referred to as cannons in English. The black piece is sometimes labelled 包 bāo.
Each player has two cannons, which start on the row behind the soldiers, two points in front of the horses. Cannons move like chariots, any distance orthogonally without jumping, but can only capture by jumping a single piece of either colour along the path of attack. The piece over which the cannon jumps is called the 炮臺 (trad.) / 炮台 (simp.) pào tái ("cannon platform" or "screen"). Any number of unoccupied spaces, including none, may exist between the cannon, screen, and the piece to be captured. Cannons can be exchanged for horses immediately from their starting positions.

#### Soldier

Soldiers (or pawns) are labelled 卒 zú ("pawn" or "private") for Black and 兵 bīng ("soldier") for Red. Each side starts with five soldiers. Soldiers begin the game located on every other point one row back from the edge of the river. They move and capture by advancing one point. Once they have crossed the river, they may also move and capture one point horizontally. Soldiers cannot move backward, and therefore cannot retreat; after advancing to the last rank of the board, however, a soldier may still move sideways at the enemy's edge. The soldier is sometimes called the "pawn" by English-speaking players, due to the pieces' similar movements.

## Approximate relative values of the pieces

| Piece | Points |
| Soldier before crossing the river | 1 |
| Soldier after crossing the river | 2 |
| Advisor | 2 |
| Elephant | 2 |
| Horse | 4 |
| Cannon | 4½ |
| Chariot | 9 |
These approximate values do not take into account the position of the piece in question (except the soldier in a general sense), the positions of other pieces on the board, or the number of pieces remaining. In what follows, “minor piece” will refer to horses and cannons, and "defensive piece", unless otherwise specified, will refer to the non-royal pieces that cannot cross the river, namely advisors and elephants.
Other common rules of assessment:
* A horse plus a cannon is generally better than two horses or two cannons.
* The chariot is not only the strongest piece, but it is also generally stronger than any combination of two minor pieces. When the relative values of both sides' pieces are approximately even, the side with more chariots generally has the advantage, especially when one side has a chariot and one side does not (Chinese: 有車壓無車). However, the chariot is not particularly strong in basic endgames: for example, chariot versus four defensive pieces is generally a draw, while if the offensive side instead has two horses or even three unadvanced soldiers it is a win.
* In the earlier stages, the cannon is stronger than the horse, because platforms are plentiful and the horse is often blocked by the multitude of pieces on the board. In the endgame, the horse is stronger as an attacking piece, not needing any platforms, but the cannon generally has better defensive abilities.
* The values of soldiers vary in different stages of the game. In the opening and the middlegame, the initiative and mobility of pieces often require sacrificing soldiers. In these stages, soldiers closer to the middle file are generally more valuable, since they can effectively join the offence. With few attacking pieces on the board, soldiers have more power and can cross the river more easily. In this stage, advanced soldiers are generally less powerful, since soldiers cannot move backward. In basic endgames, three soldiers starting on the seventh rank are approximately equal to a chariot: they can force a win against four defensive pieces or a horse/cannon plus two elephants, while instead a chariot cannot, and a chariot cannot force a win against three soldiers on the seventh rank when well-defended. At the other extreme, even five soldiers all on the tenth rank cannot on their own force checkmate or stalemate on a bare general due to insufficient material.

## Notation

There are several types of notation used to record xiangqi games. In each case the moves are numbered and written with the same general pattern.
* (first move) (first response)
* (second move) (second response)
It is clearer but not required to write each move pair on a separate line.

### System 1

The book The Chess of China describes a move notation method in which the ranks of the board are numbered 1 to 10 from closest to farthest away, followed by a digit 1 to 9 for files from right to left. Both values are relative to the moving player. Moves are then indicated as follows:
[piece name] ([former rank][former file])-[new rank][new file]
Thus, the most common opening in the game would be written as:
* 炮 (32)–35 馬 (18)–37

### System 2

| Name | Abbr. |
| Advisor | A |
| Cannon | C |
| Chariot | R* |
| Elephant | E |
| General | G |
| Horse | H |
| Soldier | S |
| $^{*usingCwouldconflictwiththeletterforCannon}$ |||
A notation system partially described in A Manual of Chinese Chess and used by several computer software implementations describes moves in relative terms as follows:
[single-letter piece abbreviation][former file][operator indicating direction of movement][new file, or in the case of purely vertical movement, number of ranks traversed]
The file numbers are counted from each player's right to each player's left.
In case there are two identical pieces in one file, symbols + (front) and – (rear) are used instead of former file number. Direction of movement is indicated via an operator symbol. A plus sign is used to indicate forward movement. A minus sign is used to indicate backward movement. A dot or period or equals sign is used to indicate horizontal or lateral movement. For a piece that moves diagonally (such as the horse or elephant), the plus or minus sign is used rather than the period.
Thus, the most common opening in the game would be written as:
* C2.5 H8+7
According to World Xiangqi Federation (WXF), in the case of tripled, quadrupled, or quintupled soldiers (pawns), the S for soldier or P for pawn is omitted. Instead, the soldiers are numbered starting from the frontmost soldier, and this number replaces the usual piece abbreviation. The file number is given immediately after as usual.
Thus the notation to move the middle of a set of tripled soldiers on the 5th file to the 4th file would be:
* 25=4
In older books written in Chinese the system is the same, except that: the names of the pieces are written in Chinese; the name for the cannon on both sides is 炮; the name for the horse on both sides is 馬; forward motion is indicated with 進 (pronounced jìn); backward motion is indicated with 退 (tuì); sideways motion is indicated with 平 (píng); and numbers are written in Chinese either for both players or for just Black.
Thus, the most common opening in the game might be written as:
* 炮二平五 馬8進7

### System 3

This system is unofficial and principally used by Western players. It is similar to algebraic notation for Western chess. Letters are used for files and numbers for ranks. File "a" is on Red's left and rank "1" is nearest to Red. A point's designation does not depend on which player moves; for both sides "a1" is the lowest left point from Red's side.
[single-letter piece abbreviation][former position][capture indication][new position][check indication][analysis]
Pieces are abbreviated as in notation system 2, except that no letter is used for the soldier.
Former position is only indicated if necessary to distinguish between two identical pieces that could have made the move. If they share the same file, indicate which rank moves; if they share the same rank, indicate which file moves. If they share neither rank nor file, then the file is indicated.
Capture is indicated by "x". No symbol is used to indicate a non-capturing move.
Check is indicated by "+", double check by "++", triple check by "+++", and quadruple check by "++++". Checkmate is indicated by "#".
For analysis purposes, bad moves are indicated by "?" and good moves by "!". These can be combined if the analysis is uncertain ("!?" might be either but is probably good; "?!" is probably bad) or repeated for emphasis ("??" is a disaster).
Thus, the most common opening in the game would be written as:
* Che3 Hg8

### Example

For example, the following game is tied with several others as the shortest possible xiangqi game (analogously to Fool's Mate), written in each of the three notations:
Black is mated and therefore loses. Red's cannon cannot be captured, and the advisor on e9 blocks both Black's general from escaping there and the advisor on d10 from unbecoming a platform for the cannon.

## Gameplay

Because of the size of the board and the low number of long-range pieces, there is a tendency for the battle to focus on a particular area of the board.

### Tactics

Xiangqi involves several tactics common to games in the chess family. Some common ones are briefly discussed here.
* In a fork, one piece attacks two or more enemy pieces at once.
* A piece is pinned when it cannot move without exposing a more important piece to capture. Every piece except soldiers and advisors can pin, but only chariot pins exactly resemble pins in western chess; pins by other pieces in xiangqi take on many unique forms: Cannons can pin two pieces at once on one file or rank, horses can pin because they can be blocked, and generals can pin because of the "flying general" move rule. In pins by horses and elephants, the pinning piece never attacks the pinned piece, while in a pin by a cannon, only one of the pieces is directly attacked by the cannon. A general can only pin pieces to the enemy general, and the pinning general can never capture the pinned piece, since that would place it in check from the enemy general.
* A piece is skewered when it is attacked and, by moving, exposes a less important piece to be captured. In contrast to pins, only cannons and chariots can skewer.
| Fork | Pin | Skewer |
| Red's horse (傌) at d5 forks black's soldier (卒) at c7 and cannon (砲) at e7. | Red's advisor (仕 ) and horse (傌) on d2 are both relatively pinned by Black's cannon (砲) at d4 to Red's chariot (俥) on d1. Black's horse (馬) on e9 is absolutely pinned by Red's horse at e8. It is illegal for the black horse to move, but it is safe from attack, while Black's cannon actively attacks the red horse and forces the red chariot to defend it. | Red's cannon (炮) at e1 is skewering black's general (將) at e8 and chariot (車) at e10. When the black soldier (卒) or general moves laterally to remove the check, the other will act as a platform for the red cannon to capture the black chariot. |
* A discovered check occurs when an attacking piece moves so that it unblocks a line for a chariot, cannon, and/or horse to check the enemy general.
* A double check occurs when two pieces simultaneously threaten the enemy general. Unlike a Western chess double check, a double check in xiangqi may be blockable or, in one case, possibly met with a capture by a piece other than the general. The only blockable cases are either a chariot and cannon on the same file as the general, with the chariot acting as a screen for the cannon, two horses giving discovered check after another piece unblocks the attack from both, or a cannon using an enemy piece as a platform uncovered by a horse (see below). Double checks delivered by other means are not blockable. In one exceptional case, if a horse moves to give a double check by uncovering a cannon, and the cannon’s platform is an enemy chariot or defensive piece (advisor or elephant), the enemy chariot or defensive piece might be able to capture the horse, which removes the cannon’s platform at the same time. Otherwise, capturing either checking piece is insufficient to remove the threat, unless the general makes the capture.
| Blockable double check | Double check met by capture | Double check that compels the general to move |
| Red's horse has moved to d7, creating a double check against Black's general, but Black can answer by moving the cannon to d8, blocking the horse and removing the cannon's platform | Red's horse has moved from e4 to d6, unveiling a double check with the cannon, but Black can reply by simply capturing the horse with the chariot. | Red's horse has moved from e6 to f8 and placed the black general in double check. Since, as in western chess, there are two independent lines of attack, Black cannot respond with any move other than moving the general to f10, whereupon Red wins Black's horse for free. |
* Unique to xiangqi is a triple check, which arises in four combinations. In the first case of a cannon, a chariot or soldier, and a horse, the horse moves to give check, uncovering a double check from the chariot and the cannon. In the second, rarer case of a chariot or soldier and two horses, the chariot moves to give check, uncovering a double check from the two horses. In the third case of two cannons and two horses, one cannon may uncover a double check from the horses and act as a screen for the other cannon. Finally, a chariot or soldier can move to give check, uncovering a check from a horse while acting as a platform for a cannon to give another check. Quadruple check is also possible, arising with two horses, a chariot, and a cannon. Triple and quadruple check cannot be blocked or met by captures (again, unless the general makes the capture).
| Triple check | Quadruple check | Triple check, alternate position |
| Red's horse (傌) has moved from e5 to d7, giving check and exposing a double check from the chariot (俥) at e3 and the cannon (炮) at e2. | Red's chariot (俥) has moved from f9 to e9, giving check and exposing a triple check from the cannon (炮) at e7 and both horses (傌) at f8 and g9. Replacing the chariot with a cannon or removing a horse produces a triple check. | Red's chariot (俥) has moved from f9 to e9, discovering two checks from both horses (傌) at f8 and g9 and gives check itself. |
In contrast to the ubiquity of pawn chains in western chess, soldiers typically do not support each other until the endgame, because from the initial position it takes a minimum of five moves of a soldier to allow mutual protection between two of them, and they are often prone to capture by other pieces.
Soldiers, horses, cannons and chariots can form up formations that protect each other. However, lining up chariots must be done with caution, as this risks losing one chariot to an enemy's inferior piece. Horses that support each other are called Linked Horses (Chinese: 連環馬), which is a relatively safe formation of the horses, though it can still be threatened with a soldier, a chariot plus another minor piece, or a piece blocking one of the horses thus making the protection one-sided.
It is common to use cannons independently to control particular ranks and files. Using a cannon to control the middle file is often considered vital strategy, because it pins pieces such as the advisors and elephants to the general, which in turn restrict their general’s movement. The two files adjacent to the middle file are also considered important and horses and chariots can be used to push for checkmate there.
Since the general is usually safest in its original position before the endgame phase, attacking the general commonly involves forcing the general out of its original position with check or with threats. Thus, specific points and formations are very important in xiangqi.
For an attacking (Red) horse, the most fatal points are c9 and g9 (Chinese: 臥槽馬), especially since without proper defence a quick mate can follow with an extra chariot or cannon.
* Liang vs. Zhao, 1982
* Due to the pin of two pieces by the red cannon, Black's centroid horse has become a liability rather than an asset.
For a cannon, one of the most fatal formations is the exposed cannon (Chinese: 空心炮), where the cannon directly controls the middle file with no other pieces between the cannon and the general. This formation is particularly dangerous since the defensive side cannot move any piece in front of the cannon; while with an extra cannon joining the attack, mate can follow on the spot, and with an extra rook, the offensive side can mount a double check (with the rook in front of the cannon) followed by a windmill (as when the check is blocked, the rook moving laterally discovers a new check from the cannon), often winning at least a piece afterwards. If the defensive side cannot chase the cannon away or capture it, it must move the general forward to avoid these threats, leaving the general vulnerable to attacks.
Another fatal formation, called the "cannon-controlled centroid horse" (Chinese: 炮鎮窩心馬, diagram at right), also requires particularly bad coordination of the enemy pieces. In the diagram, Black's "centroid horse" occupies the centre of the palace, blocking Black's own general and advisors, and being pinned to the general by the red cannon, cannot move. Black's cannon at e8 is also pinned to its own general; it too is unable to move and restricts the movement of Black's two elephants, making them unable to protect each other. Such a formation in the middlegame often produces deadly threats of smothered mates, while in the endgame, as in the diagram, Red's cannon cannot be chased away, rendering Black's general, advisors, cannon on e8, and horse all permanently immobilized. Even though Black is up a minor piece, Red has a clear win: The game concluded 41.Hg7 (forking the elephant and pinned cannon and creating a mating threat) Eg10 42.Hh9 Ci9 43.Hf8+ Cf9 (if not for the other black cannon, it is instant mate) 44.Hxg6, and Black resigned: Black's only active piece (the cannon on f9) is absolutely helpless to stop Red's horse and soldiers, which will soon invade the palace.
A common defensive configuration is to leave the general at its starting position, deploy one advisor and one elephant on the two points directly in front of the general, and to leave the other advisor and elephant in their starting positions, to the side of the general. In this setup, the advisor and elephant pairs support each other, and the general is immune from attacks by cannons. Losing any defensive pieces makes the general vulnerable to cannon attack, and the setup may need to be abandoned. The defender may move defensive pieces away from the general, or even sacrifice them intentionally, to ward off attack by a cannon.
* Red mates in 11
* Solution: 1.Rh10++
* 1. ...Eig10 gets mated faster: 2.Rgxg10+ Af10 (Exg10 3.Rxg10#) 3.Rxf10+ Ge9 4.Rh9#.
* 1. ...Eeg10 gets mated immediately with 2.Rhxg10#
* 1. ...Af10
* 2.Rh9+ Afe9
* 3.Rg10++ Af10
* 4.Rg9+ Afe9
* 5.Rh10++
* Again both 5. ...Eig10 and 5. ...Eeg10 lead to faster mates.
* 5. ...Af10 6.Re9+!!
* A brilliant smothered-check inducing move. If 6. ...Gxe9 7. Rh9#
* 6. ...Adxe9
* 7.Rh9+ Eeg10
* 8.Rxe9+ (the chariot is untouchable with legal moves) Gd10
* 9.Re10+ Gd9
* 10.d8+ Gxd8
* 11.Rd10#
* Note that if Red plays 4.Re9+? instead, Red cannot force a mate: 4. ...Adxe9 5.Rg9+ Eig10 and Red cannot play Rxe9+ on the next move because the chariot is then not supported by the general, and black can simply play Gxe9. The purpose of using the g-chariot to give check is to place the h-chariot on the h9 point, blocking Black's Eig10.
Long sequences of checks leading to mate or gain of material are common both in chess compositions and in actual play. A skilled xiangqi player would often have to calculate several steps, or even tens of steps ahead for a forced sequence. In the diagram on the right, Black has an immediate mating threat which cannot be parried, forcing Red to check Black on every move. Although it requires 11 moves to mate, its general idea is clear: Induce a smothered check by sacrificing a chariot at the centre of the palace (e9), then force Black to open the centre file, enabling the Red general to assist the attack, and finally mate by facing generals.

### Openings

Since the left and right flanks of the starting setup are symmetrical, it is customary to make the first move on the right flank. Starting on the left flank is considered needlessly confusing.
The most common opening is to move the cannon to the central column, an opening known as 當頭炮 (trad.) / 当头炮 (simp.) dāng tóu pào or "Central Cannon". The most common reply is to advance the horse on the same flank. Together, this move-and-response is known by the rhyme 當頭炮，馬來跳 (trad.) / 当头炮，马来跳 (simp.) dāng tóu pào, mǎ lái tiào. The notation for this is "1. 炮 (32)–35, 馬 (18)–37", "1. C2.5 H8+7", or "1. Che3 Hg8" (diagram at right). After Black's 1. ...H8+7 (Hg8) response, the game can develop into a variety of openings, the most common being the 屏風馬 (trad.) / 屏风马 (simp.) or "Screen Horses (Defence)" in which Black develops the other horse to further protect their middle pawn (...H2+3 or ...Hc8) either immediately on their second move, or later when Black transposes the game into this opening.
Alternative common first moves by Black are developing either cannons (1. ...C8.5/1. ...Che8, or 1. ...C2.5/1. ...Cbe8); note that after either of these moves, taking the central soldier with the cannon (2. C5+4 or 2. Cxe7+) is a beginner's trap that impedes development and coordination of Red's pieces if Black plays correctly (for example, 1. Che3 Che8 2. Cxe7+?? Ade9 3. Hg3 Hg8 4. Ce5 Rh10 when Black develops the rook first, and the loss of Black's middle pawn actually enabled Black's horses to occupy the centre on the next moves).
Other common first moves by Red include moving an elephant to the central column (1. Ege3), advancing the soldier on the third or seventh file (1. c5), moving a horse forward (1. Hg3), and moving either cannon to the 4th or 6th (d- or f-) file (1. Chd3 or 1. Chf3). Compared to the Central Cannon openings, these openings are generally less restricted by theory.
General advice for the opening includes rapid development of at least one chariot and putting it on open files and ranks, as it is the most powerful piece with a long attack range. There is a saying that only a poor player does not move a chariot in the first three moves (Chinese: 三步不出車，必定要輸棋); however this is not to be taken literally, and is in fact often violated in modern Xiangqi games. Attacking and defending the centre, especially the central soldiers / central pawns, are common themes in the opening, hence the Central Cannon openings. Usually, at least one horse should be moved to the middle in order to defend the central soldier; however undefended central soldiers can also become "poisoned pawns" in the early moves, especially if the attacking side does not have an immediate follow-up to retain the pressure on the central file.

### Middlegame strategy

Xiangqi strategy shares common themes with chess, but has some differences:
* Occupying the centre is relatively less important in xiangqi, but controlling and attacking the middle file is still one of the vital themes. Since the middle file is often well defended, players would then seek to mount an offense on either of the flanks on the enemy side, especially when the defense of one flank is neglected.
* The significance of pawn formation in xiangqi and chess are different. In xiangqi, soldiers (pawns) are often pushed to avoid blocking their own horses, and it is uncommon for them to defend each other (in contrast with a Western chess pawn chain). Successfully getting a soldier to cross a river as an attacking force can often tilt the scales of the middlegame by a large margin.
* In high-level play, the initiative is highly important, and a minor mistake can doom a game.
* Sacrifices are common in xiangqi, however they are more often tactical rather than positional. Usually, at most a minor piece is sacrificed for positional advantages, or a semi-tactical attack.
Like in chess, xiangqi piece values depend highly on the position on the board. The following study from Volume 42 of the Elegant Pastime Manual, dating from the Ming Dynasty, illustrates this dramatically. It is Red to play and win.
In this position, Red is up two soldiers and a cannon but Black threatens seemingly unstoppable mate with ...Rf1#, since 1.Ec5? Ad8! renews the mate threat. Note that the red chariot is nearly useless, having only two legal moves, in stark contrast to the very active black chariot. However, Red averts the checkmate by sacrificing both the cannon and chariot: 1.Ca10+!! Hxa10 2.Ea3! Rxa1 (or the chariot is lost, since the general protects the elephant on e3, which in turn guards g1, and the red horse guards e2) 3.Eec1:
Despite the substantial sacrifice of material by Red, Black's chariot has now become useless as it is permanently immobilized by the red elephants and horse; the red general prevents the black soldier on g2 from moving laterally to free the chariot (for example 3...g1 4.Gf2). Black's horse similarly has no safe move due to the red soldier on c8, which also, along with the soldier on f9, prevents the black general from attacking the soldier on f9 from the behind. In addition, the black soldier on g6 is undefended and has no safe move, so Red can win it by pushing the soldier on c4 to c6 and moving it laterally to the g-file, after which the position is effectively an endgame of three soldiers against two advisers, an easy win for Red (see below) despite being down a chariot for three soldiers.

### Endgame

Though xiangqi endgames require remarkable skill to be played well, there are a number of widely known book wins and book draws. Without a counterpart to pawn promotion, xiangqi endgames instead focus more directly on forcing checkmate or stalemate, and in this regard resemble pawnless chess endgames. Since stalemate is a loss for the stalemated player instead of a draw, most book draws in xiangqi are due to fortresses, with a few draws due to insufficient material.
A general rule in xiangqi endgames for the advantageous side is that, when there's less material on the board, do not trade pieces easily, as with fewer attacking pieces on the board, defending is easier (in contrast to Western chess, where it is almost always advantageous to trade pieces when up on material). Hence, if a certain type of endgame can transpose, by trading pieces, into another type of endgame which is a book win, then this endgame itself is a book win.

#### Zugzwang in xiangqi endgames

Inducing zugzwang is a crucial theme in winning simple endgames, and almost exclusively in simple endgames. In the general + soldier vs general endgame shown on the right, Red's first main goal is to occupy the middle file. Red wins with 1. Gd1, a waiting move, and Black is in zugzwang. Black must proceed with 1. ...Ge8, as 1. ...Ge10 instantly loses after 2. f9#. After 1. ...Ge8 2. f9 Gf8 3. e9 Ge8 4. d9 Gf8 5. Ge1, Red's general successfully occupies the middle file. The game would conclude with 5. ...Gf9 6. e9+, and regardless of Black's reply, 7. Ge2# (stale)mates Black.
Reciprocal zugzwang is possible, but very rare and usually seen in endgame compositions. In this endgame shown on the right, whoever moves loses, since when either of the two generals moves to an open d- or f- file, it threatens unstoppable mate, while the player to move only helps the enemy general occupy one of the files. For instance, Red can only move their two soldiers if he is to move. Moving the f-(or d-)soldier allows the enemy general to occupy the f-file(d-file). Even if 1. fe9+ Gf10 2. d10, when Red threatens mate in 1, Black still mates immediately with either 2. ...fe2# or 2. ...f1#.

#### Soldier (pawn) endgames

* A soldier, as long as it does not reach the opposite rank, wins against a bare general easily. With any extra defensive piece on the defensive side, it is a draw; however, soldier vs advisor requires skill to play well. Any number of soldiers on the opposing back rank are also a draw due to insufficient material.
* Two unadvanced (i.e., on the 6th or 7th ranks) soldiers win against the following combinations: Two advisors, two elephants, a bare horse/cannon. Generally a draw against one advisor plus one elephant, or a horse/cannon plus a defending piece.
* Three unadvanced soldiers win against the following combinations: All 4 defensive pieces (2 advisors plus 2 elephants, Chinese: 士象全), a horse plus two advisors/two elephants, a cannon plus two elephants.

#### Horse endgames

* A bare horse wins against a bare advisor, but not a bare elephant.
* A horse plus an unadvanced soldier wins against both combinations of 3 defensive pieces, or any combination of a minor piece plus a defensive piece except horse + elephant. This combination draws against all 4 defensive pieces.
* A horse plus an advanced soldier(on the 8th or 9th rank) draws against either combination of 3 defensive pieces, but defending requires precise positions.
* A horse plus a soldier on the 10th rank wins against two advisors, or one advisor plus one elephant. This combination draws against 2 elephants.
* A horse plus two soldiers can win against one minor piece + one advisor + two elephants. With an extra advisor on the defensive side, it is a book draw.
* Two horses win against all 4 defensive pieces, or any combination of a minor piece plus 2 defensive pieces except cannon + 2 elephants.

#### Cannon endgames

* A bare cannon, or a cannon with elephants, cannot win against a bare general due to insufficient material. Cannons without other offensive pieces need defensive pieces to act as platforms, especially the advisor, since the advisor can act as a platform on any of the three central files, while an elephant can only act as a platform on the centermost file.
* A cannon needs only one advisor to win against two advisors, or a single elephant. Meanwhile, even with all 4 defensive pieces, it is a book draw against two elephants, one advisor + one elephant, one soldier + one advisor, or any minor piece.
* A cannon with all 4 defensive pieces needs at least an extra soldier to win against 4 defensive pieces. A bare cannon with a soldier on the 6th rank wins against any combination of 2 defensive pieces.
* A cannon + 4 defensive pieces + 2 unadvanced soldiers generally draw against one minor piece + 4 defensive pieces. But if the defensive side lacks a single piece, it is a book win.

#### Horse+Cannon endgames

This type of endgame is considered one of the more complex endgames. Commonly known book wins and book draws are:
* Horse + Cannon + 4 defensive pieces vs a minor piece vs 4 defensive pieces: A win if the minor piece is a horse (the attacking side does not need all 4 defensive pieces to win), a draw if it is a cannon.
* With the same combination of the two minor pieces and all 4 defensive pieces on both sides, one needs two extra soldiers for a book win.
* If both sides have 2 minor pieces and 4 defensive pieces, and the advantegeous side only has one extra soldier, then regardless of the combination of the two minor pieces, it is a book draw.

#### Chariot endgames

Single chariot endgames:
* A single chariot generally cannot win against 4 defensive pieces, but with 3 or fewer defensive pieces, it is a forced win.
* Chariot vs one minor piece plus 2 defensive pieces: A win if the 2 defensive pieces are not the same, or if the combination is horse + two advisors. If the defensive side has horse + two elephants, a specific fortress is required to draw.
* Chariot vs one minor piece plus 3 defensive pieces: A draw.
* Chariot vs two minor pieces with no defensive pieces: A draw, but requires good defensive positions.
Chariot + soldiers (unadvanced):
* Chariot + soldier, with sufficient defensive pieces on their own side, wins against a chariot plus an advisor, a chariot plus two elephants, or a chariot plus a soldier.
* Chariot + soldier wins against any 2 minor pieces + 2 advisors. This combination also wins against horse + 4 defensive pieces, but not cannon + 4 defensive pieces.
* Chariot + soldier vs 2 unadvanced soldiers + 4 defensive pieces: If the offensive side has no defensive piece, it is a draw since the 2 enemy soldiers can still be a formidable force. If the offensive side has one advisor, it is a win.
* Chariot + 2 soldiers cannot force a win against chariot + 4 defensive pieces. In this endgame, both attacking and defending require great skill.
Chariot + horse:
* A chariot plus a horse needs one advisor on their own side to win against a chariot plus two advisors.
* Chariot + horse vs chariot + two elephants: With enough defensive pieces for the attacking side, it is generally a win if the move limit is not taken into consideration.
Chariot + cannon:
* A chariot plus a cannon cannot win against a bare chariot, as long as the defending chariot occupies the middle file. However, with any extra defensive piece on the attacking side, it is a win.
* Chariot + cannon + 2 advisors would win against chariot + two elephants.
* Chariot + cannon + 4 defensive pieces vs chariot + 4 defensive pieces: Draw.
Two chariots:
* Two chariots vs chariot + 4 defensive pieces: A draw with good defensive positions.
* Two chariots vs chariot + minor piece + 2 defensive pieces: The only drawing combination is chariot + cannon + 2 advisors.
* Two chariots vs 2 minor pieces + 4 defensive pieces: A win if the 2 minor pieces are 2 horses.

## History

A game called xiangqi was mentioned as dating to the Warring States period; according to the first-century-BC text Shuo Yuan (說苑/说苑), it was one of Lord Mengchang of Qi's interests. However, the rules of that game are not described, and it was not necessarily related to the present-day game. Emperor Wu of Northern Zhou wrote a book in AD 569 called Xiang Jing. It described the rules of an astronomically themed game called xiangxi (象戲). Ancient reports state that "the pieces ... were called after the sun, the moon, the planets and the star-houses", in contrast with modern xiangqi. In addition, there are mentions of shuffling of pieces, which does not occur in xiangqi either. For these reasons, Murray argued that "in China [chess] took over the board and name of a game called 象棋 in the sense of 'Astronomical Game', which represented the apparent movements of naked-eye-visible astronomical objects in the night sky, and that the earliest Chinese references to 象棋 meant the Astronomical Game and not Chinese chess". Previous games called xiàngqí may have been based on the movements of sky objects. In contrast, present-day xiangqi developed from Indian chaturanga according to Murray;$^{:119–120}$ this is also the predominant opinion among historians.$^{:334}$
Some Sinologists and Chinese historians prefer an alternative hypothesis, according to which xiangqi originated in China and then spread westwards, giving rise to Indian and Persian chess.$^{:351–352}$ Specifically, it has been claimed that Xiangqi arose during the Warring States period and was patterned after the array of troops at the time. David H. Li, for example, argues that the game was developed by Han Xin in the winter of 204–203 BC to prepare for an upcoming battle. His theories, however, have been questioned by other chess researchers. The earliest description of the game's rules appears in the story "Cén Shùn" (岑順) in the collection Xuanguai lu (玄怪錄), written by Niu Sengru in the middle part of the Tang dynasty.
Xiangqi is the same as it is today from Southern Song dynasty.
Janggi of the Korean Peninsula originated from xiangqi.
With the popularization of xiangqi, many different schools of circles and players came into prominence, many books and manuals on the techniques of playing the game were also published, they played an important role in popularizing xiangqi and improving the techniques of play in modern times. With the economic and cultural development during the Qing dynasty, xiangqi entered a new stage. A Western-style Encyclopedia of Chinese Chess Openings was written in 2004.

## Modern play

| | A | B | C | D | E | F | G | H | I | |
| 10 | | | | | | | | | | 10 |
| 9 | | | | | | | | | | 9 |
| 8 | | | | | | | | | | 8 |
| 7 | | | | | | | | | | 7 |
| 6 | | | | | | | | | | 6 |
| 5 | | | | | | | | | | 5 |
| 4 | | | | | | | | | | 4 |
| 3 | | | | | | | | | | 3 |
| 2 | | | | | | | | | | 2 |
| 1 | | | | | | | | | | 1 |
| | A | B | C | D | E | F | G | H | I | |

### Tournaments and leagues

Although xiangqi has its origin in Asia, there are xiangqi leagues and clubs all over the world. Each European nation generally has its own governing league; for example, in Britain, xiangqi is regulated by the United Kingdom Chinese Chess Association. Asian countries also have nationwide leagues, such as the Malaysia Chinese Chess Association.
In addition, there are several international federations and tournaments. The Chinese Xiangqi Association hosts several tournaments every year, including the Yin Li and Ram Cup Tournaments. Other organizations include the Asian Xiangqi Federation and a World Xiangqi Federation, which hosts tournaments and competitions bi-annually, with most limited to players from member nations.
There are Europeanized versions of boards (10 × 9) and figures of xiangqi.

### Rankings

The Asian Xiangqi Federation (AXF) and its corresponding member associations rank players in a format similar to the Elo rating system of chess. According to the XiangQi DataBase, the top-ranking female and male players in China, as of June 2012, were Tang Dan and Jiang Chuan, with ratings of 2529 and 2667, respectively. Other strong players include Zhao GuanFang (female), Xu Yinchuan (male), Lu Qin (male), and Wang LinNa (female).
The Asian Xiangqi Federation also bestows the title of grandmaster to select individuals around the world who have excelled at xiangqi or made special contributions to the game. There are no specific criteria for becoming a grandmaster and there are only approximately 100 grandmasters as of 2020. The titles of grandmaster is bestowed by bodies such as the AXF and the Chinese Xiangqi Association (CXA).

### Computers

The game-tree complexity of xiangqi is approximately 10$^{150}$; in 2004 it was projected that a human top player would be defeated before 2010. Xiangqi is one of the more popular computer-versus-computer competitions at the Computer Olympiads.
Computer programs for playing xiangqi show the same development trend as has occurred for international chess: they are usually console applications (called engines) which communicate their moves in text form through some standard protocol. For displaying the board graphically, they then rely on a separate graphical user interface (GUI). Through such standardization, many different engines can be used through the same GUI, which can also be used for automated play of different engines against each other. Popular protocols are UCI (Universal Chess Interface), UCCI (Universal Chinese Chess Interface), Qianhong (QH) protocol, and WinBoard/XBoard (WB) protocol (the latter two named after the GUIs that implemented them). There now exist many dozens of xiangqi engines supporting one or more of these protocols, including some commercial engines.

## Variations

Blitz chess Each player only has around 5–10 minutes each.
Manchu chess Invented during the Manchu-led Qing dynasty. Red horses, cannons, and one of the chariots are absent, but the remaining chariot can be played as horses and cannons as well.
Supply chess Similar to the Western chess variant Bughouse chess, this variant features the ability to re-deploy captured pieces, similar to a rule in shogi. Four players play as two-person teams in two side-by-side games. One teammate plays Black and other plays Red. Any piece obtained by capturing the opponent's piece is given to the teammate for use in the other game. These pieces can be deployed by the teammate to give him an advantage over the other player, so long as the piece starts on the player's own side of the board and does not cause the opponent to be in check.
Formation Similar to Fischer Random Chess, one player's pieces are placed randomly on one side of the river, except for the generals and advisors, which must be at their usual positions, and the elephants, which must start at two of the seven points they can normally reach. The other player's pieces are set up to mirror the first's. All other rules are the same.
Banqi This variation is more well known in Hong Kong than in mainland China. It uses the xiangqi pieces and board, but does not follow any of its rules, bearing more of a resemblance to the Western game Stratego as well as the Chinese game Luzhanqi.

## Variations played with special boards or pieces

There are many versions of three-player xiangqi, or san xiangqui, all played on special boards.
San Guo Qi "Game of the Three Kingdoms" is played on a special hexagonal board with three xiangqi armies (red, blue, and green) vying for dominance. A Y-shaped river divides the board into three gem-shaped territories, each containing the grid found on one side of a xiangqi board, but distorted to make the game playable by three people. Each player has eighteen pieces: the sixteen of regular xiangqi, plus two new ones that stand on the same rank as the cannons. The new pieces have different names depending on their side: huo ("fire") for Red, qi ("flag") for Blue, and feng ("wind") for Green. They move two spaces orthogonally, then one space diagonally. The generals each bear the name of a historical Chinese kingdom—Shu for Red, Wei for Blue, and Wu for Green—from China's Three Kingdoms period. It is likely that San Guo Qi first appeared under the Southern Song dynasty (1127–1279).
San You Qi "Three Friends Chess" was invented by Zheng Jinde from Shexian in the Anhui province during the reign of the Kangxi Emperor of the Qing dynasty (1661–1722). It is played on a Y-shaped board with a full army of xiangqi pieces set up at the end of each of the board's three wide radii. In the centre of the board sits a triangular zone with certain features, such as ocean, mountain, or city walls, each of which is impassable by certain pieces. Two of an army's five soldiers are replaced by new pieces called huo ("fire") pieces, which move one space diagonally forward. Two qi ("flag") pieces are positioned on the front corners of the palace; they move two spaces forward inside their own camp, and then one space in any direction inside an enemy camp.
Sanrenqi "Three Men Chess" is a riverless, commercial variant played on a cross-shaped board with some special rules, including a fourth, neutral country called Han. Han has three Chariots, one Cannon, and one General named "Emperor Xian of Han", but these pieces do not move and do not belong to any of the players until a certain point in the game when two players team up against the third player. At that point the third player gets to also control Han.
Si Guo Qi "Four Kingdoms Chess" is also played on a riverless, cross-shaped board, but with four players. Because there are no rivers, elephants may move about the board freely.
Qi Guo Xiang Qi "Game of the Seven Kingdoms" is based symbolically on the Warring States Period.

## In Unicode

Xiangqi pieces were added to Unicode version 11.0 in June 2018. They are assigned to the codepoints U+1FA60–U+1FA6D in the Chess Symbols block. For legibility, the red pieces are filled white, while black pieces are filled black.
* U+1FA60 🩠 XIANGQI RED GENERAL
* U+1FA61 🩡 XIANGQI RED MANDARIN
* U+1FA62 🩢 XIANGQI RED ELEPHANT
* U+1FA63 🩣 XIANGQI RED HORSE
* U+1FA64 🩤 XIANGQI RED CHARIOT
* U+1FA65 🩥 XIANGQI RED CANNON
* U+1FA66 🩦 XIANGQI RED SOLDIER
* U+1FA67 🩧 XIANGQI BLACK GENERAL
* U+1FA68 🩨 XIANGQI BLACK MANDARIN
* U+1FA69 🩩 XIANGQI BLACK ELEPHANT
* U+1FA6A 🩪 XIANGQI BLACK HORSE
* U+1FA6B 🩫 XIANGQI BLACK CHARIOT
* U+1FA6C 🩬 XIANGQI BLACK CANNON
* U+1FA6D 🩭 XIANGQI BLACK SOLDIER