Xiangqi piece value model

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

Another oops. I really only patched this on my big machine where I am running the test games, and tried to reproduce it on my laptop while traveling. SameColor is of course a 2 arguments macro, and the patch should be:

Code: Select all

--- a/moves.c
+++ b/moves.c
@@ -986,6 +986,13 @@ GenPseudoLegal (Board board, int flags, MoveCallback callback, VOIDSTAR closure,
 
             case WhiteWazir:
             case BlackWazir:
+      if(gameInfo.variant == VariantXiangqi) { // confine to Palace
+          int palace = (piece == WhiteWazir ? 1 : BOARD_HEIGHT-2); // rank of Palace center square
+          if(ff >= BOARD_WIDTH/2 && !SameColor(board[rf][ff-1], piece) callbackboard, flags, NormalMove, rf, ff, rf, ff-1, closure);
+          if&#40;ff <= BOARD_WIDTH/2 && !SameColor&#40;board&#91;rf&#93;&#91;ff+1&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf, ff+1, closure&#41;;
+          if&#40;rf >= palace && !SameColor&#40;board&#91;rf-1&#93;&#91;ff&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf-1, ff, closure&#41;;
+          if&#40;rf <= palace && !SameColor&#40;board&#91;rf+1&#93;&#91;ff&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf+1, ff, closure&#41;;
+      &#125; else
       Wazir&#40;board, flags, rf, ff, callback, closure&#41;;
       break; 
BTW, I would be interested in the list in Lau's book. I got mine from the xqinenglish.com website and from analysis with HaQiKi D. (But I am not sure about KHP-KAEE; it seems I really need a KHPKd EGT. But that should be no problem once I have extended my generator to do 2 attackers vs defenders, on which I am working now. Then I can do KHHKd as well as KHPKd.)
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Xiangqi piece value model

Post by Evert »

hgm wrote:Another oops. I really only patched this on my big machine where I am running the test games, and tried to reproduce it on my laptop while traveling. SameColor is of course a 2 arguments macro, and the patch should be:

Code: Select all

--- a/moves.c
+++ b/moves.c
@@ -986,6 +986,13 @@ GenPseudoLegal &#40;Board board, int flags, MoveCallback callback, VOIDSTAR closure,
 
             case WhiteWazir&#58;
             case BlackWazir&#58;
+      if&#40;gameInfo.variant == VariantXiangqi&#41; &#123; // confine to Palace
+          int palace = &#40;piece == WhiteWazir ? 1 &#58; BOARD_HEIGHT-2&#41;; // rank of Palace center square
+          if&#40;ff >= BOARD_WIDTH/2 && !SameColor&#40;board&#91;rf&#93;&#91;ff-1&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf, ff-1, closure&#41;;
+          if&#40;ff <= BOARD_WIDTH/2 && !SameColor&#40;board&#91;rf&#93;&#91;ff+1&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf, ff+1, closure&#41;;
+          if&#40;rf >= palace && !SameColor&#40;board&#91;rf-1&#93;&#91;ff&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf-1, ff, closure&#41;;
+          if&#40;rf <= palace && !SameColor&#40;board&#91;rf+1&#93;&#91;ff&#93;, piece&#41; callbackboard, flags, NormalMove, rf, ff, rf+1, ff, closure&#41;;
+      &#125; else
       Wazir&#40;board, flags, rf, ff, callback, closure&#41;;
       break; 
That still doesn't compile:

Code: Select all

moves.c&#58; In function ‘GenPseudoLegal’&#58;
moves.c&#58;991&#58; error&#58; expected ‘)’ before ‘callbackboard’
moves.c&#58;992&#58; error&#58; expected ‘)’ before ‘callbackboard’
moves.c&#58;993&#58; error&#58; expected ‘)’ before ‘callbackboard’
moves.c&#58;994&#58; error&#58; expected ‘)’ before ‘callbackboard’
make&#91;2&#93;&#58; *** &#91;moves.o&#93; Error 1
and "callbackboard" seems to be an unknown quantity anyway. There's no real rush though, so it can wait until you're back at your home machine.
BTW, I would be interested in the list in Lau's book. I got mine from the xqinenglish.com website and from analysis with HaQiKi D. (But I am not sure about KHP-KAEE; it seems I really need a KHPKd EGT. But that should be no problem once I have extended my generator to do 2 attackers vs defenders, on which I am working now. Then I can do KHHKd as well as KHPKd.)
The list is rather longer than I thought it was, he lists some 70 endgames (and he has a different English notation, where N=H, M=E and S=A). It'll take me while to go through it. They're organised by "red" material (R, RP, RPP, RHH, RC, RR, H, HP, HH, C, CP, CPP, CC, P, PP). For most listed combinations he gives typical "won" and (fortress)"draw" positions, similar to the Lucena and Philidor positions. The main "general" rule I was able to take away from it is that pawns should not be pushed beyond the second rank past the river, or many of the pawn endings become draws.

He doesn't list KHP-KAEE, but KHP-KAAEE is "usually drawn". KHP-KAAE has a fortress draw, but it's not obvious how easy it is to get there. Even KH-KE is listed as a draw if defending K and E are on opposite sides of the central file (and a win otherwise). KH-KA is a general win. This rather suggests that KHP-KAEE is probably a draw.

I'll compare what he lists to the list you have above and see if there are any obvious additions.
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

I must be getting blind, so many typos in one line. A parenthesis is missing between callback and board: callback(board... And the closing parenthesis of the if() is also missing; it should be just before 'callback'.

As to the end-games: I did not know it mattered in KH-KE where the Elephant was; I listed this as a draw. When I let HaQiKi D evaluate the end-game I always start the Horse at a distance to avoid accidental tactics. I suppose this gives the defender time to get the Elephant to the save side. This would never take very long. So I guess the won cases should really count as tactically non-quiet positions, which I would not even count as KH-K, because the E is lost within a few moves. Similar cases exist in KH-KP, where a non-crossed Pawn can get lost by forks and such. Normally a Horse cannot catch a Pawn or Elephant, and posession of any piece avoids zugzwang / stalemate.

The tricky thing with Elephants as defenders is that Pawns and Horses can completely avoid them, and they can also not shield the entire Palace from the opponent King. And H+P can really checkmate, so you are not dependent on stalemate, and the fact that the Elephants provide tempos is thus of no help. My idea was that the Pawn can always enter the Palace on d8 (protected by the Horse, if needed), the King can cover the f-file, and the Horse then checks e9.
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

It seems just the other way arounde from which I thought: KHP is a win vs KAAE, but not KAEE. I have the 2-attackers-vs-defense EGT generator working now, so that I could build KHPKd. (The resulting EGT are 20MB at 1 byte/position, as I confine the attackers to the enemy board half.) This gave the following result:

Code: Select all

        mated    mate
King captures 0
mates   51722         ( 0.28 sec&#41;
in-1    30190  137125 ( 0.35 sec&#41;
in-2    32338  100376 ( 0.43 sec&#41;
in-3    40776  114091 ( 0.51 sec&#41;
in-4    54486  146382 ( 0.60 sec&#41;
in-5    72731  177029 ( 0.69 sec&#41;
in-6   102150  222172 ( 0.79 sec&#41;
in-7   132398  267745 ( 0.89 sec&#41;
in-8   143822  323397 ( 1.01 sec&#41;
in-9   145760  347313 ( 1.14 sec&#41;
in-10  134970  336270 ( 1.26 sec&#41;
in-11  128800  300744 ( 1.39 sec&#41;
in-12  132386  277681 ( 1.51 sec&#41;
in-13  152048  274138 ( 1.64 sec&#41;
in-14  155373  292446 ( 1.76 sec&#41;
in-15  136581  274273 ( 1.87 sec&#41;
in-16  111988  235924 ( 1.99 sec&#41;
in-17   96766  191702 ( 2.10 sec&#41;
in-18   97728  177591 ( 2.20 sec&#41;
in-19  107940  173119 ( 2.30 sec&#41;
in-20  117918  178749 ( 2.42 sec&#41;
in-21  128966  181677 ( 2.52 sec&#41;
in-22  132438  180296 ( 2.64 sec&#41;
in-23  129573  181116 ( 2.74 sec&#41;
in-24  114151  175852 ( 2.85 sec&#41;
in-25   89317  145878 ( 2.94 sec&#41;
in-26   55831  106220 ( 3.03 sec&#41;
in-27   27474   66353 ( 3.11 sec&#41;
in-28   10668   35445 ( 3.18 sec&#41;
in-29    5516   18879 ( 3.25 sec&#41;
in-30    4801   11632 ( 3.31 sec&#41;
in-31    6032    9075 ( 3.37 sec&#41;
in-32    9283   11226 ( 3.43 sec&#41;
in-33   14764   17834 ( 3.50 sec&#41;
in-34   19047   25279 ( 3.56 sec&#41;
in-35   21480   28998 ( 3.63 sec&#41;
in-36   22573   31696 ( 3.71 sec&#41;
in-37   27889   35574 ( 3.78 sec&#41;
in-38   32828   42929 ( 3.85 sec&#41;
in-39   32261   44926 ( 3.92 sec&#41;
in-40   25743   41946 ( 3.98 sec&#41;
in-41   20003   36512 ( 4.06 sec&#41;
in-42   13956   30994 ( 4.12 sec&#41;
in-43   10522   23050 ( 4.20 sec&#41;
in-44    7939   17919 ( 4.26 sec&#41;
in-45    5530   12444 ( 4.33 sec&#41;
in-46    4171    9586 ( 4.39 sec&#41;
in-47    2831    6746 ( 4.45 sec&#41;
in-48    1812    4553 ( 4.51 sec&#41;
in-49    1643    2907 ( 4.56 sec&#41;
in-50    1513    2586 ( 4.64 sec&#41;
in-51    1172    2053 ( 4.70 sec&#41;
in-52     917    1779 ( 4.77 sec&#41;
in-53     735    1111 ( 4.83 sec&#41;
in-54     559     902 ( 4.89 sec&#41;
in-55     602     898 ( 4.95 sec&#41;
in-56     513    1225 ( 5.01 sec&#41;
in-57     572     770 ( 5.07 sec&#41;
in-58     390     737 ( 5.13 sec&#41;
in-59     278     456 ( 5.19 sec&#41;
in-60     264     380 ( 5.25 sec&#41;
in-61     215     382 ( 5.31 sec&#41;
in-62     202     284 ( 5.37 sec&#41;
in-63     154     204 ( 5.43 sec&#41;
in-64      95     170 ( 5.49 sec&#41;
in-65      40      90 ( 5.54 sec&#41;
in-66      13      74 ( 5.61 sec&#41;
in-67       3      10 ( 5.67 sec&#41;
in-68       0       3 ( 5.73 sec&#41;
won&#58;    6099923 &#40;29.1%)
lost&#58;   3166150 &#40;15.1%)
avg&#58;       18.5 moves
Then I took statistics by defensive composition. (The left column is 2*DTM+6; code 0 here means draw, code 2 illegal (King stare), code 4 broken (coinciding pieces).)

Code: Select all

           -       E      EE       A      AE     AEE      AA     AAE    AAEE
  0.    3032   45138  260060   20886  382286 2852836   36858 1131980 5642106
  2.   15504  103360  294576   60542  401316 1136514   90408  594624 1669176
  4.    2745   29705  119931   19678  185682  696852   48780  426830 1527270
  6.    2108     980    2038     902    3242    7184    2678   10368   22222
  8.    4442    1848    2168    1544    2210    4364    1608    4268    7738
 10.    8335    3745    3914    3291    1736    2103    2360    3318    3536
 12.    9168    7360    5634    6826    2843    2232    3088    2552    1073
 14.    6989   11383    7895   12321    5216    3110    5006    2004     562
 16.    2144   17608    9006   20329    8239    4256    8243    1994     912
 18.     208   26741   11758   27028   13750    5537   13845    2365     918
 20.       0   35403   13731   27952   20182    7842   22721    3959     608
 22.       0   32839   14709   20698   28684    7622   32529    6235     506
 24.       0   22876   14702   13172   38070    7249   39299    9654     738
 26.       0   13305   13219    5587   47930    6684   33757   13888     600
 28.       0    7052   10431    1826   61548    7797   23038   16451     657
 30.       0    4948    8971     390   76985    8984   13462   17503    1143
 32.       0    5981    8763      22   93847   11130   10749   20315    1241
 34.       0    5485    9746       6   93025   13620    9196   23027    1268
 36.       0    4304   11358       0   66701   17082    9726   25962    1448
 38.       0    1856   13735       0   39919   17192    8158   29668    1460
 40.       0     552   16050       0   25761   14868    6025   32220    1290
 42.       0     118   18689       0   23396   14172    2676   37156    1521
 44.       0      52   21706       0   23058   14410     906   45825    1983
 46.       0      44   24888       0   20402   14422     134   56059    1969
 48.       0      30   26486       0   15610   13899       0   70806    2135
 50.       0      12   24404       0   10761   12071       0   82408    2782
 52.       0       0   18021       0    6068   10398       0   90628    4458
 54.       0       0   12392       0    1745    8392       0   85502    6120
 56.       0       0    8604       0      26    7162       0   67362    6163
 58.       0       0    4937       0      46    5371       0   40318    5159
 60.       0       0    2154       0      34    4680       0   16805    3801
 62.       0       0    1245       0      64    3440       0    3784    2135
 64.       0       0    1785       0     114    2431       0     252     934
 66.       0       0    2680       0      86    1702       0     135     198
 68.       0       0    4407       0      80    1385       0     109      51
 70.       0       0    7337       0      28    1797       0      93      28
 72.       0       0   11331       0      36    3278       0      87      32
 74.       0       0   13494       0      36    5406       0      80      31
 76.       0       0   13745       0      76    7490       0      72      97
 78.       0       0   13327       0      46    9037       0      48     115
 80.       0       0   16557       0      62   11087       0      24     159
 82.       0       0   18704       0      38   13940       0      12     134
 84.       0       0   15195       0      10   16823       0       0     233
 86.       0       0    8528       0       6   16694       0       0     515
 88.       0       0    3814       0       0   15620       0       0     569
 90.       0       0    1190       0       0   12293       0       0     473
 92.       0       0     160       0       0    9804       0       0     558
 94.       0       0       0       0       0    7452       0       0     487
 96.       0       0       0       0       0    5293       0       0     237
 98.       0       0       0       0       0    3960       0       0     211
100.       0       0       0       0       0    2632       0       0     199
102.       0       0       0       0       0    1699       0       0     113
104.       0       0       0       0       0    1596       0       0      47
106.       0       0       0       0       0    1465       0       0      48
108.       0       0       0       0       0    1151       0       0      21
110.       0       0       0       0       0     908       0       0       9
112.       0       0       0       0       0     734       0       0       1
114.       0       0       0       0       0     558       0       0       1
116.       0       0       0       0       0     596       0       0       6
118.       0       0       0       0       0     499       0       0      14
120.       0       0       0       0       0     567       0       0       5
122.       0       0       0       0       0     389       0       0       1
124.       0       0       0       0       0     276       0       0       2
126.       0       0       0       0       0     262       0       0       2
128.       0       0       0       0       0     210       0       0       5
130.       0       0       0       0       0     201       0       0       1
132.       0       0       0       0       0     152       0       0       2
134.       0       0       0       0       0      89       0       0       6
136.       0       0       0       0       0      37       0       0       3
138.       0       0       0       0       0      10       0       0       3
140.       0       0       0       0       0       2       0       0       1
lost   33394  204522  473608  141894  731716  416798  249204  823316   91698
won    51926  350872  934869  222590 1398547 2816530  374947 1979539 3199113
all    54675  382725 1148175  243000 1701000 5103000  425250 2976750 8930250
The last 3 lines give the number of positions lost with the weak side to move, won with the strong side to move, and the total (including all broken and illegal). The full-defense column has a clear draw signature, with only ~1% of the positions lost. For generally won end-games this is typically around 50%. For AEE this statistic is 8%, however, and for AAE 28%, so these are neither dead draws, nor sure wins.

To get a better insight I split out the stats by Pawn rank, as it is well-known that a 9th-rank Pawn in Xiangqi is practically worthless. I counted the number of 0 codes here (draws with either side to move):

Code: Select all

Draws by Pawn rank&#58;
rank       -       E      EE       A      AE     AEE      AA     AAE    AAEE
9          4     583   86163     202  105446  480540     362  231812  843616
8          0     322    1332     162    2744  234558     378  193819  851084
7          0     626    3296     148    4828  223893     308  137534  746544
6          0     286    1198     108    1773  301109     239    3512  909646
5          0     466    2196     112    2655  353568     236    5054  861077
total  10935   76545  229635   48600  340200 1020600   85050  595350 1786050
The 'total' line gives the number of positions with the Pawn on that rank including all illegal and broken ones. Aparently even a last-rank Pawn is still useful to defeat a single Elephant (which Horse alone cannot do). KHPKAEE seems a draw no matter where the Pawn is; that the number of puredraws is only ~30% of the total number of positios is likely because so many positions are illegal or won with the strong side to move because of a hanging defender (both KHPKAE and KHPKEE seem to be general wins, so such captures are usually winning). Even against full defense only about half of the positions are not pure draws. KHPKAAE seems to be won, however, when the Paw is still in front of the Palace!

There is one caveat here: the generator is a bit pessimistic, and insists on winning without sacrifice. So as soon as the weak side captures something, (which would convert to another table), it assumes a draw. This was rigurously true when there was only a single attacker, but wrong now there are two. This for instance causes the 4 draws in KHPK, where the bare King forks a Pawn and a Horse (Ke8, Pe9, Hf8), which in reality of course are still wins, because you rescue the Horse, and KHK is a sure win. This discards winning methods where you trade the Pawn for some defenders. Against KAAE or KAEE (the only cases where this could be needed) you would have to trade it for two defenders, however, and leave no Elephants, which does seem asking for a lot. I will investigate it further, though.
User avatar
musketeerchess
Posts: 161
Joined: Sun Apr 21, 2013 2:02 pm
Location: Paris, France

Re: Xiangqi piece value model

Post by musketeerchess »

Hi
concerning the evaluation of fairy pieces, has someone heard about the work of Ralph Betza who invented many thrilling chess variants and also invented a method to evaluate fairy chess pieces in global.

Naturally, this evaluation is far from being 100% valid, but like for the classic chess pieces rule (1-3-3-5-10) this is a starting point
inventor of Musketeer Chess. A modern commercial chess variant.

www.musketeerchess.net

Pieces are available on Houseofstaunton.com or Paypal
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

Betza was a smart guy. But he did not use computers. So what he did still boils down to (perhaps very) educated guessing. Precise determination of empirical piece values through computer self-play has shown Betza's guess were often off significantly.
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

I have generated a KHPKd EGT now that also takes conversions to KHKd intoaccount. This gives the following stats draws with either side to move:

Code: Select all

Draws by Pawn rank&#58;
rank       -       E      EE       A      AE     AEE      AA     AAE    AAEE
9          0     328   76297      88    2288  358722     248  116363  734082
8          0      88     518      72    1612   64608     246   44338  569171
7          0     118    1558      84    1792   75366     244   39626  514841
6          0      66     226      96    1066    3496     221    2145  590151
5          0      98    1100     112    1548    8320     236    3569  590372
all    10935   76545  229635   48600  340200 1020600   85050  595350 1786050

none       0    3376   14251      20   19114   65893    5151   40222  118082
all     1215    8505   25515    5400   37800  113400    9450   66150  198450
Full defense is a general draw, and the right-most column shows that this results in about 1/3 of all positions being two-sided draws. (The remaining positions are illegal, broken, weak side in-check, or with a hanging piece, or otherwise non-quiet.) Generally won end-games typically have less than 1% of such two-sided draws.

From this we see that both KHPKAEE and KHPAAE are general wins when the Pawn is still in front of the Palace. When it is on 7th or 8th rank things geta little more difficult,with some 7% of two-sided draws. That is still way smaller than for a general draw, however. Against AEE it seems a draw when the Pawn is on last rank; against AAE there still are appreciable winning chances in that case.

The 'none' row is without Pawn (i.e. KHKd), and has its own totals. There only KHK and KHKA are generally won.
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

Interesting. Elephants are much more annoying defenders against Horses than I would have expected. They can throw themselves all the time in the path of the Horses, or cover the squares where the Horses want to move. And the Horses have to take care to not pass in front of their own King as well, or the enemy King would pin them, to cause further delay.

So there actually are positions where the losing King is completely trapped by Pawn and King (e.g. on e9, with Pf8 and the strong King covering the d-file), so that the Horse only has to check from c8 to checkmate, and it is just never able to get there! So that you have to switch to another mating plan. This hardly ever causes the result to change, but it significantly delays the mate.

Part of the problem is that I build the EGT with the restriction that the attacking pieces should never leave the enemy board half. That hides ways of winning where the Horse would pull back to its own half, to do its manoeuvring there, unhindred by the enemy Elephants. The requirement to stay on the enemy half is apparently a much larger handicap than I would have thought. I could extend the EGT to contain 6 or 7 ranks for the Horse location, rather than the 5 it does now. The down-side (apart from the larger size,which is hardly a problem as totally uncompressed the EGT is only 20MB) would be that the DTM in the EGT would not automatically be valid when the attacking side has extra Elephants on c4 or g4.

Probe hits into the EGT cut off the search, but a miss invokes the heuristic evaluation of the particular end-game (recognizing the drawish material combinations and the sure wins), and then searches on. The effect is that the engine will obediently shorten the DTM according to the prescription embodied in the EGT, restricting the Horse to the enemy half. But if the Horse has moves to its own half, these are searched deeper, untill the Horse returns to the enemy half, and the probes start hitting the partial EGT again. This then often finds a 'short-cut', a way to reach a position with smaller DTM in far fewer moves than needed when staying inside the EGT.

I guess I should suppress EGT probing in the first few ply of the search, to allow it to find such short-cuts even when the Horse cannot retreat to its own half in a single move, or when such a retreat would have to be prepared by moving a friendly Elephant out of the way. (Which otherwise would stay inside the EGT, so that the probe would mask the short-cut and show up as a 'no-progress' move.) A 6-ply search still takes about zero time, so I can easily suppress all EGT probing in the first 6 levels of the tree.

There might be a few positions that cannot be won by keeping the Horse on the enemy territory, but could be won on the full board. These would show up unjustly as draws in the partial EGT. I guess it would be unwise to cut off the search on a draw probe result anyway; it should strongly reduce the score, but otherwise search on, to keep doing the heuristically best moves, and hope for an opponent blunder. This would then also solve the problem for positions unjustly listed as draws: if the search would find a path outside the EGT (i.e. moving the Horse through its own territory) to re-enter the EGT in a winning positions, it would win those anyway. It would be like the engine cannot only swindle the opponent, but could also swindle the partial EGT!
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xiangqi piece value model

Post by hgm »

It seems that KHPKAAE is only won when de defending King is on the same side of the board (left-right-wise) as the Pawn, when the latter is no longer in front of the Palace. Draws occur when the King is at the far edge of the Palace, or the Pawn is on the central file inside the Palace (usually meaning it has to safe itself from capture by Elephant or Adviser by moving away from the defending King). Som samples of drawn positions:

Code: Select all

0 9 30 4 67 = 0
 . . . a . . . . .
 P . . . k . . . .
 e . . a . . . . .
 . . . H . . . . .
 . . . K . . . . .
K=0 1=9 2=30 P=67 E=4

2 25 43 6 113 = 0
 . . . k . . . . .
 . . . . . . . . .
 . . . a . a . P .
 . . . . . . . . .
 . . e . . K . H .
K=2 1=25 2=43 P=113 E=6

2 16 36 7 113 = 0
 . . . k . . . . .
 . . . . . . . P .
 . . . a . a . . .
 . . . . . . . . .
 H . . . . K e . .
K=2 1=16 2=36 P=113 E=7

2 26 32 7 119 = 0
 . . . . . . . . .
 . . . . . . . . .
 . . . a k a . . P
 . . . . . H . . .
 . . . . . K e . .
K=2 1=26 2=32 P=119 E=7

0 19 39 8 105 = 0
 . . . . . . . . .
 . . . . a . . . .
 . P . a e k . . .
 . . . . . . . . .
 . . . K . . . . .
K=0 1=19 2=39 P=105 E=8

0 11 9 7 96 = 0
 . . . . . a . . .
 H . P . . k . . .
 . . . . . a . . .
 . . . . . . . . .
 . . . K . . e . .
K=0 1=11 2=9 P=96 E=7

1 22 9 6 106 = 0
 . . . k . . . . .
 H . . . a . . . .
 . . . . P a . . .
 . . . . . . . . .
 . . e . K . . . .
K=1 1=22 2=9 P=106 E=6

0 12 0 7 103 = 0
 H . . . . . . . .
 . . . P a k . . .
 . . . a . . . . .
 . . . . . . . . .
 . . . K . . e . .
K=0 1=12 2=0 P=103 E=7

1 10 7 3 89 = 0
 . . . . . a e H .
 . P . . . k . . .
 . . . a . . . . .
 . . . . . . . . .
 . . . . K . . . .
K=1 1=10 2=7 P=89 E=3

1 13 12 4 113 = 0
 . . . k . . . . .
 . . . H P . . . .
 e . . a . a . . .
 . . . . . . . . .
 . . . . K . . . .
K=1 1=13 2=12 P=113 E=4

2 15 8 6 113 = 0
 . . . k . . . . H
 . . . . . . P . .
 . . . a . a . . .
 . . . . . . . . .
 . . e . . K . . .
K=2 1=15 2=8 P=113 E=6

1 20 41 5 105 = 0
 . . . . . . . . .
 . . . . a . . . .
 . . P a . k . . e
 . . . . . . . . .
 . . . . K H . . .
K=1 1=20 2=41 P=105 E=5

1 24 39 6 78 = 0
 . . . k . a . . .
 . . . . a . . . .
 . . . . . . P . .
 . . . . . . . . .
 . . e H K . . . .
K=1 1=24 2=39 P=78 E=6
(The capital K indicates the file of the strong King.)