summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-25 20:10:26 +0000
committerKarl Berry <karl@freefriends.org>2023-03-25 20:10:26 +0000
commitcc6da6cb3beef11b3f56f4a4e3aa33d35049a6d9 (patch)
treeb1c2aa94f6a890925272caa9d01a8813a7d4a588 /Master/texmf-dist/metapost
parentffef994ba7790a93221aec72f68c12581d96c9cb (diff)
mpchess (25mar23)
git-svn-id: svn://tug.org/texlive/trunk@66670 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess-cburnett.mp702
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess-chessboard.mp454
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess-fen.mp90
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess-pgn.mp315
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess-skak.mp385
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess-staunty.mp1066
-rw-r--r--Master/texmf-dist/metapost/mpchess/mpchess.mp994
7 files changed, 4006 insertions, 0 deletions
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess-cburnett.mp b/Master/texmf-dist/metapost/mpchess/mpchess-cburnett.mp
new file mode 100644
index 00000000000..723a0ed0f92
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess-cburnett.mp
@@ -0,0 +1,702 @@
+picture _chess_cburnett_bB;
+
+
+_chess_cburnett_bB:=image(
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+linecap := butt;
+fill (6.750000,6.750000)..controls (9.292970,7.476560) and (14.332000,6.425780)..(16.875000,8.250000)
+ ..controls (19.417999,6.425780) and (24.457001,7.476560)..(27.000000,6.750000)
+ ..controls (27.000000,6.750000) and (28.238300,6.343750)..(29.250000,5.250000)
+ ..controls (28.738300,4.523440) and (28.011700,4.507810)..(27.000000,4.875000)
+ ..controls (24.457001,5.601560) and (19.417999,4.531250)..(16.875000,5.625000)
+ ..controls (14.332000,4.531250) and (9.292970,5.601560)..(6.750000,4.875000)
+ ..controls (5.734380,4.507810) and (5.007810,4.523440)..(4.500000,5.250000)
+ ..controls (5.515630,6.703130) and (6.750000,6.750000)..(6.750000,6.750000)
+ --cycle;
+fill (6.750000,6.750000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,6.750000)..controls (9.292970,7.476560) and (14.332000,6.425780)..(16.875000,8.250000)
+ ..controls (19.417999,6.425780) and (24.457001,7.476560)..(27.000000,6.750000)
+ ..controls (27.000000,6.750000) and (28.238300,6.343750)..(29.250000,5.250000)
+ ..controls (28.738300,4.523440) and (28.011700,4.507810)..(27.000000,4.875000)
+ ..controls (24.457001,5.601560) and (19.417999,4.531250)..(16.875000,5.625000)
+ ..controls (14.332000,4.531250) and (9.292970,5.601560)..(6.750000,4.875000)
+ ..controls (5.734380,4.507810) and (5.007810,4.523440)..(4.500000,5.250000)
+ ..controls (5.515630,6.703130) and (6.750000,6.750000)..(6.750000,6.750000)
+ --cycle;
+draw (6.750000,6.750000);
+pickup pencircle scaled 0.000000bp;
+fill (11.250000,9.750000)..controls (13.125000,7.875000) and (20.625000,7.875000)..(22.500000,9.750000)
+ ..controls (22.875000,10.875000) and (22.500000,11.250000)..(22.500000,11.250000)
+ ..controls (22.500000,13.125000) and (20.625000,14.250000)..(20.625000,14.250000)
+ ..controls (24.750000,15.375000) and (25.125000,22.875000)..(16.875000,25.875000)
+ ..controls (8.625000,22.875000) and (9.000000,15.375000)..(13.125000,14.250000)
+ ..controls (13.125000,14.250000) and (11.250000,13.125000)..(11.250000,11.250000)
+ ..controls (11.250000,11.250000) and (10.875000,10.875000)..(11.250000,9.750000)
+ --cycle;
+fill (11.250000,9.750000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (11.250000,9.750000)..controls (13.125000,7.875000) and (20.625000,7.875000)..(22.500000,9.750000)
+ ..controls (22.875000,10.875000) and (22.500000,11.250000)..(22.500000,11.250000)
+ ..controls (22.500000,13.125000) and (20.625000,14.250000)..(20.625000,14.250000)
+ ..controls (24.750000,15.375000) and (25.125000,22.875000)..(16.875000,25.875000)
+ ..controls (8.625000,22.875000) and (9.000000,15.375000)..(13.125000,14.250000)
+ ..controls (13.125000,14.250000) and (11.250000,13.125000)..(11.250000,11.250000)
+ ..controls (11.250000,11.250000) and (10.875000,10.875000)..(11.250000,9.750000)
+ --cycle;
+draw (11.250000,9.750000);
+pickup pencircle scaled 0.000000bp;
+fill (18.750000,27.750000)..controls (18.750000,25.250000) and (15.000000,25.250000)..(15.000000,27.750000)
+ ..controls (15.000000,30.250000) and (18.750000,30.250000)..(18.750000,27.750000)
+ --cycle;
+fill (18.750000,27.750000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (18.750000,27.750000)..controls (18.750000,25.250000) and (15.000000,25.250000)..(15.000000,27.750000)
+ ..controls (15.000000,30.250000) and (18.750000,30.250000)..(18.750000,27.750000)
+ --cycle;
+draw (18.750000,27.750000);
+drawoptions (withcolor (0.925490,0.925490,0.925490));
+linecap := rounded;
+linejoin := mitered;
+draw (13.125000,14.250000)--(20.625000,14.250000);
+draw (11.250000,11.250000)--(22.500000,11.250000);
+draw (16.875000,22.125000)--(16.875000,18.375000);
+draw (15.000000,20.250000)--(18.750000,20.250000);
+);
+
+picture _chess_cburnett_bK;
+
+_chess_cburnett_bK := image(
+ drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+linejoin := mitered;
+draw (16.875000,25.027300)--(16.875000,29.250000);
+pickup pencircle scaled 0.000000bp;
+linecap := butt;
+fill (16.875000,15.000000)..controls (16.875000,15.000000) and (20.250000,20.625000)..(19.125000,22.875000)
+ ..controls (19.125000,22.875000) and (18.375000,24.750000)..(16.875000,24.750000)
+ ..controls (15.375000,24.750000) and (14.625000,22.875000)..(14.625000,22.875000)
+ ..controls (13.500000,20.625000) and (16.875000,15.000000)..(16.875000,15.000000)
+ --cycle;
+pickup pencircle scaled 1.125000bp;
+draw (16.875000,15.000000)..controls (16.875000,15.000000) and (20.250000,20.625000)..(19.125000,22.875000)
+ ..controls (19.125000,22.875000) and (18.375000,24.750000)..(16.875000,24.750000)
+ ..controls (15.375000,24.750000) and (14.625000,22.875000)..(14.625000,22.875000)
+ ..controls (13.500000,20.625000) and (16.875000,15.000000)..(16.875000,15.000000);
+pickup pencircle scaled 0.000000bp;
+linecap := rounded;
+linejoin := rounded;
+fill (8.625000,6.000000)..controls (12.750000,3.375000) and (20.250000,3.375000)..(24.375000,6.000000)
+ --(24.375000,11.250000)..controls (24.375000,11.250000) and (31.125000,14.625000)..(28.875000,19.125000)
+ ..controls (25.875000,24.000000) and (18.750000,21.750000)..(16.875000,16.125000)
+ --(16.875000,13.500000)--(16.875000,16.125000)..controls (14.250000,21.750000) and (7.125000,24.000000)..(4.875000,19.125000)
+ ..controls (2.625000,14.625000) and (8.625000,11.625000)..(8.625000,11.625000)
+ --cycle;
+fill (8.625000,6.000000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (8.625000,6.000000)..controls (12.750000,3.375000) and (20.250000,3.375000)..(24.375000,6.000000)
+ --(24.375000,11.250000)..controls (24.375000,11.250000) and (31.125000,14.625000)..(28.875000,19.125000)
+ ..controls (25.875000,24.000000) and (18.750000,21.750000)..(16.875000,16.125000)
+ --(16.875000,13.500000)--(16.875000,16.125000)..controls (14.250000,21.750000) and (7.125000,24.000000)..(4.875000,19.125000)
+ ..controls (2.625000,14.625000) and (8.625000,11.625000)..(8.625000,11.625000)
+ --cycle;
+draw (8.625000,6.000000);
+linejoin := mitered;
+draw (15.000000,27.750000)--(18.750000,27.750000);
+drawoptions (withcolor (0.925490,0.925490,0.925490));
+linejoin := rounded;
+draw (24.000000,11.625000)..controls (24.000000,11.625000) and (30.375000,14.625000)..(28.523399,18.863300)
+ ..controls (25.613300,23.250000) and (18.750000,20.250000)..(16.875000,15.375000)
+ --(16.882799,13.800800)--(16.875000,15.375000)..controls (15.000000,20.250000) and (7.429690,23.250000)..(5.246090,18.863300)
+ ..controls (3.375000,14.625000) and (8.886720,12.113300)..(8.886720,12.113300);
+draw (8.625000,11.250000)..controls (12.750000,13.500000) and (20.250000,13.500000)..(24.375000,11.250000);
+draw (8.625000,8.625000)..controls (12.750000,10.875000) and (20.250000,10.875000)..(24.375000,8.625000);
+draw (8.625000,6.000000)..controls (12.750000,8.250000) and (20.250000,8.250000)..(24.375000,6.000000);
+);
+
+picture _chess_cburnett_bN;
+
+_chess_cburnett_bN:=image(
+ drawoptions (withcolor (0.000000,0.000000,0.000000));
+ fill (16.500000,26.250000)..controls (24.375000,25.500000) and (28.875000,20.250000)..(28.500000,4.500000)
+ --(11.250000,4.500000)..controls (11.250000,11.250000) and (18.750000,9.375000)..(17.250000,20.250000)
+ --cycle;
+pickup pencircle scaled 1.125000bp;
+draw (16.500000,26.250000)..controls (24.375000,25.500000) and (28.875000,20.250000)..(28.500000,4.500000)
+ --(11.250000,4.500000)..controls (11.250000,11.250000) and (18.750000,9.375000)..(17.250000,20.250000);
+pickup pencircle scaled 0.000000bp;
+fill (18.000000,20.250000)..controls (18.285200,18.066401) and (13.835900,14.722700)..(12.000000,13.500000)
+ ..controls (9.750000,12.000000) and (9.886720,10.246100)..(8.250000,10.500000)
+ ..controls (7.468750,11.203100) and (9.308590,12.781300)..(8.250000,12.750000)
+ ..controls (7.500000,12.750000) and (8.390630,11.828100)..(7.500000,11.250000)
+ ..controls (6.750000,11.250000) and (4.496090,10.500000)..(4.500000,14.250000)
+ ..controls (4.500000,15.750000) and (9.000000,23.250000)..(9.000000,23.250000)
+ ..controls (9.000000,23.250000) and (10.418000,24.675800)..(10.500000,25.875000)
+ ..controls (9.953130,26.621099) and (10.125000,27.375000)..(10.125000,28.125000)
+ ..controls (10.875000,28.875000) and (12.375000,26.250000)..(12.375000,26.250000)
+ --(13.875000,26.250000)..controls (13.875000,26.250000) and (14.460900,27.742201)..(15.750000,28.500000)
+ ..controls (16.500000,28.500000) and (16.500000,26.250000)..(16.500000,26.250000)
+ --cycle;
+pickup pencircle scaled 1.125000bp;
+draw (18.000000,20.250000)..controls (18.285200,18.066401) and (13.835900,14.722700)..(12.000000,13.500000)
+ ..controls (9.750000,12.000000) and (9.886720,10.246100)..(8.250000,10.500000)
+ ..controls (7.468750,11.203100) and (9.308590,12.781300)..(8.250000,12.750000)
+ ..controls (7.500000,12.750000) and (8.390630,11.828100)..(7.500000,11.250000)
+ ..controls (6.750000,11.250000) and (4.496090,10.500000)..(4.500000,14.250000)
+ ..controls (4.500000,15.750000) and (9.000000,23.250000)..(9.000000,23.250000)
+ ..controls (9.000000,23.250000) and (10.418000,24.675800)..(10.500000,25.875000)
+ ..controls (9.953130,26.621099) and (10.125000,27.375000)..(10.125000,28.125000)
+ ..controls (10.875000,28.875000) and (12.375000,26.250000)..(12.375000,26.250000)
+ --(13.875000,26.250000)..controls (13.875000,26.250000) and (14.460900,27.742201)..(15.750000,28.500000)
+ ..controls (16.500000,28.500000) and (16.500000,26.250000)..(16.500000,26.250000);
+drawoptions (withcolor (0.925490,0.925490,0.925490));
+pickup pencircle scaled 0.000000bp;
+fill (7.125000,14.625000)..controls (7.125000,14.125000) and (6.375000,14.125000)..(6.375000,14.625000)
+ ..controls (6.375000,15.125000) and (7.125000,15.125000)..(7.125000,14.625000)
+ --cycle;
+fill (11.199200,21.937500)..controls (10.890600,21.394501) and (10.488300,21.039101)..(10.308600,21.144501)
+ ..controls (10.128900,21.250000) and (10.238300,21.773399)..(10.550800,22.312500)
+ ..controls (10.859400,22.855499) and (11.261700,23.210899)..(11.441400,23.105499)
+ ..controls (11.621100,23.000000) and (11.511700,22.476601)..(11.199200,21.937500)
+ --cycle;
+fill (11.199200,21.937500)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (7.125000,14.625000)..controls (7.125000,14.125000) and (6.375000,14.125000)..(6.375000,14.625000)
+ ..controls (6.375000,15.125000) and (7.125000,15.125000)..(7.125000,14.625000)
+ --cycle;
+draw (11.199200,21.937500)..controls (10.890600,21.394501) and (10.488300,21.039101)..(10.308600,21.144501)
+ ..controls (10.128900,21.250000) and (10.238300,21.773399)..(10.550800,22.312500)
+ ..controls (10.859400,22.855499) and (11.261700,23.210899)..(11.441400,23.105499)
+ ..controls (11.621100,23.000000) and (11.511700,22.476601)..(11.199200,21.937500)
+ --cycle;
+draw (11.199200,21.937500);
+pickup pencircle scaled 0.000000bp;
+fill (18.414101,25.949200)--(18.074200,24.863300)--(18.449200,24.750000)
+ ..controls (20.812500,24.000000) and (22.687500,22.882799)..(24.375000,19.687500)
+ ..controls (26.062500,16.492201) and (26.812500,11.953100)..(26.437500,4.500000)
+ --(26.398399,4.125000)--(28.085899,4.125000)--(28.125000,4.500000)
+ ..controls (28.500000,12.046900) and (27.464800,17.136700)..(25.687500,20.503901)
+ ..controls (23.910200,23.871099) and (21.343800,25.484400)..(18.796900,25.875000)
+ --cycle;
+fill (18.414101,25.949200)--cycle;
+);
+
+picture _chess_cburnett_bP;
+_chess_cburnett_bP:=image(
+ drawoptions (withcolor (0.000000,0.000000,0.000000));
+linejoin := mitered;
+fill (16.875000,27.000000)..controls (15.218800,27.000000) and (13.875000,25.656300)..(13.875000,24.000000)
+ ..controls (13.875000,23.332001) and (14.093800,22.718800)..(14.460900,22.214800)
+ ..controls (12.996100,21.375000) and (12.000000,19.808599)..(12.000000,18.000000)
+ ..controls (12.000000,16.476601) and (12.703100,15.121100)..(13.808600,14.226600)
+ ..controls (11.558600,13.433600) and (8.250000,10.066400)..(8.250000,4.125000)
+ --(25.500000,4.125000)..controls (25.500000,10.066400) and (22.191401,13.433600)..(19.941401,14.226600)
+ ..controls (21.046900,15.121100) and (21.750000,16.476601)..(21.750000,18.000000)
+ ..controls (21.750000,19.808599) and (20.753901,21.375000)..(19.289101,22.214800)
+ ..controls (19.656300,22.718800) and (19.875000,23.332001)..(19.875000,24.000000)
+ ..controls (19.875000,25.656300) and (18.531300,27.000000)..(16.875000,27.000000)
+ --cycle;
+fill (16.875000,27.000000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (16.875000,27.000000)..controls (15.218800,27.000000) and (13.875000,25.656300)..(13.875000,24.000000)
+ ..controls (13.875000,23.332001) and (14.093800,22.718800)..(14.460900,22.214800)
+ ..controls (12.996100,21.375000) and (12.000000,19.808599)..(12.000000,18.000000)
+ ..controls (12.000000,16.476601) and (12.703100,15.121100)..(13.808600,14.226600)
+ ..controls (11.558600,13.433600) and (8.250000,10.066400)..(8.250000,4.125000)
+ --(25.500000,4.125000)..controls (25.500000,10.066400) and (22.191401,13.433600)..(19.941401,14.226600)
+ ..controls (21.046900,15.121100) and (21.750000,16.476601)..(21.750000,18.000000)
+ ..controls (21.750000,19.808599) and (20.753901,21.375000)..(19.289101,22.214800)
+ ..controls (19.656300,22.718800) and (19.875000,23.332001)..(19.875000,24.000000)
+ ..controls (19.875000,25.656300) and (18.531300,27.000000)..(16.875000,27.000000)
+ --cycle;
+draw (16.875000,27.000000);
+);
+
+picture _chess_cburnett_bQ;
+
+_chess_cburnett_bQ:=image(
+linecap := butt;
+linejoin := mitered;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+fill (6.562500,24.750000)..controls (6.562500,23.609400) and (5.640630,22.687500)..(4.500000,22.687500)
+ ..controls (3.359380,22.687500) and (2.437500,23.609400)..(2.437500,24.750000)
+ ..controls (2.437500,25.890600) and (3.359380,26.812500)..(4.500000,26.812500)
+ ..controls (5.640630,26.812500) and (6.562500,25.890600)..(6.562500,24.750000)
+ --cycle;
+fill (6.562500,24.750000)--cycle;
+fill (12.562500,27.000000)..controls (12.562500,25.859400) and (11.640600,24.937500)..(10.500000,24.937500)
+ ..controls (9.359380,24.937500) and (8.437500,25.859400)..(8.437500,27.000000)
+ ..controls (8.437500,28.140600) and (9.359380,29.062500)..(10.500000,29.062500)
+ ..controls (11.640600,29.062500) and (12.562500,28.140600)..(12.562500,27.000000)
+ --cycle;
+fill (12.562500,27.000000)--cycle;
+fill (18.937500,27.750000)..controls (18.937500,26.609400) and (18.015600,25.687500)..(16.875000,25.687500)
+ ..controls (15.734400,25.687500) and (14.812500,26.609400)..(14.812500,27.750000)
+ ..controls (14.812500,28.890600) and (15.734400,29.812500)..(16.875000,29.812500)
+ ..controls (18.015600,29.812500) and (18.937500,28.890600)..(18.937500,27.750000)
+ --cycle;
+fill (18.937500,27.750000)--cycle;
+fill (25.312500,27.000000)..controls (25.312500,25.859400) and (24.390600,24.937500)..(23.250000,24.937500)
+ ..controls (22.109400,24.937500) and (21.187500,25.859400)..(21.187500,27.000000)
+ ..controls (21.187500,28.140600) and (22.109400,29.062500)..(23.250000,29.062500)
+ ..controls (24.390600,29.062500) and (25.312500,28.140600)..(25.312500,27.000000)
+ --cycle;
+fill (25.312500,27.000000)--cycle;
+fill (31.312500,24.750000)..controls (31.312500,23.609400) and (30.390600,22.687500)..(29.250000,22.687500)
+ ..controls (28.109400,22.687500) and (27.187500,23.609400)..(27.187500,24.750000)
+ ..controls (27.187500,25.890600) and (28.109400,26.812500)..(29.250000,26.812500)
+ ..controls (30.390600,26.812500) and (31.312500,25.890600)..(31.312500,24.750000)
+ --cycle;
+fill (31.312500,24.750000)--cycle;
+linejoin := rounded;
+fill (6.750000,14.250000)..controls (13.125000,15.375000) and (22.500000,15.375000)..(27.000000,14.250000)
+ --(28.875000,23.625000)--(23.250000,15.000000)--(23.023399,25.574200)
+ --(19.125000,15.375000)--(16.875000,26.250000)--(14.625000,15.375000)
+ --(10.726600,25.574200)--(10.500000,15.000000)--(4.875000,23.625000)
+ --cycle;
+fill (6.750000,14.250000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,14.250000)..controls (13.125000,15.375000) and (22.500000,15.375000)..(27.000000,14.250000)
+ --(28.875000,23.625000)--(23.250000,15.000000)--(23.023399,25.574200)
+ --(19.125000,15.375000)--(16.875000,26.250000)--(14.625000,15.375000)
+ --(10.726600,25.574200)--(10.500000,15.000000)--(4.875000,23.625000)
+ --cycle;
+draw (6.750000,14.250000);
+pickup pencircle scaled 0.000000bp;
+fill (6.750000,14.250000)..controls (6.750000,12.750000) and (7.875000,12.750000)..(8.625000,11.250000)
+ ..controls (9.375000,10.125000) and (9.375000,10.500000)..(9.000000,8.625000)
+ ..controls (7.875000,7.875000) and (7.875000,6.750000)..(7.875000,6.750000)
+ ..controls (6.750000,5.625000) and (8.250000,4.875000)..(8.250000,4.875000)
+ ..controls (13.125000,4.125000) and (20.625000,4.125000)..(25.500000,4.875000)
+ ..controls (25.500000,4.875000) and (26.625000,5.625000)..(25.500000,6.750000)
+ ..controls (25.500000,6.750000) and (25.875000,7.875000)..(24.750000,8.625000)
+ ..controls (24.375000,10.500000) and (24.375000,10.125000)..(25.125000,11.250000)
+ ..controls (25.875000,12.750000) and (27.000000,12.750000)..(27.000000,14.250000)
+ ..controls (20.625000,15.375000) and (13.125000,15.375000)..(6.750000,14.250000)
+ --cycle;
+fill (6.750000,14.250000)--cycle;
+pickup pencircle scaled 1.125000bp;
+
+draw (6.750000,14.250000)..controls (6.750000,12.750000) and (7.875000,12.750000)..(8.625000,11.250000)
+ ..controls (9.375000,10.125000) and (9.375000,10.500000)..(9.000000,8.625000)
+ ..controls (7.875000,7.875000) and (7.875000,6.750000)..(7.875000,6.750000)
+ ..controls (6.750000,5.625000) and (8.250000,4.875000)..(8.250000,4.875000)
+ ..controls (13.125000,4.125000) and (20.625000,4.125000)..(25.500000,4.875000)
+ ..controls (25.500000,4.875000) and (26.625000,5.625000)..(25.500000,6.750000)
+ ..controls (25.500000,6.750000) and (25.875000,7.875000)..(24.750000,8.625000)
+ ..controls (24.375000,10.500000) and (24.375000,10.125000)..(25.125000,11.250000)
+ ..controls (25.875000,12.750000) and (27.000000,12.750000)..(27.000000,14.250000)
+ ..controls (20.625000,15.375000) and (13.125000,15.375000)..(6.750000,14.250000)
+ --cycle;
+draw (6.750000,14.250000);
+draw (8.250000,4.875000)..controls (13.835900,2.933590) and (19.914101,2.933590)..(25.500000,4.875000);
+drawoptions (withcolor (0.925490,0.925490,0.925490));
+linecap := rounded;
+draw (8.250000,12.000000)..controls (13.835900,13.941400) and (19.914101,13.941400)..(25.500000,12.000000);
+draw (9.375000,10.125000)--(24.375000,10.125000);
+draw (8.625000,7.875000)..controls (13.980500,6.101560) and (19.769501,6.101560)..(25.125000,7.875000);
+draw (7.875000,5.625000)..controls (13.687500,3.503910) and (20.062500,3.503910)..(25.875000,5.625000);
+);
+
+picture _chess_cburnett_bR;
+_chess_cburnett_bR:=image(
+ drawoptions (withcolor (0.000000,0.000000,0.000000));
+linecap := butt;
+fill (6.750000,4.500000)--(27.000000,4.500000)--(27.000000,6.750000)
+ --(6.750000,6.750000)--cycle;
+fill (9.375000,9.750000)--(10.500000,11.625000)--(23.250000,11.625000)
+ --(24.375000,9.750000)--cycle;
+fill (9.000000,6.750000)--(9.000000,9.750000)--(24.750000,9.750000)
+ --(24.750000,6.750000)--cycle;
+fill (9.000000,6.750000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,4.500000)--(27.000000,4.500000)--(27.000000,6.750000)
+ --(6.750000,6.750000)--cycle;
+draw (9.375000,9.750000)--(10.500000,11.625000)--(23.250000,11.625000)
+ --(24.375000,9.750000)--cycle;
+draw (9.000000,6.750000)--(9.000000,9.750000)--(24.750000,9.750000)
+ --(24.750000,6.750000)--cycle;
+draw (9.000000,6.750000);
+pickup pencircle scaled 0.000000bp;
+linejoin := mitered;
+fill (10.500000,21.375000)--(23.250000,21.375000)--(23.250000,11.625000)
+ --(10.500000,11.625000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (10.500000,21.375000)--(23.250000,21.375000)--(23.250000,11.625000)
+ --(10.500000,11.625000)--cycle;
+pickup pencircle scaled 0.000000bp;
+linejoin := rounded;
+fill (10.500000,21.375000)--(8.250000,23.250000)--(25.500000,23.250000)
+ --(23.250000,21.375000)--cycle;
+fill (8.250000,23.250000)--(8.250000,27.000000)--(11.250000,27.000000)
+ --(11.250000,25.500000)--(15.000000,25.500000)--(15.000000,27.000000)
+ --(18.750000,27.000000)--(18.750000,25.500000)--(22.500000,25.500000)
+ --(22.500000,27.000000)--(25.500000,27.000000)--(25.500000,23.250000)
+ --cycle;
+fill (8.250000,23.250000)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (10.500000,21.375000)--(8.250000,23.250000)--(25.500000,23.250000)
+ --(23.250000,21.375000)--cycle;
+draw (8.250000,23.250000)--(8.250000,27.000000)--(11.250000,27.000000)
+ --(11.250000,25.500000)--(15.000000,25.500000)--(15.000000,27.000000)
+ --(18.750000,27.000000)--(18.750000,25.500000)--(22.500000,25.500000)
+ --(22.500000,27.000000)--(25.500000,27.000000)--(25.500000,23.250000)
+ --cycle;
+draw (8.250000,23.250000);
+drawoptions (withcolor (0.925490,0.925490,0.925490));
+pickup pencircle scaled 0.750000bp;
+linecap := rounded;
+linejoin := mitered;
+draw (9.000000,7.125000)--(24.750000,7.125000);
+draw (9.750000,10.125000)--(24.000000,10.125000);
+draw (10.500000,11.625000)--(23.250000,11.625000);
+draw (10.500000,21.375000)--(23.250000,21.375000);
+draw (8.250000,23.250000)--(25.500000,23.250000);
+);
+
+picture _chess_cburnett_wB;
+_chess_cburnett_wB:= image(
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+linecap := butt;
+fill (6.750000,6.750000)..controls (9.292970,7.476560) and (14.332000,6.425780)..(16.875000,8.250000)
+ ..controls (19.417999,6.425780) and (24.457001,7.476560)..(27.000000,6.750000)
+ ..controls (27.000000,6.750000) and (28.238300,6.343750)..(29.250000,5.250000)
+ ..controls (28.738300,4.523440) and (28.011700,4.507810)..(27.000000,4.875000)
+ ..controls (24.457001,5.601560) and (19.417999,4.531250)..(16.875000,5.625000)
+ ..controls (14.332000,4.531250) and (9.292970,5.601560)..(6.750000,4.875000)
+ ..controls (5.734380,4.507810) and (5.007810,4.523440)..(4.500000,5.250000)
+ ..controls (5.515630,6.703130) and (6.750000,6.750000)..(6.750000,6.750000)
+ --cycle;
+fill (6.750000,6.750000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,6.750000)..controls (9.292970,7.476560) and (14.332000,6.425780)..(16.875000,8.250000)
+ ..controls (19.417999,6.425780) and (24.457001,7.476560)..(27.000000,6.750000)
+ ..controls (27.000000,6.750000) and (28.238300,6.343750)..(29.250000,5.250000)
+ ..controls (28.738300,4.523440) and (28.011700,4.507810)..(27.000000,4.875000)
+ ..controls (24.457001,5.601560) and (19.417999,4.531250)..(16.875000,5.625000)
+ ..controls (14.332000,4.531250) and (9.292970,5.601560)..(6.750000,4.875000)
+ ..controls (5.734380,4.507810) and (5.007810,4.523440)..(4.500000,5.250000)
+ ..controls (5.515630,6.703130) and (6.750000,6.750000)..(6.750000,6.750000)
+ --cycle;
+draw (6.750000,6.750000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+fill (11.250000,9.750000)..controls (13.125000,7.875000) and (20.625000,7.875000)..(22.500000,9.750000)
+ ..controls (22.875000,10.875000) and (22.500000,11.250000)..(22.500000,11.250000)
+ ..controls (22.500000,13.125000) and (20.625000,14.250000)..(20.625000,14.250000)
+ ..controls (24.750000,15.375000) and (25.125000,22.875000)..(16.875000,25.875000)
+ ..controls (8.625000,22.875000) and (9.000000,15.375000)..(13.125000,14.250000)
+ ..controls (13.125000,14.250000) and (11.250000,13.125000)..(11.250000,11.250000)
+ ..controls (11.250000,11.250000) and (10.875000,10.875000)..(11.250000,9.750000)
+ --cycle;
+fill (11.250000,9.750000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (11.250000,9.750000)..controls (13.125000,7.875000) and (20.625000,7.875000)..(22.500000,9.750000)
+ ..controls (22.875000,10.875000) and (22.500000,11.250000)..(22.500000,11.250000)
+ ..controls (22.500000,13.125000) and (20.625000,14.250000)..(20.625000,14.250000)
+ ..controls (24.750000,15.375000) and (25.125000,22.875000)..(16.875000,25.875000)
+ ..controls (8.625000,22.875000) and (9.000000,15.375000)..(13.125000,14.250000)
+ ..controls (13.125000,14.250000) and (11.250000,13.125000)..(11.250000,11.250000)
+ ..controls (11.250000,11.250000) and (10.875000,10.875000)..(11.250000,9.750000)
+ --cycle;
+draw (11.250000,9.750000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+fill (18.750000,27.750000)..controls (18.750000,25.250000) and (15.000000,25.250000)..(15.000000,27.750000)
+ ..controls (15.000000,30.250000) and (18.750000,30.250000)..(18.750000,27.750000)
+ --cycle;
+fill (18.750000,27.750000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (18.750000,27.750000)..controls (18.750000,25.250000) and (15.000000,25.250000)..(15.000000,27.750000)
+ ..controls (15.000000,30.250000) and (18.750000,30.250000)..(18.750000,27.750000)
+ --cycle;
+draw (18.750000,27.750000);
+linecap := rounded;
+linejoin := mitered;
+draw (13.125000,14.250000)--(20.625000,14.250000);
+draw (11.250000,11.250000)--(22.500000,11.250000);
+draw (16.875000,22.125000)--(16.875000,18.375000);
+draw (15.000000,20.250000)--(18.750000,20.250000);
+);
+
+picture _chess_cburnett_wK;
+_chess_cburnett_wK:=image(
+ pickup pencircle scaled 1.125000bp;
+linejoin := mitered;
+draw (16.875000,25.027300)--(16.875000,29.250000);
+draw (15.000000,27.750000)--(18.750000,27.750000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+linecap := butt;
+fill (16.875000,15.000000)..controls (16.875000,15.000000) and (20.250000,20.625000)..(19.125000,22.875000)
+ ..controls (19.125000,22.875000) and (18.375000,24.750000)..(16.875000,24.750000)
+ ..controls (15.375000,24.750000) and (14.625000,22.875000)..(14.625000,22.875000)
+ ..controls (13.500000,20.625000) and (16.875000,15.000000)..(16.875000,15.000000)
+ --cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (16.875000,15.000000)..controls (16.875000,15.000000) and (20.250000,20.625000)..(19.125000,22.875000)
+ ..controls (19.125000,22.875000) and (18.375000,24.750000)..(16.875000,24.750000)
+ ..controls (15.375000,24.750000) and (14.625000,22.875000)..(14.625000,22.875000)
+ ..controls (13.500000,20.625000) and (16.875000,15.000000)..(16.875000,15.000000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+linecap := rounded;
+linejoin := rounded;
+fill (8.625000,6.000000)..controls (12.750000,3.375000) and (20.250000,3.375000)..(24.375000,6.000000)
+ --(24.375000,11.250000)..controls (24.375000,11.250000) and (31.125000,14.625000)..(28.875000,19.125000)
+ ..controls (25.875000,24.000000) and (18.750000,21.750000)..(16.875000,16.125000)
+ --(16.875000,13.500000)--(16.875000,16.125000)..controls (14.250000,21.750000) and (7.125000,24.000000)..(4.875000,19.125000)
+ ..controls (2.625000,14.625000) and (8.625000,11.625000)..(8.625000,11.625000)
+ --cycle;
+fill (8.625000,6.000000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (8.625000,6.000000)..controls (12.750000,3.375000) and (20.250000,3.375000)..(24.375000,6.000000)
+ --(24.375000,11.250000)..controls (24.375000,11.250000) and (31.125000,14.625000)..(28.875000,19.125000)
+ ..controls (25.875000,24.000000) and (18.750000,21.750000)..(16.875000,16.125000)
+ --(16.875000,13.500000)--(16.875000,16.125000)..controls (14.250000,21.750000) and (7.125000,24.000000)..(4.875000,19.125000)
+ ..controls (2.625000,14.625000) and (8.625000,11.625000)..(8.625000,11.625000)
+ --cycle;
+draw (8.625000,6.000000);
+draw (8.625000,11.250000)..controls (12.750000,13.500000) and (20.250000,13.500000)..(24.375000,11.250000);
+draw (8.625000,8.625000)..controls (12.750000,10.875000) and (20.250000,10.875000)..(24.375000,8.625000);
+draw (8.625000,6.000000)..controls (12.750000,8.250000) and (20.250000,8.250000)..(24.375000,6.000000);
+);
+
+picture _chess_cburnett_wN;
+_chess_cburnett_wN:=image(
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+fill (16.500000,26.250000)..controls (24.375000,25.500000) and (28.875000,20.250000)..(28.500000,4.500000)
+ --(11.250000,4.500000)..controls (11.250000,11.250000) and (18.750000,9.375000)..(17.250000,20.250000)
+ --cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (16.500000,26.250000)..controls (24.375000,25.500000) and (28.875000,20.250000)..(28.500000,4.500000)
+ --(11.250000,4.500000)..controls (11.250000,11.250000) and (18.750000,9.375000)..(17.250000,20.250000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+fill (18.000000,20.250000)..controls (18.285200,18.066401) and (13.835900,14.722700)..(12.000000,13.500000)
+ ..controls (9.750000,12.000000) and (9.886720,10.246100)..(8.250000,10.500000)
+ ..controls (7.468750,11.203100) and (9.308590,12.781300)..(8.250000,12.750000)
+ ..controls (7.500000,12.750000) and (8.390630,11.828100)..(7.500000,11.250000)
+ ..controls (6.750000,11.250000) and (4.496090,10.500000)..(4.500000,14.250000)
+ ..controls (4.500000,15.750000) and (9.000000,23.250000)..(9.000000,23.250000)
+ ..controls (9.000000,23.250000) and (10.418000,24.675800)..(10.500000,25.875000)
+ ..controls (9.953130,26.621099) and (10.125000,27.375000)..(10.125000,28.125000)
+ ..controls (10.875000,28.875000) and (12.375000,26.250000)..(12.375000,26.250000)
+ --(13.875000,26.250000)..controls (13.875000,26.250000) and (14.460900,27.742201)..(15.750000,28.500000)
+ ..controls (16.500000,28.500000) and (16.500000,26.250000)..(16.500000,26.250000)
+ --cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (18.000000,20.250000)..controls (18.285200,18.066401) and (13.835900,14.722700)..(12.000000,13.500000)
+ ..controls (9.750000,12.000000) and (9.886720,10.246100)..(8.250000,10.500000)
+ ..controls (7.468750,11.203100) and (9.308590,12.781300)..(8.250000,12.750000)
+ ..controls (7.500000,12.750000) and (8.390630,11.828100)..(7.500000,11.250000)
+ ..controls (6.750000,11.250000) and (4.496090,10.500000)..(4.500000,14.250000)
+ ..controls (4.500000,15.750000) and (9.000000,23.250000)..(9.000000,23.250000)
+ ..controls (9.000000,23.250000) and (10.418000,24.675800)..(10.500000,25.875000)
+ ..controls (9.953130,26.621099) and (10.125000,27.375000)..(10.125000,28.125000)
+ ..controls (10.875000,28.875000) and (12.375000,26.250000)..(12.375000,26.250000)
+ --(13.875000,26.250000)..controls (13.875000,26.250000) and (14.460900,27.742201)..(15.750000,28.500000)
+ ..controls (16.500000,28.500000) and (16.500000,26.250000)..(16.500000,26.250000);
+pickup pencircle scaled 0.000000bp;
+fill (7.125000,14.625000)..controls (7.125000,14.125000) and (6.375000,14.125000)..(6.375000,14.625000)
+ ..controls (6.375000,15.125000) and (7.125000,15.125000)..(7.125000,14.625000)
+ --cycle;
+fill (11.199200,21.937500)..controls (10.890600,21.394501) and (10.488300,21.039101)..(10.308600,21.144501)
+ ..controls (10.128900,21.250000) and (10.238300,21.773399)..(10.550800,22.312500)
+ ..controls (10.859400,22.855499) and (11.261700,23.210899)..(11.441400,23.105499)
+ ..controls (11.621100,23.000000) and (11.511700,22.476601)..(11.199200,21.937500)
+ --cycle;
+fill (11.199200,21.937500)--cycle;
+pickup pencircle scaled 1.125000bp;
+draw (7.125000,14.625000)..controls (7.125000,14.125000) and (6.375000,14.125000)..(6.375000,14.625000)
+ ..controls (6.375000,15.125000) and (7.125000,15.125000)..(7.125000,14.625000)
+ --cycle;
+draw (11.199200,21.937500)..controls (10.890600,21.394501) and (10.488300,21.039101)..(10.308600,21.144501)
+ ..controls (10.128900,21.250000) and (10.238300,21.773399)..(10.550800,22.312500)
+ ..controls (10.859400,22.855499) and (11.261700,23.210899)..(11.441400,23.105499)
+ ..controls (11.621100,23.000000) and (11.511700,22.476601)..(11.199200,21.937500)
+ --cycle;
+draw (11.199200,21.937500);
+);
+
+picture _chess_cburnett_wP;
+_chess_cburnett_wP:=image(
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+linejoin := mitered;
+fill (16.875000,27.000000)..controls (15.218800,27.000000) and (13.875000,25.656300)..(13.875000,24.000000)
+ ..controls (13.875000,23.332001) and (14.093800,22.718800)..(14.460900,22.214800)
+ ..controls (12.996100,21.375000) and (12.000000,19.808599)..(12.000000,18.000000)
+ ..controls (12.000000,16.476601) and (12.703100,15.121100)..(13.808600,14.226600)
+ ..controls (11.558600,13.433600) and (8.250000,10.066400)..(8.250000,4.125000)
+ --(25.500000,4.125000)..controls (25.500000,10.066400) and (22.191401,13.433600)..(19.941401,14.226600)
+ ..controls (21.046900,15.121100) and (21.750000,16.476601)..(21.750000,18.000000)
+ ..controls (21.750000,19.808599) and (20.753901,21.375000)..(19.289101,22.214800)
+ ..controls (19.656300,22.718800) and (19.875000,23.332001)..(19.875000,24.000000)
+ ..controls (19.875000,25.656300) and (18.531300,27.000000)..(16.875000,27.000000)
+ --cycle;
+fill (16.875000,27.000000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (16.875000,27.000000)..controls (15.218800,27.000000) and (13.875000,25.656300)..(13.875000,24.000000)
+ ..controls (13.875000,23.332001) and (14.093800,22.718800)..(14.460900,22.214800)
+ ..controls (12.996100,21.375000) and (12.000000,19.808599)..(12.000000,18.000000)
+ ..controls (12.000000,16.476601) and (12.703100,15.121100)..(13.808600,14.226600)
+ ..controls (11.558600,13.433600) and (8.250000,10.066400)..(8.250000,4.125000)
+ --(25.500000,4.125000)..controls (25.500000,10.066400) and (22.191401,13.433600)..(19.941401,14.226600)
+ ..controls (21.046900,15.121100) and (21.750000,16.476601)..(21.750000,18.000000)
+ ..controls (21.750000,19.808599) and (20.753901,21.375000)..(19.289101,22.214800)
+ ..controls (19.656300,22.718800) and (19.875000,23.332001)..(19.875000,24.000000)
+ ..controls (19.875000,25.656300) and (18.531300,27.000000)..(16.875000,27.000000)
+ --cycle;
+draw (16.875000,27.000000);
+);
+
+picture _chess_cburnett_wQ;
+_chess_cburnett_wQ:=image(
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+linecap := butt;
+fill (6.750000,14.250000)..controls (13.125000,15.375000) and (22.500000,15.375000)..(27.000000,14.250000)
+ --(28.500000,23.250000)--(23.250000,15.000000)--(23.250000,25.500000)
+ --(19.125000,15.375000)--(16.875000,26.625000)--(14.625000,15.375000)
+ --(10.500000,25.875000)--(10.500000,15.000000)--(5.250000,23.250000)
+ --cycle;
+fill (6.750000,14.250000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,14.250000)..controls (13.125000,15.375000) and (22.500000,15.375000)..(27.000000,14.250000)
+ --(28.500000,23.250000)--(23.250000,15.000000)--(23.250000,25.500000)
+ --(19.125000,15.375000)--(16.875000,26.625000)--(14.625000,15.375000)
+ --(10.500000,25.875000)--(10.500000,15.000000)--(5.250000,23.250000)
+ --cycle;
+draw (6.750000,14.250000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+fill (6.750000,14.250000)..controls (6.750000,12.750000) and (7.875000,12.750000)..(8.625000,11.250000)
+ ..controls (9.375000,10.125000) and (9.375000,10.500000)..(9.000000,8.625000)
+ ..controls (7.875000,7.875000) and (7.875000,6.750000)..(7.875000,6.750000)
+ ..controls (6.750000,5.625000) and (8.250000,4.875000)..(8.250000,4.875000)
+ ..controls (13.125000,4.125000) and (20.625000,4.125000)..(25.500000,4.875000)
+ ..controls (25.500000,4.875000) and (26.625000,5.625000)..(25.500000,6.750000)
+ ..controls (25.500000,6.750000) and (25.875000,7.875000)..(24.750000,8.625000)
+ ..controls (24.375000,10.500000) and (24.375000,10.125000)..(25.125000,11.250000)
+ ..controls (25.875000,12.750000) and (27.000000,12.750000)..(27.000000,14.250000)
+ ..controls (20.625000,15.375000) and (13.125000,15.375000)..(6.750000,14.250000)
+ --cycle;
+fill (6.750000,14.250000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,14.250000)..controls (6.750000,12.750000) and (7.875000,12.750000)..(8.625000,11.250000)
+ ..controls (9.375000,10.125000) and (9.375000,10.500000)..(9.000000,8.625000)
+ ..controls (7.875000,7.875000) and (7.875000,6.750000)..(7.875000,6.750000)
+ ..controls (6.750000,5.625000) and (8.250000,4.875000)..(8.250000,4.875000)
+ ..controls (13.125000,4.125000) and (20.625000,4.125000)..(25.500000,4.875000)
+ ..controls (25.500000,4.875000) and (26.625000,5.625000)..(25.500000,6.750000)
+ ..controls (25.500000,6.750000) and (25.875000,7.875000)..(24.750000,8.625000)
+ ..controls (24.375000,10.500000) and (24.375000,10.125000)..(25.125000,11.250000)
+ ..controls (25.875000,12.750000) and (27.000000,12.750000)..(27.000000,14.250000)
+ ..controls (20.625000,15.375000) and (13.125000,15.375000)..(6.750000,14.250000)
+ --cycle;
+draw (6.750000,14.250000);
+linecap := rounded;
+draw (8.625000,11.250000)..controls (11.250000,12.000000) and (22.500000,12.000000)..(25.125000,11.250000);
+draw (9.000000,8.625000)..controls (13.500000,9.375000) and (20.250000,9.375000)..(24.750000,8.625000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+fill (6.000000,24.750000)..controls (6.000000,22.750000) and (3.000000,22.750000)..(3.000000,24.750000)
+ ..controls (3.000000,26.750000) and (6.000000,26.750000)..(6.000000,24.750000)
+ --cycle;
+fill (18.375000,28.125000)..controls (18.375000,26.125000) and (15.375000,26.125000)..(15.375000,28.125000)
+ ..controls (15.375000,30.125000) and (18.375000,30.125000)..(18.375000,28.125000)
+ --cycle;
+fill (30.750000,24.750000)..controls (30.750000,22.750000) and (27.750000,22.750000)..(27.750000,24.750000)
+ ..controls (27.750000,26.750000) and (30.750000,26.750000)..(30.750000,24.750000)
+ --cycle;
+fill (12.000000,27.375000)..controls (12.000000,25.375000) and (9.000000,25.375000)..(9.000000,27.375000)
+ ..controls (9.000000,29.375000) and (12.000000,29.375000)..(12.000000,27.375000)
+ --cycle;
+fill (24.750000,27.000000)..controls (24.750000,25.000000) and (21.750000,25.000000)..(21.750000,27.000000)
+ ..controls (21.750000,29.000000) and (24.750000,29.000000)..(24.750000,27.000000)
+ --cycle;
+fill (24.750000,27.000000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (6.000000,24.750000)..controls (6.000000,22.750000) and (3.000000,22.750000)..(3.000000,24.750000)
+ ..controls (3.000000,26.750000) and (6.000000,26.750000)..(6.000000,24.750000)
+ --cycle;
+draw (18.375000,28.125000)..controls (18.375000,26.125000) and (15.375000,26.125000)..(15.375000,28.125000)
+ ..controls (15.375000,30.125000) and (18.375000,30.125000)..(18.375000,28.125000)
+ --cycle;
+draw (30.750000,24.750000)..controls (30.750000,22.750000) and (27.750000,22.750000)..(27.750000,24.750000)
+ ..controls (27.750000,26.750000) and (30.750000,26.750000)..(30.750000,24.750000)
+ --cycle;
+draw (12.000000,27.375000)..controls (12.000000,25.375000) and (9.000000,25.375000)..(9.000000,27.375000)
+ ..controls (9.000000,29.375000) and (12.000000,29.375000)..(12.000000,27.375000)
+ --cycle;
+draw (24.750000,27.000000)..controls (24.750000,25.000000) and (21.750000,25.000000)..(21.750000,27.000000)
+ ..controls (21.750000,29.000000) and (24.750000,29.000000)..(24.750000,27.000000)
+ --cycle;
+draw (24.750000,27.000000);
+);
+
+picture _chess_cburnett_wR;
+_chess_cburnett_wR:=image(
+ drawoptions (withcolor (1.000000,1.000000,1.000000));
+linecap := butt;
+fill (6.750000,4.500000)--(27.000000,4.500000)--(27.000000,6.750000)
+ --(6.750000,6.750000)--cycle;
+fill (9.000000,6.750000)--(9.000000,9.750000)--(24.750000,9.750000)
+ --(24.750000,6.750000)--cycle;
+fill (8.250000,23.250000)--(8.250000,27.000000)--(11.250000,27.000000)
+ --(11.250000,25.500000)--(15.000000,25.500000)--(15.000000,27.000000)
+ --(18.750000,27.000000)--(18.750000,25.500000)--(22.500000,25.500000)
+ --(22.500000,27.000000)--(25.500000,27.000000)--(25.500000,23.250000)
+ --cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (6.750000,4.500000)--(27.000000,4.500000)--(27.000000,6.750000)
+ --(6.750000,6.750000)--cycle;
+draw (9.000000,6.750000)--(9.000000,9.750000)--(24.750000,9.750000)
+ --(24.750000,6.750000)--cycle;
+draw (8.250000,23.250000)--(8.250000,27.000000)--(11.250000,27.000000)
+ --(11.250000,25.500000)--(15.000000,25.500000)--(15.000000,27.000000)
+ --(18.750000,27.000000)--(18.750000,25.500000)--(22.500000,25.500000)
+ --(22.500000,27.000000)--(25.500000,27.000000)--(25.500000,23.250000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+linecap := rounded;
+fill (25.500000,23.250000)--(23.250000,21.000000)--(10.500000,21.000000)
+ --(8.250000,23.250000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (25.500000,23.250000)--(23.250000,21.000000)--(10.500000,21.000000)
+ --(8.250000,23.250000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+linecap := butt;
+linejoin := mitered;
+fill (23.250000,21.000000)--(23.250000,11.625000)--(10.500000,11.625000)
+ --(10.500000,21.000000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (23.250000,21.000000)--(23.250000,11.625000)--(10.500000,11.625000)
+ --(10.500000,21.000000);
+drawoptions (withcolor (1.000000,1.000000,1.000000));
+pickup pencircle scaled 0.000000bp;
+linecap := rounded;
+linejoin := rounded;
+fill (23.250000,11.625000)--(24.375000,9.750000)--(9.375000,9.750000)
+ --(10.500000,11.625000)--cycle;
+drawoptions (withcolor (0.000000,0.000000,0.000000));
+pickup pencircle scaled 1.125000bp;
+draw (23.250000,11.625000)--(24.375000,9.750000)--(9.375000,9.750000)
+ --(10.500000,11.625000);
+linejoin := mitered;
+draw (8.250000,23.250000)--(25.500000,23.250000);
+); \ No newline at end of file
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess-chessboard.mp b/Master/texmf-dist/metapost/mpchess/mpchess-chessboard.mp
new file mode 100644
index 00000000000..996e9282742
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess-chessboard.mp
@@ -0,0 +1,454 @@
+
+
+
+
+% the chessboard
+% chessboard_table[step][1-8][1-8] corresponding to step/A-H/1-8
+% array 8x8 for each step of the game
+numeric chessboard_table[][][];
+numeric chessboard_number;
+
+% set the starting board
+def init_chessboard =
+ for i:=0 upto 500:
+ _chess_wcaptures_nbr[i]:=0;
+ _chess_bcaptures_nbr[i]:=0;
+ endfor
+ if(_chessSize=8):
+ for i:=1 upto 8:
+ for j:=1 upto 8:
+ chessboard_table[0][i][j]:=0;
+ endfor;
+ endfor;
+ for i:=1 upto 8:
+ chessboard_table[0][i][2]:=_intWPawn;
+ chessboard_table[0][i][7]:=_intBPawn;
+ endfor;
+ chessboard_table[0][1][1]:=_intWRook;chessboard_table[0][8][1]:=_intWRook;
+ chessboard_table[0][1][8]:=_intBRook;chessboard_table[0][8][8]:=_intBRook;
+ chessboard_table[0][2][1]:=_intWKnight;chessboard_table[0][7][1]:=_intWKnight;
+ chessboard_table[0][2][8]:=_intBKnight;chessboard_table[0][7][8]:=_intBKnight;
+ chessboard_table[0][3][1]:=_intWBishop;chessboard_table[0][6][1]:=_intWBishop;
+ chessboard_table[0][3][8]:=_intBBishop;chessboard_table[0][6][8]:=_intBBishop;
+ chessboard_table[0][4][1]:=_intWQueen;
+ chessboard_table[0][4][8]:=_intBQueen;
+ chessboard_table[0][5][1]:=_intWKing;
+ chessboard_table[0][5][8]:=_intBKing;
+ fi
+ chessboard_number:=1;
+enddef;
+
+% clear the chessboard
+def clear_chessboard =
+ for k:=0 upto 500:
+ for i:=0 upto 20:
+ for j:=0 upto 20:
+ chessboard_table[k][i][j]:=0;
+ endfor
+ endfor
+ endfor
+enddef;
+
+% function to clear an area specified with a arg of type "a1-b6","g1-f2", etc
+def clear_areas(text plist)=
+ save _first_letter,_firt_nbr, _second_letter,_second_nbr,_fl,_fn,_sl,_sn,_str;
+ string _first_letter,_first_nbr, _second_letter,_second_nbr,_str;
+ for _str = plist:
+ _first_letter:=substring (0,1) of _str;
+ _first_nbr:=substring (1,2) of _str;
+ _second_letter:=substring (3,4) of _str;
+ _second_nbr:=substring (4,5) of _str;
+ _fl:=_lettre_to_int(_first_letter);
+ _fn:=_str_to_int(_first_nbr);
+ _sl:=_lettre_to_int(_second_letter);
+ _sn:=_str_to_int(_second_nbr);
+ for i:=_fl upto _sl:
+ for j:=_fn upto _sn:
+ chessboard_table[0][i][j]:=0;
+ endfor
+ endfor
+ endfor
+enddef;
+
+% function to clear squares with a arg of type "a1-b6","g1-f2", etc
+def clear_squares(text plist)=
+ save _first_letter,_firt_nbr,_fl,_fn,_str;
+ string _first_letter,_first_nbr,_str;
+ for _str = plist:
+ _first_letter:=substring (0,1) of _str;
+ _first_nbr:=substring (1,2) of _str;
+ _fl:=_lettre_to_int(_first_letter);
+ _fn:=_str_to_int(_first_nbr);
+ chessboard_table[0][_fl][_fn]:=0;
+ endfor
+enddef;
+
+% function to clear an area specified with a arg of type "a","c",etc
+def clear_files(text plist)=
+ save _letter,_l,_str;
+ string _letter,_str;
+ for _str = plist:
+ _letter:= _str;
+ _l:=_lettre_to_int(_letter);
+ for j:=1 upto _chessSize:
+ chessboard_table[0][_l][j]:=0;
+ endfor
+ endfor
+enddef;
+
+% function to clear an area specified with a arg of type "1","5",etc
+def clear_ranks(text plist)=
+ save _nbr,_n,_str;
+ string _nbr,_str;
+ for _str = plist:
+ _nbr:= _str;
+ _n:=_str_to_int(_nbr);
+ for i:=1 upto _chessSize:
+ chessboard_table[0][i][_n]:=0;
+ endfor
+ endfor
+enddef;
+
+def _int_to_piece(expr i)=
+ if(i=_intWPawn):
+ _chess_wP
+ elseif(i=_intBPawn):
+ _chess_bP
+ elseif(i=_intWKnight):
+ _chess_wN
+ elseif(i=_intBKnight):
+ _chess_bN
+ elseif(i=_intWBishop):
+ _chess_wB
+ elseif(i=_intBBishop):
+ _chess_bB
+ elseif(i=_intWRook):
+ _chess_wR
+ elseif(i=_intBRook):
+ _chess_bR
+ elseif(i=_intWQueen):
+ _chess_wQ
+ elseif(i=_intBQueen):
+ _chess_bQ
+ elseif(i=_intWKing):
+ _chess_wK
+ elseif(i=_intBKing):
+ _chess_bK
+ fi
+enddef;
+
+def _draw_step_chessboard(expr k) =
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ %show chessboard_table[k][i][j];
+ if(chessboard_table[k][i][j] <> 0):
+ draw ( _int_to_piece(chessboard_table[k][i][j]) shifted ((i-1)*_chessSquareU,(j-1)*_chessSquareU));
+ fi
+ endfor;
+ endfor;
+enddef;
+
+
+vardef _pawn_candidate(expr istart, jstart,iend,jend,wb,capture)=
+ % i int from letter, column
+ % j int for line
+ % return true if (istart,jstart) to (iend,jend)
+ % is a possible mvt
+ % wb is "white" or "black"
+ % capture equal 1 if there is a capture
+ save output;
+ boolean output;
+ output = false;
+ if(((iend<=_chessSize) and (iend>=1) and (iend<=_chessSize) and (iend>=1))):
+ if(wb="white"):
+ if(jend=4): % on the line that allow 2 square move
+ if(((jstart=3) or (jstart=2)) and (iend=istart)):
+ output:=true;
+ fi
+ if(((jstart=3) and ((istart=iend+1) or (istart=iend-1))) and (capture=1)): %capture
+ output:=true;
+ fi
+ else:
+ if((jstart=jend-1) and (istart=iend)): % straight move
+ output:=true;
+ fi
+ if(((jstart=jend-1) and ((istart=iend+1) or (istart=iend-1))) and (capture=1)): % capture
+ output:=true;
+ fi
+ fi
+ else:
+ if(jend=5): % on the line that allow 2 square move
+ if(((jstart=6) or (jstart=7)) and (iend=istart)):
+ output:=true;
+ fi
+ if(((jstart=6) and ((istart=iend+1) or (istart=iend-1))) and (capture=1)): %capture
+ output:=true;
+ fi
+ else:
+ if((jstart=jend+1) and (istart=iend)): % straight move
+ output:=true;
+ fi
+ if(((jstart=jend+1) and ((istart=iend+1) or (istart=iend-1))) and (capture=1)): % capture
+ output:=true;
+ fi
+ fi
+ fi
+ fi
+ output
+enddef;
+
+vardef _bishop_candidate(expr istart, jstart,iend,jend,wb)=
+ % i int from letter, column
+ % j int for line
+ % return true if (istart,jstart) to (iend,jend)
+ % is a possible mvt
+ % wb is "white" or "black"
+ save output;
+ boolean output;
+ output = false;
+ if((iend<=_chessSize) and (iend>=1) and (iend<=_chessSize) and (iend>=1)):
+ if(abs(iend-istart)=abs(jend-jstart)):
+ output:=true;
+ fi
+ fi
+ output
+enddef;
+
+vardef _rook_candidate(expr istart, jstart,iend,jend,wb)=
+ % i int from letter, column
+ % j int for line
+ % return true if (istart,jstart) to (iend,jend)
+ % is a possible mvt
+ % wb is "white" or "black"
+ save output;
+ boolean output;
+ output = false;
+ if((iend<=_chessSize) and (iend>=1) and (iend<=_chessSize) and (iend>=1)):
+ if((iend=istart) or (jend=jstart)):
+ output:=true;
+ fi
+ fi
+ output
+enddef;
+
+
+vardef _queen_candidate(expr istart, jstart,iend,jend,wb)=
+ % i int from letter, column
+ % j int for line
+ % return true if (istart,jstart) to (iend,jend)
+ % is a possible mvt
+ % wb is "white" or "black"
+ save output;
+ boolean output;
+ output = false;
+ if((iend<=_chessSize) and (iend>=1) and (iend<=_chessSize) and (iend>=1)):
+ if((iend-istart) or (jend-jstart) or (abs(iend-istart)=abs(jend-jstart))):
+ output:=true;
+ fi
+ fi
+ output
+enddef;
+
+vardef _king_candidate(expr istart, jstart,iend,jend,wb)=
+ % i int from letter, column
+ % j int for line
+ % return true if (istart,jstart) to (iend,jend)
+ % is a possible mvt
+ % wb is "white" or "black"
+ save output;
+ boolean output;
+ output = false;
+ if((iend<=_chessSize) and (iend>=1) and (iend<=_chessSize) and (iend>=1)):
+ if((abs(iend-istart)<=1) and (abs(jend-jstart)<=1)):
+ output:=true;
+ fi
+ fi
+ output
+enddef;
+
+vardef _knight_candidate(expr istart, jstart,iend,jend,wb)=
+ % i int from letter, column
+ % j int for line
+ % return true if (istart,jstart) to (iend,jend)
+ % is a possible mvt
+ % wb is "white" or "black"
+ save output;
+ boolean output;
+ output = false;
+ if((iend<=_chessSize) and (iend>=1) and (iend<=_chessSize) and (iend>=1)):
+ if(((abs(iend-istart)=2) and (abs(jend-jstart)=1)) or ((abs(iend-istart)=1) and (abs(jend-jstart)=2))):
+ output:=true;
+ fi
+ fi
+ output
+enddef;
+
+vardef _chess_candidate(expr type, istart, jstart, iend, jend,wb,capture)=
+ numeric _pm;
+ _pm:=1;
+ if(wb="black"):
+ _pm:=-1;
+ fi
+ if(type=(_pm*_intWPawn)):
+ _pawn_candidate(istart,jstart,iend,jend,wb,capture)
+ elseif(type=_pm*_intWBishop):
+ _bishop_candidate(istart,jstart,iend,jend,wb)
+ elseif(type=_pm*_intWKing):
+ _king_candidate(istart,jstart,iend,jend,wb)
+ elseif(type=_pm*_intWKnight):
+ _knight_candidate(istart,jstart,iend,jend,wb)
+ elseif(type=_pm*_intWQueen):
+ _queen_candidate(istart,jstart,iend,jend,wb)
+ elseif(type=_pm*_intWRook):
+ _rook_candidate(istart,jstart,iend,jend,wb)
+ fi
+enddef;
+
+def _chess_copy_chessboard(expr step)=
+ save i,j;
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ chessboard_table[step][i][j]:=chessboard_table[step-1][i][j];
+ endfor;
+ endfor;
+enddef;
+
+def _chess_copy_captures(expr step)=
+ save i,j;
+ %show _chess_wcaptures_nbr[step-1];
+ if(_chess_wcaptures_nbr[step-1]>0):
+ for i:=0 upto _chess_wcaptures_nbr[step-1]-1:
+ _chess_white_captures[step][i]:=_chess_white_captures[step-1][i];
+ endfor;
+ fi
+ %show _chess_bcaptures_nbr[step-1];
+ if(_chess_bcaptures_nbr[step-1]>0):
+ for i:=0 upto _chess_bcaptures_nbr[step-1]-1:
+ _chess_black_captures[step][i]:=_chess_black_captures[step-1][i];
+ endfor;
+ fi
+enddef;
+
+numeric _chess_white_captures[][],_chess_black_captures[][];
+numeric _chess_wcaptures_nbr[], _chess_bcaptures_nbr[];
+_chess_wcaptures_nbr[0]:=0;
+_chess_bcaptures_nbr[0]:=0;
+
+def _build_all_chessboards=
+ save _wb;
+ string _wb;
+ init_chessboard; % k=0
+ for k:=1 upto (_chess_step_numtable):
+ _chess_copy_chessboard(k);
+ _chess_copy_captures(k);
+ _piecetype:=_chess_moves_table_numeric[k-1][0];
+ _pm:=_chess_moves_table_numeric[k-1][1];
+ _iend:=_chess_moves_table_numeric[k-1][2];
+ _jend:=_chess_moves_table_numeric[k-1][3];
+ _capture:=_chess_moves_table_numeric[k-1][4];
+ _promotion:=_chess_moves_table_numeric[k-1][5];
+ _ambiguity:=_chess_moves_table_numeric[k-1][6];
+ if(_pm=1):
+ _wb:="white";
+ else:
+ _wb:="black";
+ fi
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ if(chessboard_table[k][i][j]=_piecetype):
+ if(_chess_candidate(_piecetype, i, j, _iend, _jend,_wb,_capture)=true):
+ if(_capture<>0):
+ if(_pm=1):
+ _chess_white_captures[k][_chess_wcaptures_nbr[k-1]]:=chessboard_table[k][i][j];
+ _chess_wcaptures_nbr[k]:=_chess_wcaptures_nbr[k-1]+1;
+ _chess_bcaptures_nbr[k]:=_chess_bcaptures_nbr[k-1];
+ else:
+ _chess_black_captures[k][_chess_bcaptures_nbr[k-1]]:=chessboard_table[k][i][j];
+ _chess_bcaptures_nbr[k]:=_chess_bcaptures_nbr[k-1]+1;
+ _chess_wcaptures_nbr[k]:=_chess_wcaptures_nbr[k-1];
+ fi
+ else:
+ _chess_wcaptures_nbr[k]:=_chess_wcaptures_nbr[k-1];
+ _chess_bcaptures_nbr[k]:=_chess_bcaptures_nbr[k-1];
+ fi
+
+ chessboard_table[k][i][j]:=0; %erase piece
+ if(_promotion<>0):
+ chessboard_table[k][_iend][_jend]:=_promotion;
+ else:
+ chessboard_table[k][_iend][_jend]:=_piecetype;
+ fi
+ fi
+ fi
+ endfor;
+ endfor;
+ endfor;
+ chessboard_number:=_chess_step_numtable;
+enddef;
+
+def build_chessboards_from_pgn(expr s)=
+ _build_chess_moves_tables(s);
+ _build_all_chessboards;
+enddef;
+
+
+% set the starting empty board
+def set_empty_chessboard =
+ for i:=0 upto 500:
+ _chess_wcaptures_nbr[i]:=0;
+ _chess_bcaptures_nbr[i]:=0;
+ endfor
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ chessboard_table[0][i][j]:=0;
+ endfor;
+ endfor;
+ chessboard_number:=1;
+enddef;
+
+
+def add_white_pieces(text plists) =
+ save _str,_piecetype, _letter, _nbr,wb;
+ string wb;
+ wb:="white";
+ for _str = plists:
+ if(_is_cap(_get_char(_str,0))): % if the first char is a cap
+ _piecetype:=_cap_to_int(_get_char(_str,0),wb);
+ if(length(_str)=3): % type Nf6
+ _letter:=_lettre_to_int(_get_char(_str,1));
+ _nbr:=_str_to_int(_get_char(_str,2));
+ fi
+ else:
+ _piecetype:=_intWPawn;
+ if(length(_str)=2): % type f6
+ _letter:=_lettre_to_int(_get_char(_str,0));
+ _nbr:=_str_to_int(_get_char(_str,1));
+ fi
+ fi
+ chessboard_table[0][_letter][_nbr]:=_piecetype;
+ endfor
+enddef;
+
+def add_black_pieces(text plists) =
+ save _str,_piecetype, _letter, _nbr,wb;
+ string wb;
+ wb:="black";
+ for _str = plists:
+ if(_is_cap(_get_char(_str,0))): % if the first char is a cap
+ _piecetype:=_cap_to_int(_get_char(_str,0),wb);
+ if(length(_str)=3): % type Nf6
+ _letter:=_lettre_to_int(_get_char(_str,1));
+ _nbr:=_str_to_int(_get_char(_str,2));
+ fi
+ else:
+ _piecetype:=_intBPawn;
+ if(length(_str)=2): % type f6
+ _letter:=_lettre_to_int(_get_char(_str,0));
+ _nbr:=_str_to_int(_get_char(_str,1));
+ fi
+ fi
+ chessboard_table[0][_letter][_nbr]:=_piecetype;
+ endfor
+enddef;
+
+
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess-fen.mp b/Master/texmf-dist/metapost/mpchess/mpchess-fen.mp
new file mode 100644
index 00000000000..714922d53c8
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess-fen.mp
@@ -0,0 +1,90 @@
+if(unknown _chess_input_pgn):
+ input mpchess-pgn
+fi
+
+def _chess_fen_is_number(expr c)=
+ if((c="1") or (c="2") or (c="3") or (c="4") or (c="5") or (c="6") or (c="7") or (c="8")):
+ true
+ else:
+ false
+ fi
+enddef;
+
+def _chess_is_slash(expr c)=
+ if(c="/"):
+ true
+ else:
+ false
+ fi
+enddef;
+
+def _chess_fen_letter_to_int(expr c)=
+ if(c="B"):
+ _intWBishop
+ elseif(c="K"):
+ _intWKing
+ elseif(c="N"):
+ _intWKnight
+ elseif(c="Q"):
+ _intWQueen
+ elseif(c="R"):
+ _intWRook
+ elseif(c="P"):
+ _intWPawn
+ elseif(c="b"):
+ _intBBishop
+ elseif(c="k"):
+ _intBKing
+ elseif(c="n"):
+ _intBKnight
+ elseif(c="q"):
+ _intBQueen
+ elseif(c="r"):
+ _intBRook
+ elseif(c="p"):
+ _intBPawn
+ fi
+enddef;
+
+def _chess_extract_position(expr fen)=
+ save i, j, _str,_current_char;
+ save _len,_zero_nbr,_exit_for;
+ boolean _exit_for;
+ _exit_for:=false;
+ string _str,_current_char;
+ _str:=fen;
+ i:=1;
+ j:=8;
+ _len:=length(_str);
+ forever:exitunless(not _exit_for);
+ _len:=length(_str);
+ _current_char:=_get_char(_str,0);
+ _str:=substring (1,_len) of _str;
+ if(_chess_fen_is_number(_current_char)): % if a number
+ _zero_nbr:=_str_to_int(_current_char);
+ for k:=0 upto _zero_nbr-1:
+ chessboard_table[0][i+k][j]:=0;
+ endfor
+ i:=i+_zero_nbr;
+ elseif(_chess_is_slash(_current_char)): % if char /
+ j:=j-1; % change line
+ i:=1; % reset column
+ elseif(_current_char=" "):
+ % if " "
+ _exit_for:=true;
+ if(_get_char(_str,0)="w"):
+ _white_to_move:=true;
+ else:
+ _white_to_move:=false;
+ fi
+ else: % a letter
+ chessboard_table[0][i][j]:=_chess_fen_letter_to_int(_current_char);
+ i:=i+1;
+ fi
+ endfor
+enddef;
+
+def build_chessboard_from_fen(expr s)=
+ set_empty_chessboard;
+ _chess_extract_position(s);
+enddef; \ No newline at end of file
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess-pgn.mp b/Master/texmf-dist/metapost/mpchess/mpchess-pgn.mp
new file mode 100644
index 00000000000..0ed11644b0d
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess-pgn.mp
@@ -0,0 +1,315 @@
+boolean _chess_input_pgn;
+% some intern macros to deal with blocks of a PNG line
+
+vardef _delete_first_spaces(expr s)=
+ save output;
+ _total_length:= length s;
+ string output;
+ _spaces := 0 ;
+ for j = 0 upto _total_length :
+ if substring (j,j+1) of s = " " :
+ _spaces := _spaces+1 ;
+ else :
+ exitif true ;
+ fi
+ endfor
+ output := substring (_spaces,_total_length) of s;
+ output
+enddef;
+
+vardef _get_first_block(expr s)=
+ save output;
+ string output;
+ output:=_delete_first_spaces(s);
+ _total_length:= length output;
+ _size := 0 ;
+ for j = 0 upto _total_length :
+ if substring (j,j+1) of output <> " " :
+ _size := _size+1 ;
+ else:
+ exitif(true) ;
+ fi
+ endfor
+ output := substring (0,_size) of output;
+ output
+enddef;
+
+vardef _drop_first_block(expr s)=
+ save output;
+ string output;
+ output:=_delete_first_spaces(s);
+ _total_length:= length output;
+ _size := 0 ;
+ for j = 0 upto _total_length :
+ if substring (j,j+1) of output <> " " :
+ _size := _size+1 ;
+ else :
+ exitif true ;
+ fi
+ endfor
+ output := substring (_size,_total_length) of output;
+ output
+enddef;
+
+% table of moves:
+% _chess_moves_table[step][0]->white move
+% _chess_moves_table[step][1]->black move
+% step starts at 1
+string _chess_moves_table[][];
+numeric _chess_moves_table_numeric[][];
+numeric _chess_pgn_step;
+numeric _chess_step_numtable;
+_chess_step_numtable:=0; % total number of moves (white+black) halfmove
+_chess_pgn_step:=0; % total numbre of "couple" moves (should be uncomplete without black move)
+
+def get_halfmove_number=
+ _chess_step_numtable
+enddef;
+
+def get_totalmove_number=
+ _chess_pgn_step
+enddef;
+
+% macro to deal the block (or half block) between to numbers of PNG step
+% s = 3. Nf6 c6 4. [...]
+vardef _get_move(expr s)=
+ save output,_step;
+ string output;
+ numeric _step;
+ output:=s;
+ % drop the step
+ _step := scantokens(_get_first_block(output));
+ output:=_drop_first_block(output); % get rid of i.
+
+ % get the white move and drop it
+ _chess_moves_table[_chess_pgn_step][0]:=_get_first_block(output); %get the white move
+ _extract_move(_chess_step_numtable,_get_first_block(output),"white"); % build the numeric table
+ _chess_step_numtable:=_chess_step_numtable+1;
+ output:=_drop_first_block(output); % rid of the treated block
+ output:=_delete_first_spaces(output);
+ % get the black move and drop it
+ if((output)<>""):
+ _chess_moves_table[_chess_pgn_step][1]:=_get_first_block(output);
+ _extract_move(_chess_step_numtable,_get_first_block(output),"black");
+ _chess_step_numtable:=_chess_step_numtable+1;
+ output:=_drop_first_block(output);
+ fi
+ _chess_pgn_step:=_chess_pgn_step+1;
+ output
+enddef;
+
+def _build_chess_moves_tables(expr s)=
+ save output;
+ string output;
+ output:=s;
+ forever:
+ output:=_get_move(output);
+ output:=_delete_first_spaces(output);
+ exitif(output="");
+ endfor
+enddef;
+
+% intern debug macro
+def _show_chess_moves_table=
+ for i:=0 upto _chess_pgn_step-1:
+ show "move";
+ show _chess_moves_table[i][0];
+ if(2*i<_chess_step_numtable-1): % if the is no black move
+ show _chess_moves_table[i][1];
+ fi
+ endfor
+enddef;
+
+% intern debug macro
+def _show_chess_moves_table_numeric=
+ for i:=0 upto _chess_step_numtable-1:
+ show "move";
+ show _chess_moves_table_numeric[i][0];
+ show _chess_moves_table_numeric[i][1];
+ show _chess_moves_table_numeric[i][2];
+ show _chess_moves_table_numeric[i][3];
+ show _chess_moves_table_numeric[i][4];
+ show _chess_moves_table_numeric[i][5];
+ show _chess_moves_table_numeric[i][6];
+ endfor
+enddef;
+
+vardef _is_cap(expr c)=
+ if((c="B") or (c="K") or (c="N") or (c="Q") or (c="R")):
+ true
+ else:
+ false
+ fi
+enddef;
+
+vardef _cap_to_int(expr c,wb)=
+ numeric _pm;
+ _pm:=1;
+ if(wb="black"):
+ _pm:=-1;
+ fi
+ if(c="B"):
+ _pm*_intWBishop
+ elseif(c="K"):
+ _pm*_intWKing
+ elseif(c="N"):
+ _pm*_intWKnight
+ elseif(c="Q"):
+ _pm*_intWQueen
+ elseif(c="R"):
+ _pm*_intWRook
+ fi
+enddef;
+
+vardef _cap_to_int(expr c,wb)=
+ numeric _pm;
+ _pm:=1;
+ if(wb="black"):
+ _pm:=-1;
+ fi
+ if(c="B"):
+ _pm*_intWBishop
+ elseif(c="K"):
+ _pm*_intWKing
+ elseif(c="N"):
+ _pm*_intWKnight
+ elseif(c="Q"):
+ _pm*_intWQueen
+ elseif(c="R"):
+ _pm*_intWRook
+ fi
+enddef;
+
+vardef _lettre_to_int(expr a)=
+ if(a="a"):
+ 1
+ elseif(a="b"):
+ 2
+ elseif(a="c"):
+ 3
+ elseif(a="d"):
+ 4
+ elseif(a="e"):
+ 5
+ elseif(a="f"):
+ 6
+ elseif(a="g"):
+ 7
+ elseif(a="h"):
+ 8
+ fi
+enddef;
+
+def _str_to_int(expr i)=
+ if(i="1"):
+ 1
+ elseif(i="2"):
+ 2
+ elseif(i="3"):
+ 3
+ elseif(i="4"):
+ 4
+ elseif(i="5"):
+ 5
+ elseif(i="6"):
+ 6
+ elseif(i="7"):
+ 7
+ elseif(i="8"):
+ 8
+ fi
+enddef;
+
+
+
+vardef _extract_move(expr _step,s,wb)=
+ % function to convert a PGN move (ie Nc6)
+ % to a array of numerics (type, wb,letter, nbr, capture,promotion,ambiguity)
+ % no castle moves !!!
+ % s is the string of PGN move
+ % wb is a string equal to "white" or "black"
+ % s=Nc6,wb="white" -> (_intBKnigh,+-1,3,6,0,0,0)
+ % capture is boolean
+ % promotion gives the int corresponding to the piece
+ % ambiguity gives the column if ambiguity
+ save _str,output,_piecetype,_letter,_nbr,_capture,_ambiguity;
+ numeric _pm,_capture,_promotion,_ambiguity;
+ _promotion:=0;
+ _pm:=1;
+ _capture:=0;
+ _ambiguity:=0;
+ if(wb="black"):
+ _pm:=-1;
+ fi
+ numeric _piecetype,_letter,_nbr;
+ string _str;
+ numeric output[];
+ _str := s;
+ _length:= length(_str);
+ if(str="O-O"):
+ _piecetype:=100;
+ _letter:=100;
+ _nbr:=100;
+ elseif(str="O-O-O"):
+ _piecetype:=1000;
+ _letter:=1000;
+ _nbr:=1000;
+ elseif(_is_cap(_get_char(_str,0))): % if the first char is a cap
+ _piecetype:=_cap_to_int(_get_char(_str,0),wb);
+ if(length(_str)=3): % type Nf6
+ _letter:=_lettre_to_int(_get_char(_str,1));
+ _nbr:=_str_to_int(_get_char(_str,2));
+ elseif(length(_str)=4):
+ if((_get_char(_str,3)="+") or (_get_char(_str,3)="#")): % type Nf4#
+ _letter:=_lettre_to_int(_get_char(_str,1));
+ _nbr:=_str_to_int(_get_char(_str,2));
+ elseif(_get_char(_str,1)="x"): % capture Nxf4
+ _capture:=1;
+ _letter:=_lettre_to_int(_get_char(_str,2));
+ _nbr:=_str_to_int(_get_char(_str,3));
+ else: % ambiguity Rfe2
+ _letter:=_lettre_to_int(_get_char(_str,2));
+ _nbr:=_str_to_int(_get_char(_str,3));
+ _ambiguity:=_lettre_to_int(_get_char(_str,1));
+ fi
+ elseif(length(_str)=5):
+ if(_get_char(_str,1)="x"): % capture type Nxf6+
+ _capture:=1;
+ _letter:=_lettre_to_int(_get_char(_str,2));
+ _nbr:=_str_to_int(_get_char(_str,3));
+ else: % ambiguity Rfe2(+|#)
+ _letter:=_lettre_to_int(_get_char(_str,2));
+ _nbr:=_str_to_int(_get_char(_str,3));
+ _ambiguity:=_lettre_to_int(_get_char(_str,1));
+ fi
+ fi
+ else:
+ _piecetype:=_pm;
+ if(length(_str)=2): % type f6
+ _letter:=_lettre_to_int(_get_char(_str,0));
+ _nbr:=_str_to_int(_get_char(_str,1));
+ elseif(length(_str)=3): % type f6+
+ _letter:=_lettre_to_int(_get_char(_str,0));
+ _nbr:=_str_to_int(_get_char(_str,1));
+ elseif(length(_str)>=4): % type exd8(+/#) or e8=Q(+/#)
+ if((_get_char(_str,1)="x") or (_get_char(_str,3)="#")): % type exd8
+ _capture:=1;
+ _letter:=_lettre_to_int(_get_char(_str,2));
+ _nbr:=_str_to_int(_get_char(_str,3));
+ _ambiguity:=_lettre_to_int(_get_char(_str,0));
+ else: % capture e8=Q
+ _promotion:=_lettre_to_int(_get_char(_str,3));
+ _letter:=_lettre_to_int(_get_char(_str,0));
+ _nbr:=_str_to_int(_get_char(_str,1));
+ fi
+ fi
+ fi
+ _chess_moves_table_numeric[_step][0]:=_piecetype;
+ _chess_moves_table_numeric[_step][1]:=_pm;
+ _chess_moves_table_numeric[_step][2]:=_letter;
+ _chess_moves_table_numeric[_step][3]:=_nbr;
+ _chess_moves_table_numeric[_step][4]:=_capture;
+ _chess_moves_table_numeric[_step][5]:=_promotion;
+ _chess_moves_table_numeric[_step][6]:=_ambiguity;
+enddef;
+
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess-skak.mp b/Master/texmf-dist/metapost/mpchess/mpchess-skak.mp
new file mode 100644
index 00000000000..458b010ebd9
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess-skak.mp
@@ -0,0 +1,385 @@
+% This is `skak30.mf' version 1.0 as of 7/99
+% based on original work by Piet Tutelaers
+% Modified by Torben Hoffmann: smaller pieces and nicer looking knight
+
+% Parameters needed for a 30 points chess font.
+% A complete chess diagram is 240 X 240 points.
+
+
+M=1; % number of squares
+d:=1pt/M; % size per square
+lift=0;
+figshift:=0;
+u:=d;
+fine:=1/100*d; thin:=1/90*d; thick:=1/36*d; border:=1/20*d;
+show thin;
+
+pen fine_pen, border_pen, thin_pen, thick_pen,hairline_pen;
+pickup pencircle scaled 1.5; hairline_pen:=currentpen ; %for drawing king's cross
+pickup pencircle scaled 2.5; fine_pen:=currentpen ; % for drawing dark squares
+pickup pencircle scaled 1.8; border_pen:=currentpen ; % for border ofboard
+pickup pencircle scaled 0.7; thin_pen:=currentpen ; % for drawing pieces
+pickup pencircle scaled 0.8; thick_pen:=currentpen; % for drawing inside pieces
+light=0; dark=1;% white=0; black=1;
+
+
+% This is `skakbase.mf' version 1.0 as of 6/99
+% based on original work by Piet Tutelaers
+% Modified by Torben Hoffmann: smaller pieces and nicer looking knight
+
+% In this file all pieces are defined.
+% The points defining a piece are all in the unitsquare
+% (0,0)--(0,1)--(1,1)--cycle.
+
+
+def _chess_g(expr x) = (.5+(x-.5)*.87) enddef;
+def _chess_f(expr x,y) = (_chess_g(x)+figshift,_chess_g(y)+lift) enddef;
+
+def dark_square(expr D) =
+ clearit; L:=min(D/4, 9); delta:=1/L;
+ pickup fine_pen;
+ for i=1 upto min(D/4,9):
+ draw (0,delta*i*D)--(D-delta*i*D,D);
+ draw (delta*i*D,0)--(D,D-delta*i*D);
+ endfor;
+ draw (0,0)--(D,D);
+ enddef;
+
+def erase_square(expr D, col, row) =
+ currentpicture:=board;
+ erase fill (0,0)--(0,1)--(1,1)--(1,0)--cycle scaled D shifted(col*D, row*D);
+ board:=currentpicture;
+ enddef;
+
+def empty_board(expr D) =
+ picture board; path border;
+ border = ((0,0)--(1,0)--(1,1)--(0,1)--cycle);
+ dark_square(D); board:=nullpicture;
+ for i=0 upto M-1:
+ for j=0 upto M-1:
+ if not odd(i+j): addto board also currentpicture shifted (D*i,D*j) fi;
+ endfor
+ endfor;
+ clearit;
+ pickup border_pen;
+ draw border scaled (M*D);
+ addto board also currentpicture;
+ currentpicture:=board;
+ enddef;
+
+% def reflect(text t) =
+% forsuffixes $=t: z$'=z$ reflectedabout (z1,z2); endfor;
+% enddef;
+def reflect(text t) =
+ forsuffixes $=t: x$'=1-x$+2figshift; y$'=y$; endfor;
+enddef;
+
+def opr(suffix $) = (_chess_g(x$+thick/d), y$) enddef; % one point right
+def opl(suffix $) = (_chess_g(x$-thick/d), y$) enddef; % one point left
+def opu(suffix $) = (x$, _chess_g(y$+thick/d)) enddef; % one point up
+def opd(suffix $) = (x$, _chess_g(y$-thick/d)) enddef; % one point down
+def opur(suffix $) = _chess_f(x$+thick/d,y$+thick/d) enddef;
+ % one point up and right
+def opul(suffix $) = _chess_f(x$-thick/d,y$+thick/d) enddef;
+ % one point up and left
+
+
+
+vardef _skak_K(expr D, col, row,wb) =
+ clearxy;
+ path cross_bar, crown, crown_top, crown_left, crown_right, crown_lower,
+ crown_top_inner, crown_left_inner, crown_right_inner;
+ def moved = scaled D shifted (col*D, row*D) enddef;
+
+ pickup hairline_pen;
+% draw cross
+ z1=_chess_f(.5,.96); z2=_chess_f(.5,.8); z11=_chess_f(.42,.9); reflect(11);
+% cutdraw (z1--z2) moved; cutdraw (z11--z11') moved;
+ draw (z1--z2) moved; draw (z11--z11') moved;
+% top part of crown
+ z3=_chess_f(.5,.38); z21=_chess_f(.475,.5); z22=_chess_f(.45,.575); z23=_chess_f(.45,.775);
+ reflect(21,22,23);
+ crown_top= ((z3..z21..z22..z23..z2..z23'..z22'..z21'..z3) & cycle);
+% left and right part
+ z31=z21; z32=z22; z33=_chess_f(.32,.67); z34=_chess_f(.13,.69); z35=_chess_f(.07,.55);
+ z36=_chess_f(.13,.45); z37=_chess_f(.2,.34);
+ reflect(31, 32, 33, 34, 35, 36, 37);
+ crown_left=(z3..z31..z33..z34..z35..z36..z37);
+ crown_right=(z37'..z36'..z35'..z34'..z33'..z31'..z3);
+% lower part of the crown
+% z6=_chess_f(.5,.095); z61=_chess_f(.27,.12); z62=_chess_f(.2,.15); z63=_chess_f(.21,.23);
+ z6=_chess_f(.5,.095); z61=(x62,.09); z62=_chess_f(.2,.15); z63=_chess_f(.21,.23);
+ reflect(61, 62, 63);
+% crown_lower= ((z37--z63) & (z63--z62) & (z62..z61..z6..z61'..z62') &
+ crown_lower= ((z37--z63) & (z63--z62) & (z62..controls z61 and z61'..z62') &
+ (z62'--z63') & (z63'--z37') & (z37'..z3..z37) & cycle);
+% draw contour of crown
+
+ crown= crown_left & z37..z3..z37' & crown_right & cycle;
+ %if background=dark: erase fill crown moved;
+ % erase fill crown_top moved;
+ % erase fill crown_lower moved;fi;
+
+ if wb="black":
+ fill crown moved; fill crown_top moved;
+ z121=_chess_f(.5,.5); z123=_chess_f(.45,.675); z102=_chess_f(.5,.77);
+ reflect(123);
+ crown_top_inner = (z121{curl 0}..z123..z102..z123'..{curl 0}z121 & cycle);
+ z131=_chess_f(.45,.5); z133=_chess_f(.32,.64); z134=_chess_f(.13,.66); z135=_chess_f(.10,.55);
+ z136=_chess_f(.16,.45); z137=_chess_f(.22,.4); z103=_chess_f(.475,.44);
+ crown_left_inner= ((z103..z131..z133..z134..z135..z136..z137)
+ & (z137..{right}z103) & cycle);
+ crown_right_inner=crown_left_inner reflectedabout (z1,z2);
+ pickup thin_pen;
+ draw crown_top_inner moved withcolor white;
+ draw crown_left_inner moved withcolor white;
+ draw crown_right_inner moved withcolor white;
+ filldraw crown_lower moved ;
+ else:
+ fill crown_lower moved withcolor white;
+ draw crown_lower moved;
+ fi;
+% draw inner parts
+
+ z4=_chess_f(.5,.28); z5=_chess_f(.5,.21);
+ if wb="white":
+ fill crown moved withcolor white; fill crown_top moved withcolor white;
+ draw (z37..z3..z37') moved;
+ draw (z63..z4..z63') moved;
+ draw (z62..z5..z62') moved;
+ draw crown moved; draw crown_top moved;
+ else: pickup thick_pen;
+ draw crown moved; draw crown_top moved;
+ draw (opr(37)..z3..opl(37')) moved withcolor white;
+ draw (opr(63)..z4..opl(63')) moved withcolor white;
+ draw (opr(62)..z5..opl(62')) moved withcolor white;
+ fi;
+
+enddef;
+
+vardef _skak_Q(expr D, col, row,wb) =
+pickup hairline_pen;
+ clearxy;
+ path crown_top, crown, crown_lower;
+ def moved = scaled D shifted (col*D, row*D) enddef;
+
+ %pickup thin_pen;
+% top part of crown
+ z1=_chess_f(.5,.92); z2=_chess_f(.5,.5); z11=_chess_f(.42,.46); z12=_chess_f(.275,.88);
+ z13=_chess_f(.25,.44); z14=_chess_f(.075,.8); z15=_chess_f(.125,.4);
+ reflect(11,12,13,14,15);
+ crown_top = (z15'--z14'--z13'--z12'--z11'--z1--z11--z12--z13--z14--z15);
+% lower part of the crown
+% z6=_chess_f(.5,.0775); z61=_chess_f(.25,.1); z62=_chess_f(.18,.125); z63=_chess_f(.22,y62+1/3(y15-y62));
+ z6=_chess_f(.5,.0775); z61=_chess_f(.18,0.05); z62=_chess_f(.18,.125); z63=(_chess_g(.22)+figshift,y62+1/3(y15-y62));
+ z64=(_chess_g(.19)+figshift,y62+2/3(y15-y62)); z65=(_chess_g(.15)+figshift,y64+1/3(y15-y64));
+ reflect(61,62,63,64,65);
+% crown_lower= ((z15--z64) & (z64--z63) & (z63--z62) &
+ crown_lower= ((z15..z65..z64) & (z64..z63..z62) &
+ (z62..controls z61 and z61'..z62') &
+ (z62'..z63'..z64') & (z64'..z65'..z15'));
+% draw contour of crown
+ crown= (crown_top & crown_lower & cycle);
+
+ if wb="white":
+ fill crown moved withcolor white;
+ draw crown moved;
+ forsuffixes $:=1,12,12',14,14':
+ erase fill (fullcircle scaled .1 shifted z$) moved;
+ draw (fullcircle scaled .1 shifted z$) moved; endfor;
+ else:
+ fill crown moved;
+ forsuffixes $:=1,12,12',14,14':
+ fill (fullcircle scaled .1 shifted z$) moved; endfor; fi;
+% draw inner parts
+ z3=(.5+figshift,y5+(y64-y62)); z4=(.5+figshift,y5+(y63-y62)); z5=_chess_f(.5,.17);
+ z67=(x62,y62+.7(y62-y61));
+ reflect(67);
+ if wb="white": draw (z64..z3..z64') moved; draw (z63..z4..z63') moved;
+% draw (z62..z5..z62') moved;
+ draw (z62..controls z67 and z67'..z62') moved;
+ z21=z11; z22=_chess_f(.325,.475); z23=z13; z24=_chess_f(.175,.44); z25=z15;
+ reflect(21,22,23,24,25);
+ draw ((z2..z21..z22) & (z22..z23..z24) & (z24--z25)) moved;
+ draw ((z2..z21'..z22') & (z22'..z23'..z24') & (z24'--z25')) moved;
+ else:
+ pickup thick_pen;
+ erase draw (opr(64)..z3..opl(64')) moved;
+ erase draw (opr(63)..z4..opl(63')) moved;
+ z72=_chess_f(.25,.14); z73=(x72+0.08,y72+.9(y67-y62));
+ reflect(72,73);
+% erase draw (opr(62)..z5..opl(62')) moved;
+ erase draw (z72..controls z73 and z73'..z72') moved;
+ fi;
+enddef;
+
+vardef _skak_N(expr D, col, row,wb) =
+ clearxy;
+ path knight, ear, eye, nose, mouth, neck;
+ def moved = scaled D shifted (col*D, row*D) enddef;
+
+ pickup hairline_pen;
+% the knight's contour
+ z1=_chess_f(.5,.82); z2=_chess_f(.5,.075); z11=_chess_f(.45,.93); z12=_chess_f(.375,.85);
+ z13=_chess_f(.25,.925);
+ z14=_chess_f(.26,.8); z15=_chess_f(.22,.75); z16=_chess_f(.18,.7); z17=_chess_f(.18,.66); z18=_chess_f(.07,.42);
+ z19=_chess_f(.07,.36); z20=_chess_f(.14,.3); z21=_chess_f(.17,.3); z22=_chess_f(.175,.275);
+ z23=_chess_f(.225,.28);
+ z24=_chess_f(.29,.38); z25=_chess_f(.41,.46); z26=_chess_f(.49,.51); z27=_chess_f(.435,.295);
+% z28=_chess_f(.32,.165);
+% z29=(.31,y2); z30=(.93,y2); z31=(.87,.5); z32=(.7,.78);
+ z28=_chess_f(.34,.18);
+ z29=(_chess_g(.33)+figshift,y2); z30=(_chess_g(.92)+figshift,y2); z31=_chess_f(.85,.5); z32=_chess_f(.73,.72);
+ knight = ((z1--z11--z12--z13--z14) &
+ (z14..z15..z16..z17..z18..z19..z20..z21) &
+ (z21..z22..z23..z24..z25..z26) &
+ (z26..z27..z28..z29) & (z29--z30) &
+ (z30..z31..z32..z1) &cycle);
+% draw contour of knight
+ if wb="white": erase fill knight moved;
+ draw knight moved;
+ else: fill knight moved; fi;
+% draw inner parts
+ z4=_chess_f(.22,.62); z41=_chess_f(.25,.67); z42=_chess_f(.29,.705); z43=_chess_f(.31,.7); z44=_chess_f(.3,.68);
+ eye = (z4..z41..z42..z43 & z43..z44..z4 & cycle);
+ z5=_chess_f(.1,.36); z51=_chess_f(.1,.39); z52=_chess_f(.135,.43); z53=_chess_f(.15,.4); z54=_chess_f(.13,.38);
+ nose = (z5..z51..z52..z53..z54..z5 &cycle);
+ if wb="white": z21'=_chess_f(.2,.34); draw (z21'--z21) moved; %mouth
+ z26'=_chess_f(.54,.63); draw (z26'..z26{z24-z26}) moved; %neck
+ draw (z12--z14) moved; % ear
+ fill eye moved; fill nose moved;
+ else: erase fill eye moved; erase fill nose moved; fi;
+% z30'=z30 + _chess_f(-thick#/d#,thick#/d#); pickup thick_pen
+ z30'=opul(30); pickup thick_pen
+ erase draw (.4[opd(1),z1]..opd(32)..1/2[opl(31),z31]..1/2[z30',z30]) moved; % mane
+enddef;
+
+vardef _skak_B(expr D, col, row,wb) =
+ clearxy;
+ path top, hat, brim, mitre, stole;
+ def moved = scaled D shifted (col*D, row*D) enddef;
+
+ pickup hairline_pen;
+% the top circle
+ z1=_chess_f(.5,.85); z2=_chess_f(.5,.8);
+ top = (fullcircle scaled .1 shifted z1);
+ if wb="white": erase fill top moved; draw top moved;
+ else: fill top moved; fi;
+% the hat
+ z3=_chess_f(.5,.43); z21=_chess_f(.27,.57); z31=_chess_f(.35,.4); reflect(21,31);
+ hat = (z31'..z21'..z2{(-1,1)}) & (z2{(-1,-1)}..z21..z31);
+% the brim
+ z4=_chess_f(.5,.33); z5=_chess_f(.5,.23);
+ z41=_chess_f(.32,.28); reflect(41);
+ brim = ((z31--z41) & (z41..z5..z41') & (z41'--z31'));
+% the stole
+ z6=_chess_f(.5,.15); z7=_chess_f(.5,.3); z61=_chess_f(.44,.12); z62=_chess_f(.25,.1); z63=_chess_f(.15,.05);
+ z64=_chess_f(.09,.11); z65=_chess_f(.25,.18); z66=_chess_f(.44,.2);
+ reflect(61,62,63,64,65,66);
+ stole = ((z7..z66..z65..z64) & (z64--z63) & (z63..z62..z61..z6) &
+ (z6..z61'..z62'..z63') & (z63'--z64') & (z64'..z65'..z66'..z7) &cycle);
+% the mitre
+ mitre = (hat & brim & cycle);
+
+ if wb="black": fill mitre moved; fill stole moved;
+ else:
+ draw stole moved;
+ erase fill stole moved;
+ draw stole moved;
+
+ draw mitre moved;
+ erase fill mitre moved;
+ draw mitre moved;
+ fi;
+
+% inner parts of mitre
+ center_:=_chess_g(.59); width:=_chess_g(.065);
+ if wb="white": draw (z31..z3..z31') moved; draw (z41..z4..z41') moved;
+ draw (_chess_f(.5,center_-width)--_chess_f(.5,center_+width)) moved;
+ draw (_chess_f(.5-width,center_)--_chess_f(.5+width,center_)) moved;
+ else: pickup thick_pen;
+ erase cutdraw (opr(31)..z3..opl(31')) moved;
+ erase cutdraw (opr(41)..z4..opl(41')) moved;
+ erase cutdraw (_chess_f(.5,center_-width)--_chess_f(.5,center_+width)) moved;
+ erase cutdraw (_chess_f(.5-width,center_)--_chess_f(.5+width,center_)) moved;
+ fi;
+enddef;
+
+
+ def _skak_rookscale(expr x) = .5+(x-.5)*.95 enddef;
+ def _skak_j(expr x,y) = (_skak_rookscale(x)+figshift,_skak_rookscale(y)) enddef;
+
+vardef _skak_R(expr D, col, row,wb) =
+ clearxy;
+ path rook;
+ def moved = scaled D shifted (col*D, row*D) enddef;
+
+ pickup hairline_pen;
+% top part of rook
+ z1=_skak_j(.5,.86); y15=y14=y11=y1; x15=x16=_skak_rookscale(.21)+figshift;
+ x19=x20=_skak_rookscale(.225)+figshift; y13=y12=_skak_rookscale(.8);
+ y16=_skak_rookscale(.725); y17=_skak_rookscale(.65); y18=_skak_rookscale(.35); y19=_skak_rookscale(.26); y20=y21=_skak_rookscale(.175); y22=_skak_rookscale(.1);
+ x22=x21=_skak_rookscale(.175)+figshift; x17=x18=_skak_rookscale(.31)+figshift;
+ x13=x14=_skak_rookscale(.325)+figshift; x11=x12=_skak_rookscale(.43)+figshift;
+ z2=_skak_j(.5,.1);
+ reflect(11,12,13,14,15,16,17,18,19,20,21,22);
+ rook = (z11--z12--z13--z14--z15--z16--z17--z18--z19--z20--z21--z22--z22'
+ --z21'--z20'--z19'--z18'--z17'--z16'--z15'--z14'--z13'--z12'--z11'--cycle);
+% draw contour of rook
+
+ if wb="white": fill rook moved withcolor white; draw rook moved; else: fill rook moved; fi;
+% draw inner parts
+ if wb="white": draw (z16--z16') moved; draw (z17--z17') moved;
+ draw (z18--z18') moved; draw (z19--z19') moved;
+ draw (z20--z20') moved;
+ else: pickup thick_pen;
+ erase draw (opr(16)--opl(16')) moved;
+ erase draw (opr(17)--opl(17')) moved;
+ erase draw (opr(18)--opl(18')) moved;
+ erase draw (opr(19)--opl(19')) moved;
+ erase draw (opr(20)--opl(20')) moved; fi;
+ enddef;
+
+ vardef _skak_p(expr D, col, row,wb) =
+ clearxy;
+ path pawn;
+ def moved = scaled D shifted (col*D, row*D) enddef;
+
+ pickup hairline_pen;
+% the pawn's contour
+% z1=(.5,.9); z2=(.5,.1); z11=(.41,.85); z12=(.46,.73); z13=(.32,.6);
+% z14=(.41,.46); z15=(.3,.4); z16=(.2,.1);
+
+ z1=_chess_f(.5,.9);
+ z2=_chess_f(.5,.1); z11=_chess_f(.41,.85); z12=_chess_f(.46,.73); z13=_chess_f(.32,.6);
+ z14=_chess_f(.41,.46); z15=_chess_f(.3,.4); z16=_chess_f(.2,.1);
+ reflect(11,12,13,14,15,16);
+ pawn = ((z12'..z11'..z1..z11..z12) &
+ (z12..z13..z14) &
+ (z14..z15..z16) &
+ (z16--z16') &
+ (z16'..z15'..z14') &
+ (z14'..z13'..z12') & cycle);
+
+% draw contour of pawn
+
+ if wb="black": fill pawn moved;
+ else: fill pawn moved withcolor white; draw pawn moved; fi;
+enddef;
+
+picture _chess_skak_bB,_chess_skak_bK,_chess_skak_bN,_chess_skak_bP,_chess_skak_bQ,_chess_skak_bR;
+picture _chess_skak_wB,_chess_skak_wK,_chess_skak_wN,_chess_skak_wP,_chess_skak_wQ,_chess_skak_wR;
+
+_chess_skak_bB:=image(_skak_B(2cm,0,0,"black"));
+_chess_skak_bK:=image(_skak_K(2cm,0,0,"black"));
+_chess_skak_bN:=image(_skak_N(2cm,0,0,"black"));
+_chess_skak_bP:=image(_skak_p(2cm,0,0,"black"));
+_chess_skak_bQ:=image(_skak_Q(2cm,0,0,"black"));
+_chess_skak_bR:=image(_skak_R(2cm,0,0,"black"));
+
+_chess_skak_wB:=image(_skak_B(2cm,0,0,"white"));
+_chess_skak_wK:=image(_skak_K(2cm,0,0,"white"));
+_chess_skak_wN:=image(_skak_N(2cm,0,0,"white"));
+_chess_skak_wP:=image(_skak_p(2cm,0,0,"white"));
+_chess_skak_wQ:=image(_skak_Q(2cm,0,0,"white"));
+_chess_skak_wR:=image(_skak_R(2cm,0,0,"white")); \ No newline at end of file
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess-staunty.mp b/Master/texmf-dist/metapost/mpchess/mpchess-staunty.mp
new file mode 100644
index 00000000000..507448cb764
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess-staunty.mp
@@ -0,0 +1,1066 @@
+picture _chess_staunty_bB;
+
+
+_chess_staunty_bB:=image(
+color _chess_black;
+_chess_black:=(0.372549,0.349020,0.333333);
+drawoptions (withcolor _chess_black);
+%linecap := butt;
+pickup pencircle scaled 3.401580bp;
+fill (70.867203,125.383003)..controls (64.898399,125.383003) and (60.058601,122.890999)..(60.058601,119.816002)
+ --(64.359398,112.305000)..controls (18.867201,72.371101) and (48.183601,35.386700)..(48.183601,35.386700)
+ --(93.554703,35.386700)..controls (93.554703,35.386700) and (113.535004,59.968800)..(95.714798,90.691399)
+ --(87.242203,77.007797)..controls (85.339798,73.933601) and (81.675797,72.785202)..(79.027298,74.421898)
+ ..controls (76.375000,76.062500) and (75.773399,79.859398)..(77.675797,82.929703)
+ --(88.691399,100.723000)..controls (85.554703,104.539001) and (81.820297,108.402000)..(77.375000,112.305000)
+ --(81.675797,119.816002)..controls (81.675797,122.890999) and (76.835899,125.383003)..(70.867203,125.383003)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,125.383003)..controls (68.550797,125.383003) and (66.414101,125.003998)..(64.656303,124.371002)
+ ..controls (76.953102,121.964996) and (78.761703,121.198997)..(71.910202,112.039001)
+ --(81.113297,101.926003)..controls (70.746101,78.566399) and (76.566399,79.269501)..(76.566399,79.269501)
+ ..controls (76.566399,79.269501) and (78.539101,86.777298)..(88.222702,101.292999)
+ ..controls (85.183601,104.921997) and (81.593803,108.601997)..(77.375000,112.305000)
+ --(81.671898,119.816002)..controls (81.671898,122.890999) and (76.835899,125.383003)..(70.867203,125.383003)
+ --cycle;
+fill (95.714798,90.691399)--(92.851601,86.410202)..controls (103.445000,62.558601) and (81.132797,35.390598)..(81.132797,35.390598)
+ --(93.550797,35.390598)..controls (94.000000,35.292999) and (113.277000,60.460899)..(95.714798,90.699203)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (42.929699,51.812500)..controls (42.308601,51.902302) and (33.226601,79.550797)..(59.242199,104.964996)
+ ..controls (52.718800,99.593803) and (39.015598,67.652298)..(42.929699,51.812500)
+ --cycle;
+fill (66.023399,112.832001)--(61.835899,120.183998)..controls (61.835899,120.183998) and (62.523399,122.226997)..(66.886703,123.152000)
+ ..controls (61.992199,119.328003) and (64.085899,118.438004)..(66.023399,112.832001)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,125.383003)..controls (64.898399,125.383003) and (60.058601,122.890999)..(60.058601,119.816002)
+ --(64.359398,112.305000)..controls (18.867201,72.371101) and (48.183601,35.386700)..(48.183601,35.386700)
+ --(93.554703,35.386700)..controls (93.554703,35.386700) and (113.535004,59.968800)..(95.714798,90.691399)
+ --(87.242203,77.007797)..controls (85.339798,73.933601) and (81.675797,72.785202)..(79.027298,74.421898)
+ ..controls (76.375000,76.062500) and (75.773399,79.859398)..(77.675797,82.929703)
+ --(88.691399,100.723000)..controls (85.554703,104.539001) and (81.820297,108.402000)..(77.375000,112.305000)
+ --(81.675797,119.816002)..controls (81.675797,122.890999) and (76.835899,125.383003)..(70.867203,125.383003)
+ --cycle;
+drawoptions (withcolor _chess_black);
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 0.1*_chess_black);
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.984402,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+);
+
+picture _chess_staunty_bK;
+
+_chess_staunty_bK := image(
+color _chess_black;
+_chess_black:=(0.372549,0.349020,0.333333);
+
+%croix
+
+drawoptions (withcolor _chess_black);
+linejoin := mitered;
+fill (78.433601,98.578102)--(78.433601,108.621002)--(91.019501,108.621002)
+ --(91.019501,121.171997)--(77.031303,121.171997)--(77.031303,132.210999)
+ --(64.656303,132.210999)--(64.656303,121.171997)--(50.667999,121.171997)
+ --(50.667999,108.621002)--(63.253899,108.621002)--(63.253899,98.578102)
+ --cycle;
+ drawoptions (withcolor 0.8*_chess_black);
+fill (74.238297,132.210999)--(74.238297,121.176003)--(77.035202,121.176003)
+ --(77.035202,132.210999)--cycle;
+fill (86.824203,121.176003)--(86.824203,107.160004)--(91.019501,107.160004)
+ --(91.019501,121.176003)--cycle;
+fill (74.242203,108.621002)--(74.242203,101.555000)--(78.437500,101.555000)
+ --(78.437500,108.621002)--cycle;
+fill (74.242203,108.621002)--cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (78.433601,98.578102)--(78.433601,108.621002)--(91.019501,108.621002)
+ --(91.019501,121.171997)--(77.031303,121.171997)--(77.031303,132.210999)
+ --(64.656303,132.210999)--(64.656303,121.171997)--(50.667999,121.171997)
+ --(50.667999,108.621002)--(63.253899,108.621002)--(63.253899,98.578102);
+
+% support croix
+drawoptions (withcolor _chess_black);
+pickup pencircle scaled 0.000000bp;
+linecap := butt;
+linejoin := rounded;
+fill (61.492199,101.438004)--(80.230499,101.438004)..controls (82.417999,101.438004) and (84.179703,99.675797)..(84.179703,97.484398)
+ ..controls (84.179703,95.296898) and (82.417999,93.539101)..(80.230499,93.539101)
+ --(61.492199,93.539101)..controls (59.300800,93.539101) and (57.539101,95.296898)..(57.539101,97.484398)
+ ..controls (57.539101,99.675797) and (59.300800,101.438004)..(61.492199,101.438004)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (74.878899,101.438004)..controls (76.933601,101.438004) and (78.589798,99.675797)..(78.589798,97.484398)
+ ..controls (78.589798,95.296898) and (76.933601,93.539101)..(74.878899,93.539101)
+ --(80.472702,93.539101)..controls (82.527298,93.539101) and (84.183601,95.296898)..(84.183601,97.484398)
+ ..controls (84.183601,99.675797) and (82.527298,101.438004)..(80.472702,101.438004)
+ --cycle;
+ drawoptions (withcolor 1.7*_chess_black);
+fill (61.316399,99.664101)..controls (60.175800,99.664101) and (59.261700,98.679703)..(59.261700,97.468803)
+ ..controls (59.261700,96.253899) and (60.175800,95.285202)..(61.316399,95.285202)
+ --(63.792999,95.285202)..controls (62.656300,95.285202) and (61.738300,96.253899)..(61.738300,97.468803)
+ ..controls (61.738300,98.679703) and (62.656300,99.664101)..(63.792999,99.664101)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (61.492199,101.438004)--(80.230499,101.438004)..controls (82.417999,101.438004) and (84.179703,99.675797)..(84.179703,97.484398)
+ ..controls (84.179703,95.296898) and (82.417999,93.539101)..(80.230499,93.539101)
+ --(61.492199,93.539101)..controls (59.300800,93.539101) and (57.539101,95.296898)..(57.539101,97.484398)
+ ..controls (57.539101,99.675797) and (59.300800,101.438004)..(61.492199,101.438004)
+ --cycle;
+drawoptions (withcolor _chess_black);
+linecap := rounded;
+linejoin := mitered;
+fill (95.343803,36.886700)..controls (95.343803,36.886700) and (117.387001,74.640602)..(114.089996,82.003899)
+ ..controls (110.789001,89.367203) and (90.050797,94.753899)..(70.867203,94.753899)
+ ..controls (51.679699,94.753899) and (30.941401,89.371101)..(27.644501,82.003899)
+ ..controls (24.343800,74.644501) and (46.386700,36.886700)..(46.386700,36.886700)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.855499,94.746101)..controls (116.035004,87.312500) and (106.496002,68.226601)..(89.679703,30.843800)
+ --(95.425797,35.746101)..controls (95.425797,35.746101) and (117.387001,74.640602)..(114.089996,82.003899)
+ ..controls (109.707001,90.039101) and (92.820297,93.792999)..(70.855499,94.750000)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (95.343803,36.886700)..controls (95.343803,36.886700) and (117.387001,74.640602)..(114.089996,82.003899)
+ ..controls (110.789001,89.367203) and (90.050797,94.753899)..(70.867203,94.753899)
+ ..controls (51.679699,94.753899) and (30.941401,89.371101)..(27.644501,82.003899)
+ ..controls (24.343800,74.644501) and (46.386700,36.886700)..(46.386700,36.886700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (67.367203,92.710899)..controls (56.300800,93.226601) and (25.921900,87.597702)..(29.089800,78.484398)
+ ..controls (31.406300,67.921898) and (36.898399,57.953098)..(41.867199,48.710899)
+ ..controls (25.746099,78.003899) and (25.023399,87.753899)..(67.363297,92.710899)
+ --cycle;
+fill (67.367203,92.710899)--cycle;
+fill (66.304703,130.397995)--(66.257797,121.012001)--(67.804703,121.012001)
+ --(67.851601,130.397995)--cycle;
+fill (52.328098,119.430000)--(52.304699,110.339996)--(54.496101,110.339996)
+ --(54.519501,119.430000)--cycle;
+fill (64.835899,110.328003)--(64.910202,103.277000)--(66.382797,103.277000)
+ --(66.308601,110.328003)--cycle;
+fill (64.835899,110.328003)--cycle;
+drawoptions (withcolor _chess_black);
+linecap := butt;
+linejoin := rounded;
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.984402,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+);
+
+picture _chess_staunty_bN;
+
+_chess_staunty_bN:=image(
+color _chess_black;
+_chess_black:=(0.372549,0.349020,0.333333);
+
+drawoptions (withcolor _chess_black);
+linecap := butt;
+fill (71.410202,76.496101)..controls (70.941399,56.746101) and (38.082001,61.703098)..(38.765598,25.171900)
+ --(103.566002,24.835899)..controls (97.632797,43.097698) and (131.035004,96.160202)..(69.746101,116.277000)
+ ..controls (69.746101,116.277000) and (62.835899,123.648003)..(52.835899,124.285004)
+ --(53.468800,114.262001)--(40.546902,101.273003)..controls (33.093800,92.359398) and (15.785200,77.523399)..(18.574200,74.035202)
+ ..controls (27.406300,59.000000) and (36.519501,61.468800)..(36.519501,61.468800)
+ ..controls (48.542999,74.347702) and (53.015598,67.390602)..(71.410202,76.496101)
+ --cycle;
+
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (54.765598,100.082001)..controls (52.566399,97.636703) and (52.808601,96.917999)..(52.457001,93.984398)
+ ..controls (54.742199,93.632797) and (56.730499,93.304703)..(58.832001,93.796898)
+ ..controls (65.582001,97.378899) and (59.046902,103.441002)..(54.765598,100.082001)
+ --cycle;
+fill (26.054701,78.898399)..controls (23.648399,77.746101) and (23.226601,76.175797)..(23.058599,74.714798)
+ ..controls (25.125000,73.535202) and (28.378901,75.074203)..(28.847700,78.773399)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (23.218800,70.437500)..controls (23.218800,70.437500) and (25.066401,67.214798)..(20.093800,75.089798)
+ ..controls (21.960899,80.699203) and (43.515598,100.832001)..(55.351601,113.457001)
+ --(54.832001,122.207001)..controls (54.832001,122.207001) and (57.859402,117.414001)..(58.367199,112.375000)
+ ..controls (45.921902,99.925797) and (23.726601,81.667999)..(22.015600,74.921898)
+ ..controls (22.082001,73.007797) and (22.695299,72.003899)..(23.214800,70.437500)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (37.585899,61.632801)..controls (43.339802,71.089798) and (61.375000,70.769501)..(71.410202,76.496101)
+ ..controls (72.324203,76.207001) and (71.781303,72.609398)..(72.089798,73.003899)
+ ..controls (74.492203,76.097702) and (80.382797,82.300797)..(74.550797,92.496101)
+ ..controls (76.031303,75.605499) and (35.667999,76.644501)..(29.507799,63.285198)
+ ..controls (28.941401,62.046902) and (35.695301,61.035198)..(37.589802,61.632801)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (73.132797,74.324203)..controls (70.261703,57.839802) and (46.078098,56.980499)..(41.988300,38.492199)
+ ..controls (50.019501,56.644501) and (72.492203,54.683601)..(73.132797,74.324203)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (52.835899,124.285004)..controls (52.835899,124.285004) and (61.484402,122.188004)..(66.742203,112.996002)
+ ..controls (124.848000,92.714798) and (88.402298,33.800800)..(83.148399,24.914101)
+ --(103.566002,24.839800)..controls (97.933601,34.035198) and (130.632996,97.394501)..(69.746101,116.277000)
+ ..controls (64.714798,119.308998) and (61.902302,123.676003)..(52.835899,124.285004)
+ --cycle;
+ drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (71.410202,76.496101)..controls (70.941399,56.746101) and (38.082001,61.703098)..(38.765598,25.171900)
+ --(103.566002,24.835899)..controls (97.632797,43.097698) and (131.035004,96.160202)..(69.746101,116.277000)
+ ..controls (69.746101,116.277000) and (62.835899,123.648003)..(52.835899,124.285004)
+ --(53.468800,114.262001)--(40.546902,101.273003)..controls (33.093800,92.359398) and (15.785200,77.523399)..(18.574200,74.035202)
+ ..controls (27.406300,59.000000) and (36.519501,61.468800)..(36.519501,61.468800)
+ ..controls (48.542999,74.347702) and (53.015598,67.390602)..(71.410202,76.496101)
+ --cycle;
+drawoptions (withcolor _chess_black);
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.058599) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.984402,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.429699)..(70.867203,36.429699)
+ --cycle;
+);
+
+picture _chess_staunty_bP;
+_chess_staunty_bP:=image(
+color _chess_black;
+_chess_black:=(0.372549,0.349020,0.333333);
+
+drawoptions (withcolor _chess_black);
+linecap := butt;
+fill (60.953098,63.511700)--(80.781303,63.511700)--(53.859402,92.101601)
+ ..controls (53.859402,87.191399) and (55.878899,82.503899)..(59.429699,79.097702)
+ --(49.082001,73.148399)--(50.304699,63.511700)--(62.511700,63.511700)
+ ..controls (60.257801,53.421902) and (54.699200,42.730499)..(48.160198,39.085899)
+ ..controls (41.621101,35.437500) and (33.136700,30.308599)..(34.433601,15.875000)
+ --(107.301003,15.875000)..controls (108.598000,30.308599) and (100.112999,35.437500)..(93.574203,39.085899)
+ ..controls (87.035202,42.730499) and (81.476601,53.421902)..(79.226601,63.511700)
+ --(91.429703,63.511700)--(92.652298,73.144501)--(82.304703,79.097702)
+ ..controls (85.855499,82.503899) and (87.875000,87.191399)..(87.875000,92.101601)
+ ..controls (87.875000,101.644997) and (80.425797,108.859001)..(70.867203,108.859001)
+ ..controls (61.304699,108.859001) and (53.855499,101.644997)..(53.855499,92.101601)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.757797,109.027000)..controls (74.078102,110.332001) and (97.765602,92.289101)..(72.593803,78.492203)
+ --(85.382797,72.539101)--(83.789101,63.679699)--(91.324203,63.679699)
+ --(92.539101,73.312500)--(82.191399,79.265602)..controls (85.746101,82.667999) and (87.753899,86.585899)..(87.761703,91.496101)
+ ..controls (86.433601,106.844002) and (70.757797,109.027000)..(70.757797,109.027000)
+ --cycle;
+fill (62.402302,63.679699)..controls (75.164101,41.187500) and (89.246101,35.347698)..(99.460899,35.433601)
+ --(93.464798,39.253899)..controls (87.582001,43.472698) and (80.050797,53.019501)..(79.113297,63.679699)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (62.312500,78.765602)--(57.644501,72.117203)--(50.964802,72.152298)
+ --(62.343800,78.742203)--cycle;
+fill (62.312500,78.765602)--cycle;
+fill (68.902298,106.960999)..controls (61.695301,106.566002) and (52.660198,97.960899)..(56.472698,87.347702)
+ --(57.035198,85.523399)..controls (56.101601,95.417999) and (63.066399,105.703003)..(68.902298,106.960999)
+ --cycle;
+fill (50.636700,35.082001)..controls (39.343800,28.542999) and (36.128899,17.671900)..(36.128899,17.671900)
+ ..controls (36.101601,17.671900) and (34.578098,29.507799)..(47.343800,36.539101)
+ ..controls (60.113300,43.558601) and (61.011700,53.968800)..(63.957001,61.746101)
+ ..controls (62.152302,51.246101) and (61.929699,41.617199)..(50.636700,35.082001)
+ --cycle;
+
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (53.859402,92.101601)..controls (53.859402,87.191399) and (55.878899,82.503899)..(59.429699,79.097702)
+ --(49.082001,73.148399)--(50.304699,63.511700)--(62.511700,63.511700)
+ ..controls (60.257801,53.421902) and (54.699200,42.730499)..(48.160198,39.085899)
+ ..controls (41.621101,35.437500) and (33.136700,30.308599)..(34.433601,15.875000)
+ --(107.301003,15.875000)..controls (108.598000,30.308599) and (100.112999,35.437500)..(93.574203,39.085899)
+ ..controls (87.035202,42.730499) and (81.476601,53.421902)..(79.226601,63.511700)
+ --(91.429703,63.511700)--(92.652298,73.144501)--(82.304703,79.097702)
+ ..controls (85.855499,82.503899) and (87.875000,87.191399)..(87.875000,92.101601)
+ ..controls (87.875000,101.644997) and (80.425797,108.859001)..(70.867203,108.859001)
+ ..controls (61.304699,108.859001) and (53.855499,101.644997)..(53.855499,92.101601)
+ --cycle;
+ draw (60.953098,63.511700)--(80.781303,63.511700);
+);
+
+picture _chess_staunty_bQ;
+
+_chess_staunty_bQ:=image(
+color _chess_black;
+_chess_black:=(0.372549,0.349020,0.333333);
+
+drawoptions (withcolor _chess_black);
+fill (70.750000,127.292999)..controls (65.558601,127.292999) and (61.351601,123.539001)..(61.351601,118.910004)
+ ..controls (61.351601,114.273003) and (65.558601,110.519997)..(70.750000,110.519997)
+ ..controls (73.242203,110.519997) and (75.632797,111.402000)..(77.394501,112.976997)
+ ..controls (79.160202,114.546997) and (80.148399,116.680000)..(80.148399,118.910004)
+ ..controls (80.148399,121.128998) and (79.160202,123.262001)..(77.394501,124.835999)
+ ..controls (75.632797,126.414001) and (73.242203,127.292999)..(70.750000,127.292999)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.402298,125.480003)..controls (69.335899,126.078003) and (59.843800,123.198997)..(64.207001,115.348000)
+ ..controls (63.539101,119.726997) and (65.449203,124.426003)..(70.402298,125.480003)
+ --cycle;
+fill (70.402298,125.480003)--cycle;
+drawoptions (withcolor _chess_black);
+fill (70.750000,110.519997)..controls (52.304699,110.519997) and (43.550800,93.839798)..(43.550800,81.160202)
+ --(98.156303,81.160202)..controls (98.156303,93.839798) and (89.195297,110.519997)..(70.750000,110.519997)
+ --cycle;
+
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (51.480499,99.277298)..controls (54.433601,103.464996) and (59.757801,108.402000)..(70.871101,108.855003)
+ ..controls (69.988297,108.073997) and (57.296902,105.633003)..(51.480499,99.277298)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (70.402298,127.542999)..controls (70.402298,127.542999) and (70.531303,126.866997)..(70.402298,127.542999)
+ ..controls (77.429703,124.339996) and (76.210899,116.633003)..(72.718803,111.816002)
+ ..controls (93.562500,101.035004) and (78.988297,87.246101)..(78.988297,87.246101)
+ --(86.644501,87.246101)..controls (91.640602,83.593803) and (107.078003,95.011703)..(75.773399,111.816002)
+ ..controls (85.773399,120.648003) and (76.046898,127.710999)..(70.402298,127.542999)
+ --cycle;
+ drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.750000,110.519997)..controls (52.304699,110.519997) and (43.550800,93.839798)..(43.550800,81.160202)
+ --(98.156303,81.160202)..controls (98.156303,93.839798) and (89.195297,110.519997)..(70.750000,110.519997)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401290bp;
+draw (70.750000,127.292999)..controls (65.558601,127.292999) and (61.351601,123.539001)..(61.351601,118.910004)
+ ..controls (61.351601,114.273003) and (65.558601,110.519997)..(70.750000,110.519997)
+ ..controls (73.242203,110.519997) and (75.632797,111.402000)..(77.394501,112.976997)
+ ..controls (79.160202,114.546997) and (80.148399,116.680000)..(80.148399,118.910004)
+ ..controls (80.148399,121.128998) and (79.160202,123.262001)..(77.394501,124.835999)
+ ..controls (75.632797,126.414001) and (73.242203,127.292999)..(70.750000,127.292999)
+ --cycle;
+
+drawoptions (withcolor _chess_black);
+fill (70.867203,98.578102)..controls (65.277298,98.578102) and (64.210899,91.062500)..(59.140598,90.468803)
+ ..controls (53.976601,89.867203) and (49.554699,97.019501)..(44.257801,95.390602)
+ ..controls (40.019501,94.085899) and (42.050800,88.019501)..(39.140598,86.390602)
+ ..controls (35.167999,84.167999) and (30.113300,91.585899)..(24.144501,87.234398)
+ ..controls (43.527302,62.210899) and (47.066399,52.148399)..(46.773399,33.890598)
+ --(94.957001,33.890598)..controls (94.664101,52.152302) and (98.203102,62.210899)..(117.585999,87.234398)
+ ..controls (111.616997,91.585899) and (106.563004,84.167999)..(102.589996,86.390602)
+ ..controls (99.679703,88.019501) and (101.710999,94.085899)..(97.472702,95.390602)
+ ..controls (92.175797,97.019501) and (87.753899,89.867203)..(82.589798,90.468803)
+ ..controls (77.519501,91.062500) and (76.453102,98.578102)..(70.863297,98.578102)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (28.050800,86.914101)..controls (27.664101,86.937500) and (27.109400,86.753899)..(26.750000,86.671898)
+ ..controls (35.484402,75.046898) and (45.386700,59.632801)..(46.871101,51.468800)
+ ..controls (42.886700,65.457001) and (37.613300,78.578102)..(29.468800,86.828102)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (113.313004,88.628899)..controls (86.425797,60.269501) and (85.179703,37.640598)..(65.289101,33.886700)
+ --(94.984398,33.886700)..controls (94.695297,52.148399) and (98.230499,62.210899)..(117.616997,87.230499)
+ ..controls (117.616997,87.230499) and (115.664001,89.378899)..(113.313004,88.628899)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401290bp;
+draw (70.867203,98.578102)..controls (65.277298,98.578102) and (64.210899,91.062500)..(59.140598,90.468803)
+ ..controls (53.976601,89.867203) and (49.554699,97.019501)..(44.257801,95.390602)
+ ..controls (40.019501,94.085899) and (42.050800,88.019501)..(39.140598,86.390602)
+ ..controls (35.167999,84.167999) and (30.113300,91.585899)..(24.144501,87.234398)
+ ..controls (43.527302,62.210899) and (47.066399,52.148399)..(46.773399,33.890598)
+ --(94.957001,33.890598)..controls (94.664101,52.152302) and (98.203102,62.210899)..(117.585999,87.234398)
+ ..controls (111.616997,91.585899) and (106.563004,84.167999)..(102.589996,86.390602)
+ ..controls (99.679703,88.019501) and (101.710999,94.085899)..(97.472702,95.390602)
+ ..controls (92.175797,97.019501) and (87.753899,89.867203)..(82.589798,90.468803)
+ ..controls (77.519501,91.062500) and (76.453102,98.578102)..(70.863297,98.578102)
+ --cycle;
+
+drawoptions (withcolor 1.7*_chess_black);
+fill (42.269501,88.027298)..controls (42.843800,88.277298) and (45.625000,93.152298)..(47.882801,93.554703)
+ ..controls (43.859402,94.539101) and (43.296902,93.687500)..(42.269501,88.027298)
+ --cycle;
+fill (63.812500,91.058601)..controls (66.511703,93.460899) and (68.441399,98.585899)..(72.988297,96.292999)
+ ..controls (70.726601,96.937500) and (66.710899,93.339798)..(63.812500,91.058601)
+ --cycle;
+fill (88.214798,90.332001)..controls (88.808601,90.132797) and (94.382797,94.984398)..(96.328102,93.785202)
+ ..controls (96.328102,93.785202) and (92.269501,90.609398)..(88.214798,90.332001)
+ --cycle;
+drawoptions (withcolor _chess_black);
+linecap := butt;
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.980499,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+);
+
+picture _chess_staunty_bR;
+_chess_staunty_bR:=image(
+color _chess_black;
+_chess_black:=(0.372549,0.349020,0.333333);
+
+drawoptions (withcolor _chess_black);
+linecap := butt;
+linejoin := mitered;
+fill (40.203098,114.344002)..controls (37.203098,89.496101) and (43.332001,84.082001)..(50.828098,83.867203)
+ --(41.429699,32.390598)--(100.296997,32.390598)--(90.898399,83.867203)
+ ..controls (98.398399,84.078102) and (104.527000,89.496101)..(101.523003,114.344002)
+ --(91.300797,115.844002)--(88.257797,105.515999)--(79.351601,105.796997)
+ --(77.871101,116.441002)--(63.855499,116.441002)--(62.378899,105.796997)
+ --(53.468800,105.515999)--(50.429699,115.844002)--cycle;
+
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (50.832001,83.867203)..controls (70.187500,83.867203) and (88.015602,82.710899)..(93.203102,36.886700)
+ --(99.777298,35.792999)--(90.898399,82.367203)..controls (90.812500,83.234398) and (73.644501,87.527298)..(50.828098,83.867203)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (41.886700,112.762001)--(48.339802,113.578003)..controls (42.917999,112.691002) and (41.785198,98.562500)..(41.785198,98.562500)
+ ..controls (41.109402,99.062500) and (41.250000,112.460999)..(41.886700,112.762001)
+ --cycle;
+fill (71.648399,114.660004)..controls (66.976601,114.660004) and (64.507797,106.875000)..(64.507797,106.875000)
+ --(65.464798,114.605003)--cycle;
+fill (92.609398,113.910004)--(95.257797,113.573997)..controls (93.035202,112.152000) and (90.750000,107.933998)..(90.750000,107.933998)
+ --cycle;
+fill (52.363300,82.304703)--(59.789101,83.136703)..controls (52.363300,82.304703) and (45.910198,46.136700)..(45.882801,45.964802)
+ --cycle;
+
+drawoptions (withcolor 0.8*_chess_black);
+fill (96.414101,115.089996)..controls (97.425797,97.050797) and (90.886703,85.039101)..(73.621101,85.226601)
+ --(87.164101,83.628899)..controls (108.487999,82.753899) and (101.625000,114.258003)..(101.527000,114.339996)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (50.832001,83.867203)..controls (64.738297,85.964798) and (77.984398,85.503899)..(90.902298,83.867203);
+draw (40.203098,114.344002)..controls (37.203098,89.496101) and (43.332001,84.082001)..(50.828098,83.867203)
+ --(41.429699,32.390598)--(100.296997,32.390598)--(90.898399,83.867203)
+ ..controls (98.398399,84.078102) and (104.527000,89.496101)..(101.523003,114.344002)
+ --(91.300797,115.844002)--(88.257797,105.515999)--(79.351601,105.796997)
+ --(77.871101,116.441002)--(63.855499,116.441002)--(62.378899,105.796997)
+ --(53.468800,105.515999)--(50.429699,115.844002)--cycle;
+
+ drawoptions (withcolor _chess_black);
+linejoin := rounded;
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.828098)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.773399)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.179701)
+ ..controls (44.980499,34.632801) and (70.867203,34.769501)..(70.867203,34.769501)
+ ..controls (70.867203,34.769501) and (96.750000,34.632801)..(104.008003,30.179701)
+ ..controls (105.116997,29.503901) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,31.000000)..(103.191002,32.242199)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+);
+
+picture _chess_staunty_wB;
+_chess_staunty_wB:= image(
+color _chess_black;
+_chess_black:=(0.941176,0.941176,0.941176);
+
+drawoptions (withcolor _chess_black);
+%linecap := butt;
+pickup pencircle scaled 3.401580bp;
+fill (70.867203,125.383003)..controls (64.898399,125.383003) and (60.058601,122.890999)..(60.058601,119.816002)
+ --(64.359398,112.305000)..controls (18.867201,72.371101) and (48.183601,35.386700)..(48.183601,35.386700)
+ --(93.554703,35.386700)..controls (93.554703,35.386700) and (113.535004,59.968800)..(95.714798,90.691399)
+ --(87.242203,77.007797)..controls (85.339798,73.933601) and (81.675797,72.785202)..(79.027298,74.421898)
+ ..controls (76.375000,76.062500) and (75.773399,79.859398)..(77.675797,82.929703)
+ --(88.691399,100.723000)..controls (85.554703,104.539001) and (81.820297,108.402000)..(77.375000,112.305000)
+ --(81.675797,119.816002)..controls (81.675797,122.890999) and (76.835899,125.383003)..(70.867203,125.383003)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,125.383003)..controls (68.550797,125.383003) and (66.414101,125.003998)..(64.656303,124.371002)
+ ..controls (76.953102,121.964996) and (78.761703,121.198997)..(71.910202,112.039001)
+ --(81.113297,101.926003)..controls (70.746101,78.566399) and (76.566399,79.269501)..(76.566399,79.269501)
+ ..controls (76.566399,79.269501) and (78.539101,86.777298)..(88.222702,101.292999)
+ ..controls (85.183601,104.921997) and (81.593803,108.601997)..(77.375000,112.305000)
+ --(81.671898,119.816002)..controls (81.671898,122.890999) and (76.835899,125.383003)..(70.867203,125.383003)
+ --cycle;
+fill (95.714798,90.691399)--(92.851601,86.410202)..controls (103.445000,62.558601) and (81.132797,35.390598)..(81.132797,35.390598)
+ --(93.550797,35.390598)..controls (94.000000,35.292999) and (113.277000,60.460899)..(95.714798,90.699203)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (42.929699,51.812500)..controls (42.308601,51.902302) and (33.226601,79.550797)..(59.242199,104.964996)
+ ..controls (52.718800,99.593803) and (39.015598,67.652298)..(42.929699,51.812500)
+ --cycle;
+fill (66.023399,112.832001)--(61.835899,120.183998)..controls (61.835899,120.183998) and (62.523399,122.226997)..(66.886703,123.152000)
+ ..controls (61.992199,119.328003) and (64.085899,118.438004)..(66.023399,112.832001)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,125.383003)..controls (64.898399,125.383003) and (60.058601,122.890999)..(60.058601,119.816002)
+ --(64.359398,112.305000)..controls (18.867201,72.371101) and (48.183601,35.386700)..(48.183601,35.386700)
+ --(93.554703,35.386700)..controls (93.554703,35.386700) and (113.535004,59.968800)..(95.714798,90.691399)
+ --(87.242203,77.007797)..controls (85.339798,73.933601) and (81.675797,72.785202)..(79.027298,74.421898)
+ ..controls (76.375000,76.062500) and (75.773399,79.859398)..(77.675797,82.929703)
+ --(88.691399,100.723000)..controls (85.554703,104.539001) and (81.820297,108.402000)..(77.375000,112.305000)
+ --(81.675797,119.816002)..controls (81.675797,122.890999) and (76.835899,125.383003)..(70.867203,125.383003)
+ --cycle;
+drawoptions (withcolor _chess_black);
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 0.1*_chess_black);
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.984402,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+);
+
+picture _chess_staunty_wK;
+
+_chess_staunty_wK:=image(
+color _chess_black;
+_chess_black:=(0.941176,0.941176,0.941176);
+
+
+drawoptions (withcolor _chess_black);
+linejoin := mitered;
+fill (78.433601,98.578102)--(78.433601,108.621002)--(91.019501,108.621002)
+ --(91.019501,121.171997)--(77.031303,121.171997)--(77.031303,132.210999)
+ --(64.656303,132.210999)--(64.656303,121.171997)--(50.667999,121.171997)
+ --(50.667999,108.621002)--(63.253899,108.621002)--(63.253899,98.578102)
+ --cycle;
+ drawoptions (withcolor 0.8*_chess_black);
+fill (74.238297,132.210999)--(74.238297,121.176003)--(77.035202,121.176003)
+ --(77.035202,132.210999)--cycle;
+fill (86.824203,121.176003)--(86.824203,107.160004)--(91.019501,107.160004)
+ --(91.019501,121.176003)--cycle;
+fill (74.242203,108.621002)--(74.242203,101.555000)--(78.437500,101.555000)
+ --(78.437500,108.621002)--cycle;
+fill (74.242203,108.621002)--cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (78.433601,98.578102)--(78.433601,108.621002)--(91.019501,108.621002)
+ --(91.019501,121.171997)--(77.031303,121.171997)--(77.031303,132.210999)
+ --(64.656303,132.210999)--(64.656303,121.171997)--(50.667999,121.171997)
+ --(50.667999,108.621002)--(63.253899,108.621002)--(63.253899,98.578102);
+
+% support croix
+drawoptions (withcolor _chess_black);
+pickup pencircle scaled 0.000000bp;
+linecap := butt;
+linejoin := rounded;
+fill (61.492199,101.438004)--(80.230499,101.438004)..controls (82.417999,101.438004) and (84.179703,99.675797)..(84.179703,97.484398)
+ ..controls (84.179703,95.296898) and (82.417999,93.539101)..(80.230499,93.539101)
+ --(61.492199,93.539101)..controls (59.300800,93.539101) and (57.539101,95.296898)..(57.539101,97.484398)
+ ..controls (57.539101,99.675797) and (59.300800,101.438004)..(61.492199,101.438004)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (74.878899,101.438004)..controls (76.933601,101.438004) and (78.589798,99.675797)..(78.589798,97.484398)
+ ..controls (78.589798,95.296898) and (76.933601,93.539101)..(74.878899,93.539101)
+ --(80.472702,93.539101)..controls (82.527298,93.539101) and (84.183601,95.296898)..(84.183601,97.484398)
+ ..controls (84.183601,99.675797) and (82.527298,101.438004)..(80.472702,101.438004)
+ --cycle;
+ drawoptions (withcolor 1.7*_chess_black);
+fill (61.316399,99.664101)..controls (60.175800,99.664101) and (59.261700,98.679703)..(59.261700,97.468803)
+ ..controls (59.261700,96.253899) and (60.175800,95.285202)..(61.316399,95.285202)
+ --(63.792999,95.285202)..controls (62.656300,95.285202) and (61.738300,96.253899)..(61.738300,97.468803)
+ ..controls (61.738300,98.679703) and (62.656300,99.664101)..(63.792999,99.664101)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (61.492199,101.438004)--(80.230499,101.438004)..controls (82.417999,101.438004) and (84.179703,99.675797)..(84.179703,97.484398)
+ ..controls (84.179703,95.296898) and (82.417999,93.539101)..(80.230499,93.539101)
+ --(61.492199,93.539101)..controls (59.300800,93.539101) and (57.539101,95.296898)..(57.539101,97.484398)
+ ..controls (57.539101,99.675797) and (59.300800,101.438004)..(61.492199,101.438004)
+ --cycle;
+drawoptions (withcolor _chess_black);
+linecap := rounded;
+linejoin := mitered;
+fill (95.343803,36.886700)..controls (95.343803,36.886700) and (117.387001,74.640602)..(114.089996,82.003899)
+ ..controls (110.789001,89.367203) and (90.050797,94.753899)..(70.867203,94.753899)
+ ..controls (51.679699,94.753899) and (30.941401,89.371101)..(27.644501,82.003899)
+ ..controls (24.343800,74.644501) and (46.386700,36.886700)..(46.386700,36.886700)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.855499,94.746101)..controls (116.035004,87.312500) and (106.496002,68.226601)..(89.679703,30.843800)
+ --(95.425797,35.746101)..controls (95.425797,35.746101) and (117.387001,74.640602)..(114.089996,82.003899)
+ ..controls (109.707001,90.039101) and (92.820297,93.792999)..(70.855499,94.750000)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (95.343803,36.886700)..controls (95.343803,36.886700) and (117.387001,74.640602)..(114.089996,82.003899)
+ ..controls (110.789001,89.367203) and (90.050797,94.753899)..(70.867203,94.753899)
+ ..controls (51.679699,94.753899) and (30.941401,89.371101)..(27.644501,82.003899)
+ ..controls (24.343800,74.644501) and (46.386700,36.886700)..(46.386700,36.886700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (67.367203,92.710899)..controls (56.300800,93.226601) and (25.921900,87.597702)..(29.089800,78.484398)
+ ..controls (31.406300,67.921898) and (36.898399,57.953098)..(41.867199,48.710899)
+ ..controls (25.746099,78.003899) and (25.023399,87.753899)..(67.363297,92.710899)
+ --cycle;
+fill (67.367203,92.710899)--cycle;
+fill (66.304703,130.397995)--(66.257797,121.012001)--(67.804703,121.012001)
+ --(67.851601,130.397995)--cycle;
+fill (52.328098,119.430000)--(52.304699,110.339996)--(54.496101,110.339996)
+ --(54.519501,119.430000)--cycle;
+fill (64.835899,110.328003)--(64.910202,103.277000)--(66.382797,103.277000)
+ --(66.308601,110.328003)--cycle;
+fill (64.835899,110.328003)--cycle;
+drawoptions (withcolor _chess_black);
+linecap := butt;
+linejoin := rounded;
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.984402,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+);
+
+picture _chess_staunty_wN;
+_chess_staunty_wN:=image(
+ color _chess_black;
+_chess_black:=(0.941176,0.941176,0.941176);
+
+drawoptions (withcolor _chess_black);
+linecap := butt;
+fill (71.410202,76.496101)..controls (70.941399,56.746101) and (38.082001,61.703098)..(38.765598,25.171900)
+ --(103.566002,24.835899)..controls (97.632797,43.097698) and (131.035004,96.160202)..(69.746101,116.277000)
+ ..controls (69.746101,116.277000) and (62.835899,123.648003)..(52.835899,124.285004)
+ --(53.468800,114.262001)--(40.546902,101.273003)..controls (33.093800,92.359398) and (15.785200,77.523399)..(18.574200,74.035202)
+ ..controls (27.406300,59.000000) and (36.519501,61.468800)..(36.519501,61.468800)
+ ..controls (48.542999,74.347702) and (53.015598,67.390602)..(71.410202,76.496101)
+ --cycle;
+
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (54.765598,100.082001)..controls (52.566399,97.636703) and (52.808601,96.917999)..(52.457001,93.984398)
+ ..controls (54.742199,93.632797) and (56.730499,93.304703)..(58.832001,93.796898)
+ ..controls (65.582001,97.378899) and (59.046902,103.441002)..(54.765598,100.082001)
+ --cycle;
+fill (26.054701,78.898399)..controls (23.648399,77.746101) and (23.226601,76.175797)..(23.058599,74.714798)
+ ..controls (25.125000,73.535202) and (28.378901,75.074203)..(28.847700,78.773399)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (23.218800,70.437500)..controls (23.218800,70.437500) and (25.066401,67.214798)..(20.093800,75.089798)
+ ..controls (21.960899,80.699203) and (43.515598,100.832001)..(55.351601,113.457001)
+ --(54.832001,122.207001)..controls (54.832001,122.207001) and (57.859402,117.414001)..(58.367199,112.375000)
+ ..controls (45.921902,99.925797) and (23.726601,81.667999)..(22.015600,74.921898)
+ ..controls (22.082001,73.007797) and (22.695299,72.003899)..(23.214800,70.437500)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (37.585899,61.632801)..controls (43.339802,71.089798) and (61.375000,70.769501)..(71.410202,76.496101)
+ ..controls (72.324203,76.207001) and (71.781303,72.609398)..(72.089798,73.003899)
+ ..controls (74.492203,76.097702) and (80.382797,82.300797)..(74.550797,92.496101)
+ ..controls (76.031303,75.605499) and (35.667999,76.644501)..(29.507799,63.285198)
+ ..controls (28.941401,62.046902) and (35.695301,61.035198)..(37.589802,61.632801)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (73.132797,74.324203)..controls (70.261703,57.839802) and (46.078098,56.980499)..(41.988300,38.492199)
+ ..controls (50.019501,56.644501) and (72.492203,54.683601)..(73.132797,74.324203)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (52.835899,124.285004)..controls (52.835899,124.285004) and (61.484402,122.188004)..(66.742203,112.996002)
+ ..controls (124.848000,92.714798) and (88.402298,33.800800)..(83.148399,24.914101)
+ --(103.566002,24.839800)..controls (97.933601,34.035198) and (130.632996,97.394501)..(69.746101,116.277000)
+ ..controls (64.714798,119.308998) and (61.902302,123.676003)..(52.835899,124.285004)
+ --cycle;
+ drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (71.410202,76.496101)..controls (70.941399,56.746101) and (38.082001,61.703098)..(38.765598,25.171900)
+ --(103.566002,24.835899)..controls (97.632797,43.097698) and (131.035004,96.160202)..(69.746101,116.277000)
+ ..controls (69.746101,116.277000) and (62.835899,123.648003)..(52.835899,124.285004)
+ --(53.468800,114.262001)--(40.546902,101.273003)..controls (33.093800,92.359398) and (15.785200,77.523399)..(18.574200,74.035202)
+ ..controls (27.406300,59.000000) and (36.519501,61.468800)..(36.519501,61.468800)
+ ..controls (48.542999,74.347702) and (53.015598,67.390602)..(71.410202,76.496101)
+ --cycle;
+drawoptions (withcolor _chess_black);
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.453100)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.058599) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.984402,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.429699)..(70.867203,36.429699)
+ --cycle;
+);
+
+picture _chess_staunty_wP;
+
+_chess_staunty_wP:=image(
+color _chess_black;
+_chess_black:=(0.941176,0.941176,0.941176);
+
+drawoptions (withcolor _chess_black);
+linecap := butt;
+fill (60.953098,63.511700)--(80.781303,63.511700)--(53.859402,92.101601)
+ ..controls (53.859402,87.191399) and (55.878899,82.503899)..(59.429699,79.097702)
+ --(49.082001,73.148399)--(50.304699,63.511700)--(62.511700,63.511700)
+ ..controls (60.257801,53.421902) and (54.699200,42.730499)..(48.160198,39.085899)
+ ..controls (41.621101,35.437500) and (33.136700,30.308599)..(34.433601,15.875000)
+ --(107.301003,15.875000)..controls (108.598000,30.308599) and (100.112999,35.437500)..(93.574203,39.085899)
+ ..controls (87.035202,42.730499) and (81.476601,53.421902)..(79.226601,63.511700)
+ --(91.429703,63.511700)--(92.652298,73.144501)--(82.304703,79.097702)
+ ..controls (85.855499,82.503899) and (87.875000,87.191399)..(87.875000,92.101601)
+ ..controls (87.875000,101.644997) and (80.425797,108.859001)..(70.867203,108.859001)
+ ..controls (61.304699,108.859001) and (53.855499,101.644997)..(53.855499,92.101601)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.757797,109.027000)..controls (74.078102,110.332001) and (97.765602,92.289101)..(72.593803,78.492203)
+ --(85.382797,72.539101)--(83.789101,63.679699)--(91.324203,63.679699)
+ --(92.539101,73.312500)--(82.191399,79.265602)..controls (85.746101,82.667999) and (87.753899,86.585899)..(87.761703,91.496101)
+ ..controls (86.433601,106.844002) and (70.757797,109.027000)..(70.757797,109.027000)
+ --cycle;
+fill (62.402302,63.679699)..controls (75.164101,41.187500) and (89.246101,35.347698)..(99.460899,35.433601)
+ --(93.464798,39.253899)..controls (87.582001,43.472698) and (80.050797,53.019501)..(79.113297,63.679699)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (62.312500,78.765602)--(57.644501,72.117203)--(50.964802,72.152298)
+ --(62.343800,78.742203)--cycle;
+fill (62.312500,78.765602)--cycle;
+fill (68.902298,106.960999)..controls (61.695301,106.566002) and (52.660198,97.960899)..(56.472698,87.347702)
+ --(57.035198,85.523399)..controls (56.101601,95.417999) and (63.066399,105.703003)..(68.902298,106.960999)
+ --cycle;
+fill (50.636700,35.082001)..controls (39.343800,28.542999) and (36.128899,17.671900)..(36.128899,17.671900)
+ ..controls (36.101601,17.671900) and (34.578098,29.507799)..(47.343800,36.539101)
+ ..controls (60.113300,43.558601) and (61.011700,53.968800)..(63.957001,61.746101)
+ ..controls (62.152302,51.246101) and (61.929699,41.617199)..(50.636700,35.082001)
+ --cycle;
+
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (53.859402,92.101601)..controls (53.859402,87.191399) and (55.878899,82.503899)..(59.429699,79.097702)
+ --(49.082001,73.148399)--(50.304699,63.511700)--(62.511700,63.511700)
+ ..controls (60.257801,53.421902) and (54.699200,42.730499)..(48.160198,39.085899)
+ ..controls (41.621101,35.437500) and (33.136700,30.308599)..(34.433601,15.875000)
+ --(107.301003,15.875000)..controls (108.598000,30.308599) and (100.112999,35.437500)..(93.574203,39.085899)
+ ..controls (87.035202,42.730499) and (81.476601,53.421902)..(79.226601,63.511700)
+ --(91.429703,63.511700)--(92.652298,73.144501)--(82.304703,79.097702)
+ ..controls (85.855499,82.503899) and (87.875000,87.191399)..(87.875000,92.101601)
+ ..controls (87.875000,101.644997) and (80.425797,108.859001)..(70.867203,108.859001)
+ ..controls (61.304699,108.859001) and (53.855499,101.644997)..(53.855499,92.101601)
+ --cycle;
+ draw (60.953098,63.511700)--(80.781303,63.511700);
+);
+
+picture _chess_staunty_wQ;
+
+_chess_staunty_wQ:=image(
+ color _chess_black;
+_chess_black:=(0.941176,0.941176,0.941176);
+
+drawoptions (withcolor _chess_black);
+fill (70.750000,127.292999)..controls (65.558601,127.292999) and (61.351601,123.539001)..(61.351601,118.910004)
+ ..controls (61.351601,114.273003) and (65.558601,110.519997)..(70.750000,110.519997)
+ ..controls (73.242203,110.519997) and (75.632797,111.402000)..(77.394501,112.976997)
+ ..controls (79.160202,114.546997) and (80.148399,116.680000)..(80.148399,118.910004)
+ ..controls (80.148399,121.128998) and (79.160202,123.262001)..(77.394501,124.835999)
+ ..controls (75.632797,126.414001) and (73.242203,127.292999)..(70.750000,127.292999)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.402298,125.480003)..controls (69.335899,126.078003) and (59.843800,123.198997)..(64.207001,115.348000)
+ ..controls (63.539101,119.726997) and (65.449203,124.426003)..(70.402298,125.480003)
+ --cycle;
+fill (70.402298,125.480003)--cycle;
+drawoptions (withcolor _chess_black);
+fill (70.750000,110.519997)..controls (52.304699,110.519997) and (43.550800,93.839798)..(43.550800,81.160202)
+ --(98.156303,81.160202)..controls (98.156303,93.839798) and (89.195297,110.519997)..(70.750000,110.519997)
+ --cycle;
+
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (51.480499,99.277298)..controls (54.433601,103.464996) and (59.757801,108.402000)..(70.871101,108.855003)
+ ..controls (69.988297,108.073997) and (57.296902,105.633003)..(51.480499,99.277298)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (70.402298,127.542999)..controls (70.402298,127.542999) and (70.531303,126.866997)..(70.402298,127.542999)
+ ..controls (77.429703,124.339996) and (76.210899,116.633003)..(72.718803,111.816002)
+ ..controls (93.562500,101.035004) and (78.988297,87.246101)..(78.988297,87.246101)
+ --(86.644501,87.246101)..controls (91.640602,83.593803) and (107.078003,95.011703)..(75.773399,111.816002)
+ ..controls (85.773399,120.648003) and (76.046898,127.710999)..(70.402298,127.542999)
+ --cycle;
+ drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.750000,110.519997)..controls (52.304699,110.519997) and (43.550800,93.839798)..(43.550800,81.160202)
+ --(98.156303,81.160202)..controls (98.156303,93.839798) and (89.195297,110.519997)..(70.750000,110.519997)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401290bp;
+draw (70.750000,127.292999)..controls (65.558601,127.292999) and (61.351601,123.539001)..(61.351601,118.910004)
+ ..controls (61.351601,114.273003) and (65.558601,110.519997)..(70.750000,110.519997)
+ ..controls (73.242203,110.519997) and (75.632797,111.402000)..(77.394501,112.976997)
+ ..controls (79.160202,114.546997) and (80.148399,116.680000)..(80.148399,118.910004)
+ ..controls (80.148399,121.128998) and (79.160202,123.262001)..(77.394501,124.835999)
+ ..controls (75.632797,126.414001) and (73.242203,127.292999)..(70.750000,127.292999)
+ --cycle;
+
+drawoptions (withcolor _chess_black);
+fill (70.867203,98.578102)..controls (65.277298,98.578102) and (64.210899,91.062500)..(59.140598,90.468803)
+ ..controls (53.976601,89.867203) and (49.554699,97.019501)..(44.257801,95.390602)
+ ..controls (40.019501,94.085899) and (42.050800,88.019501)..(39.140598,86.390602)
+ ..controls (35.167999,84.167999) and (30.113300,91.585899)..(24.144501,87.234398)
+ ..controls (43.527302,62.210899) and (47.066399,52.148399)..(46.773399,33.890598)
+ --(94.957001,33.890598)..controls (94.664101,52.152302) and (98.203102,62.210899)..(117.585999,87.234398)
+ ..controls (111.616997,91.585899) and (106.563004,84.167999)..(102.589996,86.390602)
+ ..controls (99.679703,88.019501) and (101.710999,94.085899)..(97.472702,95.390602)
+ ..controls (92.175797,97.019501) and (87.753899,89.867203)..(82.589798,90.468803)
+ ..controls (77.519501,91.062500) and (76.453102,98.578102)..(70.863297,98.578102)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (28.050800,86.914101)..controls (27.664101,86.937500) and (27.109400,86.753899)..(26.750000,86.671898)
+ ..controls (35.484402,75.046898) and (45.386700,59.632801)..(46.871101,51.468800)
+ ..controls (42.886700,65.457001) and (37.613300,78.578102)..(29.468800,86.828102)
+ --cycle;
+drawoptions (withcolor 0.8*_chess_black);
+fill (113.313004,88.628899)..controls (86.425797,60.269501) and (85.179703,37.640598)..(65.289101,33.886700)
+ --(94.984398,33.886700)..controls (94.695297,52.148399) and (98.230499,62.210899)..(117.616997,87.230499)
+ ..controls (117.616997,87.230499) and (115.664001,89.378899)..(113.313004,88.628899)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401290bp;
+draw (70.867203,98.578102)..controls (65.277298,98.578102) and (64.210899,91.062500)..(59.140598,90.468803)
+ ..controls (53.976601,89.867203) and (49.554699,97.019501)..(44.257801,95.390602)
+ ..controls (40.019501,94.085899) and (42.050800,88.019501)..(39.140598,86.390602)
+ ..controls (35.167999,84.167999) and (30.113300,91.585899)..(24.144501,87.234398)
+ ..controls (43.527302,62.210899) and (47.066399,52.148399)..(46.773399,33.890598)
+ --(94.957001,33.890598)..controls (94.664101,52.152302) and (98.203102,62.210899)..(117.585999,87.234398)
+ ..controls (111.616997,91.585899) and (106.563004,84.167999)..(102.589996,86.390602)
+ ..controls (99.679703,88.019501) and (101.710999,94.085899)..(97.472702,95.390602)
+ ..controls (92.175797,97.019501) and (87.753899,89.867203)..(82.589798,90.468803)
+ ..controls (77.519501,91.062500) and (76.453102,98.578102)..(70.863297,98.578102)
+ --cycle;
+
+drawoptions (withcolor 1.7*_chess_black);
+fill (42.269501,88.027298)..controls (42.843800,88.277298) and (45.625000,93.152298)..(47.882801,93.554703)
+ ..controls (43.859402,94.539101) and (43.296902,93.687500)..(42.269501,88.027298)
+ --cycle;
+fill (63.812500,91.058601)..controls (66.511703,93.460899) and (68.441399,98.585899)..(72.988297,96.292999)
+ ..controls (70.726601,96.937500) and (66.710899,93.339798)..(63.812500,91.058601)
+ --cycle;
+fill (88.214798,90.332001)..controls (88.808601,90.132797) and (94.382797,94.984398)..(96.328102,93.785202)
+ ..controls (96.328102,93.785202) and (92.269501,90.609398)..(88.214798,90.332001)
+ --cycle;
+drawoptions (withcolor _chess_black);
+linecap := butt;
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.824200)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.769501)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.175800)
+ ..controls (44.980499,34.628899) and (70.867203,34.765598)..(70.867203,34.765598)
+ ..controls (70.867203,34.765598) and (96.750000,34.628899)..(104.008003,30.175800)
+ ..controls (105.116997,29.500000) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,30.996099)..(103.191002,32.234402)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+);
+
+picture _chess_staunty_wR;
+
+_chess_staunty_wR:=image(
+ color _chess_black;
+_chess_black:=(0.941176,0.941176,0.941176);
+
+drawoptions (withcolor _chess_black);
+linecap := butt;
+linejoin := mitered;
+fill (40.203098,114.344002)..controls (37.203098,89.496101) and (43.332001,84.082001)..(50.828098,83.867203)
+ --(41.429699,32.390598)--(100.296997,32.390598)--(90.898399,83.867203)
+ ..controls (98.398399,84.078102) and (104.527000,89.496101)..(101.523003,114.344002)
+ --(91.300797,115.844002)--(88.257797,105.515999)--(79.351601,105.796997)
+ --(77.871101,116.441002)--(63.855499,116.441002)--(62.378899,105.796997)
+ --(53.468800,105.515999)--(50.429699,115.844002)--cycle;
+
+drawoptions (withcolor 0.8*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (50.832001,83.867203)..controls (70.187500,83.867203) and (88.015602,82.710899)..(93.203102,36.886700)
+ --(99.777298,35.792999)--(90.898399,82.367203)..controls (90.812500,83.234398) and (73.644501,87.527298)..(50.828098,83.867203)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+fill (41.886700,112.762001)--(48.339802,113.578003)..controls (42.917999,112.691002) and (41.785198,98.562500)..(41.785198,98.562500)
+ ..controls (41.109402,99.062500) and (41.250000,112.460999)..(41.886700,112.762001)
+ --cycle;
+fill (71.648399,114.660004)..controls (66.976601,114.660004) and (64.507797,106.875000)..(64.507797,106.875000)
+ --(65.464798,114.605003)--cycle;
+fill (92.609398,113.910004)--(95.257797,113.573997)..controls (93.035202,112.152000) and (90.750000,107.933998)..(90.750000,107.933998)
+ --cycle;
+fill (52.363300,82.304703)--(59.789101,83.136703)..controls (52.363300,82.304703) and (45.910198,46.136700)..(45.882801,45.964802)
+ --cycle;
+
+drawoptions (withcolor 0.8*_chess_black);
+fill (96.414101,115.089996)..controls (97.425797,97.050797) and (90.886703,85.039101)..(73.621101,85.226601)
+ --(87.164101,83.628899)..controls (108.487999,82.753899) and (101.625000,114.258003)..(101.527000,114.339996)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (50.832001,83.867203)..controls (64.738297,85.964798) and (77.984398,85.503899)..(90.902298,83.867203);
+draw (40.203098,114.344002)..controls (37.203098,89.496101) and (43.332001,84.082001)..(50.828098,83.867203)
+ --(41.429699,32.390598)--(100.296997,32.390598)--(90.898399,83.867203)
+ ..controls (98.398399,84.078102) and (104.527000,89.496101)..(101.523003,114.344002)
+ --(91.300797,115.844002)--(88.257797,105.515999)--(79.351601,105.796997)
+ --(77.871101,116.441002)--(63.855499,116.441002)--(62.378899,105.796997)
+ --(53.468800,105.515999)--(50.429699,115.844002)--cycle;
+
+ drawoptions (withcolor _chess_black);
+linejoin := rounded;
+fill (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+drawoptions (withcolor 1.7*_chess_black);
+pickup pencircle scaled 0.000000bp;
+fill (70.867203,36.433601)..controls (70.867203,36.433601) and (46.171902,36.828098)..(37.917999,31.710899)
+ ..controls (36.867199,31.062500) and (35.933601,29.335899)..(35.214802,27.773399)
+ ..controls (35.953098,28.710899) and (36.636700,29.507799)..(37.726601,30.179701)
+ ..controls (44.980499,34.632801) and (70.867203,34.769501)..(70.867203,34.769501)
+ ..controls (70.867203,34.769501) and (96.750000,34.632801)..(104.008003,30.179701)
+ ..controls (105.116997,29.503901) and (105.688004,28.671900)..(106.433998,27.710899)
+ ..controls (106.508003,27.925800) and (105.277000,31.000000)..(103.191002,32.242199)
+ ..controls (95.382797,36.464802) and (70.867203,36.433601)..(70.867203,36.433601)
+ --cycle;
+drawoptions (withcolor (0.117647,0.117647,0.117647));
+pickup pencircle scaled 3.401580bp;
+draw (70.867203,38.386700)..controls (70.867203,38.386700) and (44.984402,38.253899)..(37.726601,33.796902)
+ ..controls (32.828098,30.792999) and (31.675800,23.449200)..(32.339802,15.875000)
+ --(109.390999,15.875000)..controls (110.058998,23.453100) and (108.902000,30.792999)..(104.008003,33.796902)
+ ..controls (96.750000,38.253899) and (70.867203,38.386700)..(70.867203,38.386700)
+ --cycle;
+); \ No newline at end of file
diff --git a/Master/texmf-dist/metapost/mpchess/mpchess.mp b/Master/texmf-dist/metapost/mpchess/mpchess.mp
new file mode 100644
index 00000000000..d79b984ad67
--- /dev/null
+++ b/Master/texmf-dist/metapost/mpchess/mpchess.mp
@@ -0,0 +1,994 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% mpchess.mp %%
+%% draw chessboards with metapost %%
+%% chupin@ceremade.dauphine.fr %%
+%% Version 0.1 (mars 2023) %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This work may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, either version 1.3c of this license
+% or (at your option) any later version. The latest version of this
+% license is in http://www.latex-project.org/lppl.txt
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%input format;
+input hatching;
+input mpchess-cburnett; % piece of lichess cburnett
+input mpchess-staunty; % piece of lichess staunty
+input mpchess-skak; % piece of skak package
+input mpchess-chessboard;
+input mpchess-pgn;
+input mpchess-fen;
+
+if not known mplib: input latexmp fi;
+
+warningcheck:=0;
+
+
+
+% pieces
+picture _chess_bB, _chess_bK, _chess_bN,_chess_bP, _chess_bQ, _chess_bR;
+picture _chess_wB, _chess_wK, _chess_wN,_chess_wP, _chess_wQ, _chess_wR;
+
+% coordinates font
+string _coords_font;
+_coords_font:=defaultfont;
+
+% chose the font to write coordinates on board
+def set_coords_font(expr f)=
+ _coords_font:=f ;
+enddef;
+
+% player name
+string _chess_white_player, _chess_black_player;
+_chess_white_player:="";
+_chess_black_player:="";
+
+def set_white_player(expr s)=
+ _chess_white_player:=s;
+enddef;
+
+
+def set_black_player(expr s)=
+ _chess_black_player:=s;
+enddef;
+
+% boolean to choose the side view
+boolean _chess_view_wb;
+_chess_view_wb := true; % true for white
+
+def set_black_view=
+ _chess_view_wb := false;
+enddef;
+
+def set_white_view=
+ _chess_view_wb := true;
+enddef;
+
+boolean _chess_players_side;
+_chess_players_side:=false;
+def set_players_side=
+ _chess_players_side:=true;
+enddef;
+
+% boolean to choose if we print coordinates
+boolean _chess_print_coords,_chess_coords_inout;
+_chess_print_coords:=true;
+_chess_coords_inout:=true; %true for inside
+def set_no_coords=
+ _chess_print_coords:=false;
+enddef;
+
+def set_coords=
+ _chess_print_coords:=true;
+enddef;
+
+def set_coords_inside=
+ _chess_coords_inout:=true;
+enddef;
+
+def set_coords_outside=
+ _chess_coords_inout:=false;
+enddef;
+
+% boolean for white or black to move
+boolean _white_to_move;
+_white_to_move:=true;
+
+def set_black_to_move=
+ _white_to_move:=false;
+enddef;
+
+def set_white_to_move=
+ _white_to_move:=true;
+enddef;
+
+% boolean to show a mark to indicate whos to move
+boolean show_whos_to_move;
+show_whos_to_move:=true;
+
+def set_whos_to_move=
+ show_whos_to_move:=true;
+enddef;
+
+def unset_whos_to_move=
+ show_whos_to_move:=false;
+enddef;
+
+
+% integer correspondance :
+_intWPawn:=1;
+_intBPawn:=-1;
+_intWKnight:=2;
+_intBKnight:=-2;
+_intWBishop:=3;
+_intBBishop:=-3;
+_intWRook:=4;
+_intBRook:=-4;
+_intWQueen:=5;
+_intBQueen:=-5;
+_intWKing:=6;
+_intBKing:=-6;
+
+
+% macro to get thi ith char of a string
+vardef _get_char(expr s,i)=
+ save output;
+ string output;
+ output:=substring(i,i+1) of s;
+ output
+enddef;
+
+% size of the chessboard
+numeric _chessSize;
+_chessSize:=8;
+
+def set_backboard_size(expr w)=
+ _chessSize:=w;
+enddef;
+
+
+def get_backboard_size=
+ _chessSize
+enddef;
+
+% unit default
+numeric _chessWidth,_chessSquareU;
+_chessWidth:=5cm;
+_chessSquareU:=_chessWidth/_chessSize;
+
+def set_backboard_width(expr w)=
+ _chessWidth:=w;
+enddef;
+
+
+def get_square_dim=
+ _chessSquareU
+enddef;
+
+def get_backboard_width=
+ _chessWidth
+enddef;
+
+% theme
+string _chessTheme;
+% default
+_chessTheme := "BlueLichess";
+
+% color of black and white square
+color _blackColorSquare,_whiteColorSquare;
+% default
+_blackColorSquare:=(0.549,0.6353,0.6784);
+_whiteColorSquare:=(0.8706,0.8912,0.902);
+
+
+
+
+
+
+picture _blackSquarePic, _whiteSquarePic;
+picture _blackSquareColoredPic, _whiteSquareColoredPic;
+picture _blackSquareClassicalPic, _whiteSquareClassicalPic;
+
+def _buildColoredSquare(expr _SquareUnit,_BlackColor,_WhiteColor)=
+ _blackSquarePic:=image(
+ fill unitsquare scaled _SquareUnit withcolor _BlackColor;
+ );
+ _whiteSquarePic:=image(
+ fill unitsquare scaled _SquareUnit withcolor _WhiteColor;
+ );
+enddef;
+
+def _buildClassicalSquare(expr _SquareUnit)=
+ _blackSquarePic:=image(
+ hatchfill (unitsquare scaled _SquareUnit) withcolor (white) withcolor (45,0.65*_SquareUnit/6 bp,-0.2bp);
+ );
+ _whiteSquarePic:=image(
+ fill unitsquare scaled _SquareUnit withcolor white;
+ );
+enddef;
+
+% default theme lichess blue
+_blackSquarePic:=_blackSquareColoredPic;
+_whiteSquarePic:=_whiteSquareColoredPic;
+
+def set_color_theme(expr t)=
+ _chessTheme := t;
+ if(t="BlueLichess"):
+ _blackColorSquare:=(0.549,0.6353,0.6784);
+ _whiteColorSquare:=(0.8706,0.8912,0.902);
+ elseif(t="BrownLichess"):
+ _blackColorSquare:=(0.709803922,0.5333,0.3882);
+ _whiteColorSquare:=(0.941176471,0.850980392,0.709803922);
+ elseif(t="Classical"):
+ _blackColorSquare:=black;
+ _whiteColorSquare:=black;
+ fi
+enddef;
+
+def set_white_color(expr c)=
+ _whiteColorSquare:=c;
+enddef;
+
+def set_black_color(expr c)=
+ _blackColorSquare:=c;
+enddef;
+
+_chess_bB:=_chess_cburnett_bB;
+_chess_bK:=_chess_cburnett_bK;
+_chess_bN:=_chess_cburnett_bN;
+_chess_bP:=_chess_cburnett_bP;
+_chess_bQ:=_chess_cburnett_bQ;
+_chess_bR:=_chess_cburnett_bR;
+
+
+_chess_wB:=_chess_cburnett_wB;
+_chess_wK:=_chess_cburnett_wK;
+_chess_wN:=_chess_cburnett_wN;
+_chess_wP:=_chess_cburnett_wP;
+_chess_wQ:=_chess_cburnett_wQ;
+_chess_wR:=_chess_cburnett_wR;
+
+def set_pieces_theme(expr t)=
+ if(t="cburnett"):
+ _chess_bB:=_chess_cburnett_bB;
+ _chess_bK:=_chess_cburnett_bK;
+ _chess_bN:=_chess_cburnett_bN;
+ _chess_bP:=_chess_cburnett_bP;
+ _chess_bQ:=_chess_cburnett_bQ;
+ _chess_bR:=_chess_cburnett_bR;
+
+
+ _chess_wB:=_chess_cburnett_wB;
+ _chess_wK:=_chess_cburnett_wK;
+ _chess_wN:=_chess_cburnett_wN;
+ _chess_wP:=_chess_cburnett_wP;
+ _chess_wQ:=_chess_cburnett_wQ;
+ _chess_wR:=_chess_cburnett_wR;
+ elseif(t="staunty"):
+ _chess_bB:=_chess_staunty_bB;
+ _chess_bK:=_chess_staunty_bK;
+ _chess_bN:=_chess_staunty_bN;
+ _chess_bP:=_chess_staunty_bP;
+ _chess_bQ:=_chess_staunty_bQ;
+ _chess_bR:=_chess_staunty_bR;
+
+
+ _chess_wB:=_chess_staunty_wB;
+ _chess_wK:=_chess_staunty_wK;
+ _chess_wN:=_chess_staunty_wN;
+ _chess_wP:=_chess_staunty_wP;
+ _chess_wQ:=_chess_staunty_wQ;
+ _chess_wR:=_chess_staunty_wR;
+ elseif(t="skak"):
+ _chess_bB:=_chess_skak_bB;
+ _chess_bK:=_chess_skak_bK;
+ _chess_bN:=_chess_skak_bN;
+ _chess_bP:=_chess_skak_bP;
+ _chess_bQ:=_chess_skak_bQ;
+ _chess_bR:=_chess_skak_bR;
+
+
+ _chess_wB:=_chess_skak_wB;
+ _chess_wK:=_chess_skak_wK;
+ _chess_wN:=_chess_skak_wN;
+ _chess_wP:=_chess_skak_wP;
+ _chess_wQ:=_chess_skak_wQ;
+ _chess_wR:=_chess_skak_wR;
+ fi
+enddef;
+
+
+def _init_piece(expr w)=
+ begingroup
+ bboxmargin:=0pt;
+ _chess_marginBottom:=0.13w;
+ % the queen and king as reference
+ %bQ
+ _chess_bQ_width:=abs((urcorner _chess_bQ)-(ulcorner _chess_bQ));
+ _chess_bQ_height:=abs((urcorner _chess_bQ)-(lrcorner _chess_bQ));
+ _chess_bK_width:=abs((urcorner _chess_bK)-(ulcorner _chess_bK));
+ _chess_bK_height:=abs((urcorner _chess_bK)-(lrcorner _chess_bK));
+ _chess_max_wh:=max(_chess_bQ_height,_chess_bQ_width,_chess_bK_height,_chess_bK_width);
+ ratio:= (0.8w/_chess_max_wh);
+ _chess_bQ:=((_chess_bQ shifted -(llcorner _chess_bQ-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_bQ_width_new:=abs((urcorner _chess_bQ)-(ulcorner _chess_bQ));
+ _chess_bQ:= _chess_bQ shifted ((w-_chess_bQ_width_new)*0.5,_chess_marginBottom) ;
+ %bB
+ _chess_bB:=((_chess_bB shifted -(llcorner _chess_bB-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_bB_width:=abs((urcorner _chess_bB)-(ulcorner _chess_bB));
+ _chess_bB:=_chess_bB shifted ((w-_chess_bB_width)*0.5,_chess_marginBottom) ;
+ %bK
+ _chess_bK:=((_chess_bK shifted -(llcorner _chess_bK-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_bK_width:=abs((urcorner _chess_bK)-(ulcorner _chess_bK));
+ _chess_bK:=_chess_bK shifted ((w-_chess_bK_width)*0.5,_chess_marginBottom) ;
+ %bN
+ _chess_bN:=((_chess_bN shifted -(llcorner _chess_bN-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_bN_width:=abs((urcorner _chess_bN)-(ulcorner _chess_bN));
+ _chess_bN:=_chess_bN shifted ((w-_chess_bN_width)*0.5,_chess_marginBottom) ;
+ %bP
+ _chess_bP:=((_chess_bP shifted -(llcorner _chess_bP-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_bP_width:=abs((urcorner _chess_bP)-(ulcorner _chess_bP));
+ _chess_bP:=_chess_bP shifted ((w-_chess_bP_width)*0.5,_chess_marginBottom) ;
+ %bR
+ _chess_bR:=((_chess_bR shifted -(llcorner _chess_bR-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_bR_width:=abs((urcorner _chess_bR)-(ulcorner _chess_bR));
+ _chess_bR:=_chess_bR shifted ((w-_chess_bR_width)*0.5,_chess_marginBottom) ;
+ %wQ
+ _chess_wQ:=((_chess_wQ shifted -(llcorner _chess_wQ-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_wQ_width:=abs((urcorner _chess_wQ)-(ulcorner _chess_wQ));
+ _chess_wQ:=_chess_wQ shifted ((w-_chess_wQ_width)*0.5,_chess_marginBottom) ;
+ %wB
+ _chess_wB:=((_chess_wB shifted -(llcorner _chess_wB-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_wB_width:=abs((urcorner _chess_wB)-(ulcorner _chess_wB));
+ _chess_wB:=_chess_wB shifted ((w-_chess_wB_width)*0.5,_chess_marginBottom) ;
+ %wK
+ _chess_wK:=((_chess_wK shifted -(llcorner _chess_wK-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_wK_width:=abs((urcorner _chess_wK)-(ulcorner _chess_wK));
+ _chess_wK:=_chess_wK shifted ((w-_chess_wK_width)*0.5,_chess_marginBottom) ;
+ %wN
+ _chess_wN:=((_chess_wN shifted -(llcorner _chess_wN-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_wN_width:=abs((urcorner _chess_wN)-(ulcorner _chess_wN));
+ _chess_wN:=_chess_wN shifted ((w-_chess_wN_width)*0.5,_chess_marginBottom) ;
+ %wP
+ _chess_wP:=((_chess_wP shifted -(llcorner _chess_wP-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_wP_width:=abs((urcorner _chess_wP)-(ulcorner _chess_wP));
+ _chess_wP:=_chess_wP shifted ((w-_chess_wP_width)*0.5,_chess_marginBottom) ;
+ %wR
+ _chess_wR:=((_chess_wR shifted -(llcorner _chess_wR-(bboxmargin,bboxmargin))) scaled ratio );
+ _chess_wR_width:=abs((urcorner _chess_wR)-(ulcorner _chess_wR));
+ _chess_wR:=_chess_wR shifted ((w-_chess_wR_width)*0.5,_chess_marginBottom) ;
+ endgroup
+enddef;
+
+def _int_to_letter_w(expr i)=
+ if(i=1):
+ "a"
+ elseif(i=2):
+ "b"
+ elseif(i=3):
+ "c"
+ elseif(i=4):
+ "d"
+ elseif(i=5):
+ "e"
+ elseif(i=6):
+ "f"
+ elseif(i=7):
+ "g"
+ elseif(i=8):
+ "h"
+ fi
+enddef;
+
+def _int_to_letter_b(expr i)=
+ if(i=1):
+ "h"
+ elseif(i=2):
+ "g"
+ elseif(i=3):
+ "f"
+ elseif(i=4):
+ "e"
+ elseif(i=5):
+ "d"
+ elseif(i=6):
+ "c"
+ elseif(i=7):
+ "b"
+ elseif(i=8):
+ "a"
+ fi
+enddef;
+
+
+def _int_to_str_w(expr i)=
+ if(i=1):
+ "1"
+ elseif(i=2):
+ "2"
+ elseif(i=3):
+ "3"
+ elseif(i=4):
+ "4"
+ elseif(i=5):
+ "5"
+ elseif(i=6):
+ "6"
+ elseif(i=7):
+ "7"
+ elseif(i=8):
+ "8"
+ fi
+enddef;
+
+
+def _int_to_str_b(expr i)=
+ if(i=1):
+ "8"
+ elseif(i=2):
+ "7"
+ elseif(i=3):
+ "6"
+ elseif(i=4):
+ "5"
+ elseif(i=5):
+ "4"
+ elseif(i=6):
+ "3"
+ elseif(i=7):
+ "2"
+ elseif(i=8):
+ "1"
+ fi
+enddef;
+
+
+vardef _chess_get_img_w(expr im)=
+ save width;
+ numeric width;
+ width:=abs(ulcorner im-urcorner im);
+ width
+enddef;
+
+vardef _chess_get_img_h(expr im)=
+ save height;
+ numeric height;
+ height:=abs(ulcorner im-llcorner im) ;
+ height
+enddef;
+
+_chess_eps_cadre := 0.05;
+
+def set_border_width(expr c)=
+ _chess_eps_cadre := c;
+enddef;
+
+
+vardef _chess_build_playername(expr str)=
+ save _player_img,output;
+ picture _player_img,output;
+ _player_img:=image(draw textext(str));
+ output:=image(
+ linecap:=butt;
+ linejoin:=mitered;
+ _tmp:=_chess_get_img_h(_player_img);
+ fill (0-_chess_eps_cadre,0)*_chessSquareU--(_chessSize+_chess_eps_cadre,0)*_chessSquareU--((_chessSize+_chess_eps_cadre)*_chessSquareU,1.8*_tmp)--(0-_chess_eps_cadre*_chessSquareU,1.8*_tmp)--cycle withcolor black;
+ draw (0-_chess_eps_cadre,0)*_chessSquareU--(_chessSize+_chess_eps_cadre,0)*_chessSquareU--((_chessSize+_chess_eps_cadre)*_chessSquareU,1.8*_tmp)--(0-_chess_eps_cadre*_chessSquareU,1.8*_tmp)--cycle withcolor black withpen pencircle scaled (0.1*_chessSquareU);
+ draw _player_img shifted (0.15*_chessSquareU,0.4*_tmp) withcolor white;
+ );
+ output
+enddef;
+
+picture backboard;
+
+def init_backboard =
+_chessSquareU:=_chessWidth/_chessSize;
+_init_piece(_chessSquareU);
+if(_chessTheme="Classical"):
+ _buildClassicalSquare(_chessSquareU);
+else: % colored themes
+ _buildColoredSquare(_chessSquareU,_blackColorSquare,_whiteColorSquare);
+fi
+picture _letter_img;
+picture _wplayer_img,_bplayer_img;
+
+backboard:=image(
+ linecap:=butt;
+ linejoin:=mitered;
+ draw (0-_chess_eps_cadre,0-_chess_eps_cadre)*_chessSquareU--(_chessSize+_chess_eps_cadre,0-_chess_eps_cadre)*_chessSquareU--(_chessSize+_chess_eps_cadre,_chessSize+_chess_eps_cadre)*_chessSquareU--(0-_chess_eps_cadre,_chessSize+_chess_eps_cadre)*_chessSquareU--cycle withpen pencircle scaled (0.1*_chessSquareU);
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ if(odd((i-1)*_chessSize+j+i)):
+ draw _whiteSquarePic
+ shifted ((j-1)*_chessSquareU,(i-1)*_chessSquareU) ;
+ else:
+ draw _blackSquarePic shifted ((j-1)*_chessSquareU,(i-1)*_chessSquareU) ;
+ fi
+ if(_chess_print_coords and (_chessSize=8)):
+ if(_chess_coords_inout): % coords inside the backboard
+ if(i=1): % lettre on first line
+ _letter_img:=image(
+ if(_chess_view_wb):
+ draw _int_to_letter_w(j) infont _coords_font;
+ else:
+ draw _int_to_letter_b(j) infont _coords_font;
+ fi
+ );
+ if(j=1):
+ _lettre_width:=abs(urcorner _letter_img-ulcorner _letter_img);
+ _lettre_height:=abs(urcorner _letter_img-lrcorner _letter_img);
+ fi
+ draw _letter_img scaled (0.1*_chessSquareU/_lettre_width) shifted ((j-1)*_chessSquareU+0.8*_chessSquareU,(i-1)*_chessSquareU+0.05*_chessSquareU) withcolor ((j mod 2)*_whiteColorSquare+(1-(j mod 2))*_blackColorSquare);
+ fi
+ if(j=1):
+ _letter_img:=image(
+ if(_chess_view_wb):
+ draw _int_to_str_w(i) infont _coords_font;
+ else:
+ draw _int_to_str_b(i) infont _coords_font;
+ fi
+ );
+ if(i=1):
+ _lettre_width:=abs(urcorner _letter_img-ulcorner _letter_img);
+ _lettre_height:=abs(urcorner _letter_img-lrcorner _letter_img);
+ fi
+ draw _letter_img scaled (0.1*_chessSquareU/_lettre_width) shifted ((j-1)*_chessSquareU+0.05*_chessSquareU,(i-1)*_chessSquareU+0.8*_chessSquareU) withcolor ((i mod 2)*_whiteColorSquare+(1-(i mod 2))*_blackColorSquare);
+ fi
+ else: % coords outside the backboard
+ if(i=1): % lettre on first line
+ _letter_img:=image(
+ if(_chess_view_wb):
+ draw _int_to_letter_w(j) infont _coords_font;
+ else:
+ draw _int_to_letter_b(j) infont _coords_font;
+ fi
+ );
+ if(j=1):
+ _lettre_width:=abs(urcorner _letter_img-ulcorner _letter_img);
+ _lettre_height:=abs(urcorner _letter_img-lrcorner _letter_img);
+ fi
+ draw _letter_img scaled (0.2*_chessSquareU/_lettre_width) shifted ((j-1)*_chessSquareU+0.5*(_chessSquareU-_lettre_width),(i-1)*_chessSquareU-0.5*_chessSquareU) withcolor black;
+ fi
+ if(j=1):
+ _letter_img:=image(
+ if(_chess_view_wb):
+ draw _int_to_str_w(i) infont _coords_font;
+ else:
+ draw _int_to_str_b(i) infont _coords_font;
+ fi
+ );
+ if(i=1):
+ _lettre_width:=abs(urcorner _letter_img-ulcorner _letter_img);
+ _lettre_height:=abs(urcorner _letter_img-lrcorner _letter_img);
+ fi
+ draw _letter_img scaled (0.2*_chessSquareU/_lettre_width) shifted ((j-1)*_chessSquareU-0.5*_chessSquareU,(i-1)*_chessSquareU+0.5*(_chessSquareU-_lettre_height)) withcolor black;
+ fi
+ fi
+ fi
+ endfor;
+ endfor;
+ if(_chess_view_wb): % white view
+ if(_chess_white_player<>""): % if white player
+ if((not _chess_coords_inout) or _chess_players_side): % if coord outside or option so set players to the site
+ label.urt(textext(_chess_white_player),(1.05*_chessSize*_chessSquareU,0));
+ else:
+ draw _chess_build_playername(_chess_white_player) shifted (0,-_chess_get_img_h(_chess_build_playername(_chess_white_player))+_chess_eps_cadre*_chessSquareU);
+ fi
+ fi
+ if(_chess_black_player<>""):
+ if((not _chess_coords_inout) or _chess_players_side):
+ label.lrt(textext(_chess_black_player),(1.05*_chessSize*_chessSquareU,_chessSize*_chessSquareU));
+ else:
+ draw _chess_build_playername(_chess_black_player) shifted (0,_chessSquareU*(_chessSize+2*_chess_eps_cadre));
+ fi
+ fi
+ else: % black view
+ if(_chess_black_player<>""):
+ if((not _chess_coords_inout) or _chess_players_side):
+ label.urt(textext(_chess_black_player),(1.05*_chessSize*_chessSquareU,0));
+ else:
+ draw _chess_build_playername(_chess_black_player) shifted (0,-_chess_get_img_h(_chess_build_playername(_chess_black_player)));
+ fi
+ fi
+ if(_chess_white_player<>""):
+ if((not _chess_coords_inout) or _chess_players_side):
+ label.lrt(textext(_chess_white_player),(1.05_chessSize*_chessSquareU,_chessSize*_chessSquareU));
+ else:
+ draw _chess_build_playername(_chess_white_player) shifted (0,_chessSquareU*(_chessSize+_chess_eps_cadre));
+ fi
+ fi
+ fi
+);
+enddef;
+
+def _int_to_piece(expr i)=
+ if(i=_intWPawn):
+ _chess_wP
+ elseif(i=_intBPawn):
+ _chess_bP
+ elseif(i=_intWKnight):
+ _chess_wN
+ elseif(i=_intBKnight):
+ _chess_bN
+ elseif(i=_intWBishop):
+ _chess_wB
+ elseif(i=_intBBishop):
+ _chess_bB
+ elseif(i=_intWRook):
+ _chess_wR
+ elseif(i=_intBRook):
+ _chess_bR
+ elseif(i=_intWQueen):
+ _chess_wQ
+ elseif(i=_intBQueen):
+ _chess_bQ
+ elseif(i=_intWKing):
+ _chess_wK
+ elseif(i=_intBKing):
+ _chess_bK
+ fi
+enddef;
+
+def _triangle(expr s)=
+ ((0,0)--(1,0)--(0.5,0.5)--cycle) scaled (s*_chessSquareU)
+enddef;
+
+color _chess_last_move_color;
+
+_chess_last_move_color:=(0.6078,0.7803,0);
+
+
+def set_last_move_color(expr c)=
+ _chess_last_move_color:=c;
+enddef;
+
+def show_last_move(expr k)=
+ if(k>0):
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ if(chessboard_table[k][i][j]<>chessboard_table[k-1][i][j]):
+ if(_chess_view_wb):%white side
+ _chess_color_square(_chess_last_move_color,i,j);
+ else:
+ _chess_color_square(_chess_last_move_color,8+1-i,8+1-j);
+ fi
+ fi
+ endfor
+ endfor
+ fi
+enddef;
+
+
+vardef _chess_build_chessboard_pic(expr k)=
+ save chessboard_pic;
+ save shiftPiece;
+ pair shiftPiece;
+ picture chessboard_pic;
+ chessboard_pic:= image(
+ %draw backboard;
+ for i:=1 upto _chessSize:
+ for j:=1 upto _chessSize:
+ if(chessboard_table[k][i][j] <> 0):
+ if(_chess_view_wb):
+ shiftPiece:=((i-1)*_chessSquareU,(j-1)*_chessSquareU);
+ else:
+ shiftPiece:=((_chessSize-i)*_chessSquareU,(_chessSize-j)*_chessSquareU);
+ fi
+ draw ( _int_to_piece(chessboard_table[k][i][j]) shifted shiftPiece);
+ fi
+ endfor;
+ endfor;
+ if(show_whos_to_move):
+ if(_chess_view_wb): %white side
+ if(not _white_to_move):
+ fill _triangle(0.3) rotated 180 shifted (_chessSquareU*(_chessSize+0.35),_chessSquareU*(_chessSize)+0.3*_chessSquareU)
+ else:
+ draw _triangle(0.35) shifted (_chessSquareU*(_chessSize+0.3),-0.3*_chessSquareU) ;
+ fi
+ else: % black side
+ if(_white_to_move):
+ draw _triangle(0.3) rotated 180 shifted (_chessSquareU*(_chessSize+0.35),_chessSquareU*(_chessSize)+0.3*_chessSquareU)
+ else:
+ fill _triangle(0.35) shifted (_chessSquareU*(_chessSize+0.3),-0.3*_chessSquareU) ;
+ fi
+ fi
+ fi
+ );
+ chessboard_pic
+enddef;
+
+vardef chessboard_step(expr k) =
+ save chessboard_pic;
+ picture chessboard_pic;
+ if((k mod 2)=0):
+ set_white_to_move;
+ else:
+ set_black_to_move;
+ fi
+ chessboard_pic:=_chess_build_chessboard_pic(k);
+ chessboard_pic
+enddef;
+
+vardef chessboard =
+ save chessboard_pic;
+ picture chessboard_pic;
+ chessboard_pic:=_chess_build_chessboard_pic(0);
+ chessboard_pic
+enddef;
+
+
+%%% colored square
+picture _chess_colored_squared;
+vardef color_square(expr c)(text slist)=
+ % c: color
+ % s: list of algebraic notation for a square (ex: "e5","f6",etc.)
+ save _i,_j,_str;
+ for _str = slist:
+ _i:=_lettre_to_int(_get_char(_str,0));
+ _j:=_str_to_int(_get_char(_str,1));
+ path ss;
+ if(_chess_view_wb):%white side
+ ss:=(unitsquare scaled _chessSquareU) shifted
+ ((_i-1)*_chessSquareU,(_j-1)*_chessSquareU);
+ else:
+ ss:=(unitsquare scaled _chessSquareU) shifted
+ ((8+1-_i-1)*_chessSquareU,(8+1-_j-1)*_chessSquareU);
+ fi
+ transparence(ss,c,0.41);
+ endfor
+enddef;
+
+vardef _chess_color_square(expr c,i,j)=
+ % c: color
+ % s: algebraic notation for a square (ex: e5)
+ path ss;
+ ss:=(unitsquare scaled _chessSquareU) shifted ((i-1)*_chessSquareU,(j-1)*_chessSquareU);
+ transparence(ss,c,0.41);
+enddef;
+
+%% "inspired" by Thruston’s code:
+% https://github.com/thruston/Drawing-with-Metapost
+def transparence(expr p,c,a)=
+ save shape,alpha,filler,bg,fg;
+ path shape;
+ shape := p;
+ alpha := a; % alpha: 0=invisible, 1=opaque
+ color filler;
+ filler = c;
+ picture fg, bg;
+ bg = currentpicture; % capture the current drawing
+ fg = image(
+ for e within bg: % redraw everything in blended color
+ draw e withcolor alpha[colorpart e, filler];
+ endfor % and add some decorations
+ );
+ clip fg to shape; % now clip the fg drawing to the shape
+ fill shape withcolor filler; % fill the shape
+ draw fg; % and put the fg drawing on top
+enddef;
+
+
+% draw arrow on the board between two algebraic notation
+% depending on the syntax, strat line or rectangular one
+% s="a2--a4" or s="b1|-c3" or s="b1-|c3"
+% allow a list of string
+_chess_arrow_width:=0.08*_chessSquareU;
+_chess_arrow_head:=0.4*_chessSquareU;
+
+def set_arrow_width(expr c)=
+ _chess_arrow_width:=c*_chessSquareU;
+enddef;
+
+def draw_arrows(expr c)(text slist)=
+ save _chess_arrow,_str;
+ save _i,_j,_k,_l,_vec,_ortho_vec,_unit_vec,_init,_end;
+ pair _vec,_unit_vec,_ortho_vec,_init,_end;
+ path _chess_arrow;
+ for _str = slist:
+ _i:=_lettre_to_int(_get_char(_str,0));
+ _j:=_str_to_int(_get_char(_str,1));
+ _k:=_lettre_to_int(_get_char(_str,4));
+ _l:=_str_to_int(_get_char(_str,5));
+ if(_chess_view_wb): %white side
+ _end:=(_k,_l)*_chessSquareU-(0.5,0.5)*_chessSquareU;
+ _init:=(_i,_j)*_chessSquareU-(0.5,0.5)*_chessSquareU;
+ else:
+ _end:=(8-_k,8-_l)*_chessSquareU+(0.5,0.5)*_chessSquareU;
+ _init:=(8-_i,8-_j)*_chessSquareU+(0.5,0.5)*_chessSquareU;
+ fi
+ if((substring (2,4) of _str)="--"):
+ _vec:= _end-_init;
+ _unit_vec:=_chess_unit_vec(_vec);
+ _init:=_init+0.2*_chessSquareU*_unit_vec;
+ _end:=_end-0.2*_chessSquareU*_unit_vec;
+ _vec:= _end-_init;
+ _unit_vec:=_chess_unit_vec(_vec);
+ _ortho_vec:=_chess_unit_ortho_vec(_vec);
+ _vec_norm:=abs(_vec);
+ _chess_arrow:=_init--(_init+(_chess_arrow_width*_ortho_vec))--
+ (_init+(_chess_arrow_width*_ortho_vec)+((_vec_norm-_chess_arrow_head)*_unit_vec))--
+ (_init+(_chess_arrow_width*_ortho_vec)+((_vec_norm-_chess_arrow_head)*_unit_vec)+(2*_chess_arrow_width*_ortho_vec))--
+ _end --
+ (_init-(_chess_arrow_width*_ortho_vec)+((_vec_norm-_chess_arrow_head)*_unit_vec)-(2*_chess_arrow_width*_ortho_vec))--
+ (_init-(_chess_arrow_width*_ortho_vec)+((_vec_norm-_chess_arrow_head)*_unit_vec))--
+ (_init-(_chess_arrow_width*_ortho_vec))--cycle;
+ elseif((substring (2,4) of _str)="|-"):
+ if((xpart _end)> (xpart _init)): % to the right
+ _pm_rl:=+1;
+ else:
+ _pm_rl:=-1;
+ fi
+ if((ypart _end)>(ypart _init)): % to the to
+ _pm_ul:=+1;
+ else:
+ _pm_ul:=-1;
+ fi
+ _init:=(xpart _init, ypart _init+0.2*(_pm_ul*_chessSquareU));
+ _end:=(xpart _end-0.2*(_pm_rl*_chessSquareU),ypart _end);
+ _chess_arrow:=(_init-_pm_rl*(_chess_arrow_width,0))--
+ (xpart _init -_pm_rl*_chess_arrow_width, ypart _end + _pm_ul*_chess_arrow_width)--
+ (xpart _end-_pm_rl*_chess_arrow_head, ypart _end + _pm_ul*_chess_arrow_width)--
+ (xpart _end-_pm_rl*_chess_arrow_head, ypart _end + 3*_pm_ul*_chess_arrow_width)--
+ _end--
+ (xpart _end-_pm_rl*_chess_arrow_head, ypart _end - 3*_pm_ul*_chess_arrow_width)--
+ (xpart _end-_pm_rl*_chess_arrow_head, ypart _end - _pm_ul*_chess_arrow_width)--
+ (xpart _init +_pm_rl*_chess_arrow_width, ypart _end - _pm_ul*_chess_arrow_width) --
+ (_init+_pm_rl*(_chess_arrow_width,0))--cycle;
+ elseif((substring (2,4) of _str)="-|"):
+ if((xpart _end)>(xpart _init)): % to the right
+ _pm_rl:=+1;
+ else:
+ _pm_rl:=-1;
+ fi
+ if((ypart _end)>(ypart _init)): % to the to
+ _pm_ul:=+1;
+ else:
+ _pm_ul:=-1;
+ fi
+ _init:=(xpart _init +0.2*(_pm_rl*_chessSquareU), ypart _init);
+ _end:=(xpart _end,ypart _end-0.2*(_pm_ul*_chessSquareU));
+ _chess_arrow:=(_init+_pm_ul*(0,_chess_arrow_width))--
+ (xpart _end -_pm_rl*_chess_arrow_width, ypart _init + _pm_ul*_chess_arrow_width)--
+ (xpart _end -_pm_rl*_chess_arrow_width,ypart _end-_pm_ul*_chess_arrow_head)--
+ (xpart _end -3*_pm_rl*_chess_arrow_width,ypart _end-_pm_ul*_chess_arrow_head)--
+ _end--
+ (xpart _end +3*_pm_rl*_chess_arrow_width,ypart _end-_pm_ul*_chess_arrow_head)--
+ (xpart _end +_pm_rl*_chess_arrow_width,ypart _end-_pm_ul*_chess_arrow_head)--
+ (xpart _end +_pm_rl*_chess_arrow_width, ypart _init - _pm_ul*_chess_arrow_width)--
+ (_init-_pm_ul*(0,_chess_arrow_width))--cycle;
+
+ fi
+ %draw _chess_arrow;
+ transparence(_chess_arrow,c,0.91);
+ endfor
+enddef;
+
+vardef _chess_unit_ortho_vec(expr p)=
+ save _out;
+ pair _out;
+ _out := p rotated 90 scaled (1/abs(p));
+ _out
+enddef;
+
+
+vardef _chess_unit_vec(expr p)=
+ save _out;
+ pair _out;
+ _out := p scaled (1/abs(p));
+ _out
+enddef;
+
+
+def draw_circles(expr c)(text slist)=
+ save _str;
+ save _i,_j;
+ for _str = slist:
+ _i:=_lettre_to_int(_get_char(_str,0));
+ _j:=_str_to_int(_get_char(_str,1));
+ if(_chess_view_wb): % white side
+ draw (fullcircle scaled (0.95*_chessSquareU)) shifted
+ ((_i-0.5,_j-0.5)*_chessSquareU) withpen pencircle scaled
+ (0.08*_chessSquareU) withcolor c;
+ else:
+ draw (fullcircle scaled (0.95*_chessSquareU)) shifted
+ ((8+1-_i-0.5,8+1-_j-0.5)*_chessSquareU) withpen pencircle scaled
+ (0.08*_chessSquareU) withcolor c;
+ fi
+ endfor;
+enddef;
+
+def draw_crosses(expr c)(text slist)=
+ save _str;
+ save _i,_j;
+ for _str = slist:
+ _i:=_lettre_to_int(_get_char(_str,0));
+ _j:=_str_to_int(_get_char(_str,1));
+ if(_chess_view_wb):% white side
+ draw (((-0.45,-0.45)--(0.45,0.45)) scaled (0.95*_chessSquareU)) shifted ((_i-0.5,_j-0.5)*_chessSquareU) withpen pencircle scaled (0.1*_chessSquareU) withcolor c;
+ draw (((-0.45,0.45)--(0.45,-0.45)) scaled (0.95*_chessSquareU)) shifted
+ ((_i-0.5,_j-0.5)*_chessSquareU) withpen pencircle scaled
+ (0.1*_chessSquareU) withcolor c;
+ else:
+ draw (((-0.45,-0.45)--(0.45,0.45)) scaled (0.95*_chessSquareU)) shifted ((8+1-_i-0.5,8+1-_j-0.5)*_chessSquareU) withpen pencircle scaled (0.1*_chessSquareU) withcolor c;
+ draw (((-0.45,0.45)--(0.45,-0.45)) scaled (0.95*_chessSquareU)) shifted
+ ((8+1-_i-0.5,8+1-_j-0.5)*_chessSquareU) withpen pencircle scaled
+ (0.1*_chessSquareU) withcolor c;
+ fi
+ endfor;
+enddef;
+
+
+
+% clip current chessboard to the area of type "a2-f7"
+def clip_chessboard(expr s)=
+ save _first_letter,_firt_nbr, _second_letter,_second_nbr,_fl,_fn,_sl,_sn,_str;
+ string _first_letter,_first_nbr, _second_letter,_second_nbr,_str;
+ _str:=s;
+ _first_letter:=substring (0,1) of _str;
+ _first_nbr:=substring (1,2) of _str;
+ _second_letter:=substring (3,4) of _str;
+ _second_nbr:=substring (4,5) of _str;
+ _fl:=_lettre_to_int(_first_letter)-1;
+ _fn:=_str_to_int(_first_nbr)-1;
+ _sl:=_lettre_to_int(_second_letter);
+ _sn:=_str_to_int(_second_nbr);
+ clip currentpicture to (_fl,_fn)*_chessSquareU--(_fl,_sn)*_chessSquareU--(_sl,_sn)*_chessSquareU--(_sl,_fn)*_chessSquareU--cycle;
+enddef;
+
+% reset backboard
+def reset_mpchess=
+ _chessWidth:=5cm;
+ _chessSize:=8;
+ _chessSquareU:=_chessWidth/_chessSize;
+ _chessTheme := "BlueLichess";
+ _blackColorSquare:=(0.549,0.6353,0.6784);
+ _whiteColorSquare:=(0.8706,0.8912,0.902);
+ _chess_print_coords:=true;
+ _chess_coords_inout:=true;
+ _chess_view_wb := true; % true for white
+ _chess_players_side:=false;
+ _chess_eps_cadre := 0.05;
+ _chess_last_move_color:=(0.6078,0.7803,0);
+ _chess_arrow_width:=0.2*_chessSquareU;
+ _chess_arrow_head:=0.6*_chessSquareU;
+ clear_chessboard;
+ _chess_wcaptures_nbr[0]:=0;
+ _chess_bcaptures_nbr[0]:=0;
+ set_color_theme("BlueLichess");
+ set_pieces_theme("cburnett");
+ _chess_white_player:="";
+ _chess_black_player:="";
+enddef;
+
+color _commentColor;
+_commentColor:=(0.6,0.2,0.2);
+
+def set_comment_color(expr c)=
+ _commentColor:=c;
+enddef;
+
+_commentScale:=0.2;
+
+def draw_comment(expr ind, pos)=
+ save _img, _letter, _nbr;
+ picture _img;
+ _img:=image(
+ draw textext("\bfseries"&ind);
+ );
+ _width:=abs(urcorner _img-ulcorner _img);
+ _height:=abs(urcorner _img-lrcorner _img);
+ _img:=image(
+ fill fullcircle scaled (2*max(_width,_height)) shifted (0.5*_width,0.5*_height) withcolor 0.8[_commentColor,white];
+ draw fullcircle scaled (2*max(_width,_height)) shifted (0.5*_width,0.5*_height) withcolor _commentColor;
+ draw _img;
+ );
+ _letter:=_lettre_to_int(_get_char(pos,0));
+ _nbr:=_str_to_int(_get_char(pos,1));
+ if(_chess_view_wb): % white view
+ draw _img scaled (_commentScale*_chessSquareU/max(_width,_height)) shifted ((_letter)*_chessSquareU-0.15*(_chessSquareU-_width),(_nbr)*_chessSquareU-0.15*_chessSquareU);
+ else:
+ draw _img scaled (_commentScale*_chessSquareU/max(_width,_height)) shifted ((8+1-_letter)*_chessSquareU-0.15*(_chessSquareU-_width),(8+1-_nbr)*_chessSquareU-0.15*_chessSquareU);
+ fi
+enddef; \ No newline at end of file