How do you calculate a forced checkmate in xiangqi?

These answers restate the rules implemented by our open-source engine, which follows the WXF laws and is regression-tested against the official 110-diagram repetition casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it against the engine before publishing.

Direct answer

Work backward from the goal: identify every point the general could escape to, work out which of your pieces can cover each one, and only then look for the forcing sequence, usually checks, that removes the escapes in the right order. Verify every legal reply at each step rather than assuming your first idea goes unanswered.

Why counting escape points first beats searching for checks first

Jumping straight to "what check can I give" often produces a move that looks forcing but leaves an escape point uncovered. Counting the general's available points before you start, given the current position, tells you exactly how many of them still need to be dealt with before any check can actually be mate.

Checking every branch, not just the expected one

A forced mate calculation is only as good as its weakest branch: if the opponent has three legal replies to your check and you've only checked that one of them fails, the calculation isn't finished. This discipline is what separates a calculated mate from a hopeful one.

Related questions

Is this the same process used for the basic checkmate patterns?

Yes, the standard patterns are really just memorised versions of this same escape-point counting done in advance.

What if I can't find a forced mate?

Look for a move that improves your position or restricts the general further instead; not every strong attack needs to end in an immediate forced mate.

Try it on a real board

Reading an answer is one thing; playing it is another. Free, instant, and nothing to install.