From 2c5d7b20742b802d9c47916915c1114bcfc9a9c3 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Fri, 27 Mar 2020 19:53:14 +0100 Subject: [PATCH] Add unambiguous section in the PGN + some fixes + code formatting and fix typos --- client/public/images/pieces/Ball/bh.svg | 35 +++---- .../images/pieces/Ball/{bc.svg => bi.svg} | 35 ++++--- client/public/images/pieces/Ball/wh.svg | 9 +- .../images/pieces/Ball/{wc.svg => wi.svg} | 9 +- client/src/App.vue | 12 ++- client/src/base_rules.js | 56 +++++++++-- client/src/components/BaseGame.vue | 33 +++++-- client/src/components/Board.vue | 8 +- client/src/components/ChallengeList.vue | 3 +- client/src/components/MoveList.vue | 6 +- client/src/data/userCheck.js | 3 +- client/src/store.js | 5 +- client/src/translations/rules/Alice/es.pug | 3 +- client/src/translations/rules/Allmate1/en.pug | 3 +- client/src/translations/rules/Allmate1/es.pug | 13 +-- client/src/translations/rules/Allmate1/fr.pug | 21 ++-- client/src/translations/rules/Allmate2/es.pug | 4 +- client/src/translations/rules/Allmate2/fr.pug | 4 +- .../src/translations/rules/Antimatter/en.pug | 3 +- .../src/translations/rules/Antimatter/es.pug | 3 +- .../src/translations/rules/Antimatter/fr.pug | 3 +- client/src/translations/rules/Arena/en.pug | 7 +- client/src/translations/rules/Arena/es.pug | 17 ++-- client/src/translations/rules/Arena/fr.pug | 15 +-- client/src/translations/rules/Ball/en.pug | 21 ++-- client/src/translations/rules/Ball/es.pug | 25 ++--- client/src/translations/rules/Ball/fr.pug | 22 ++--- client/src/translations/rules/Baroque/en.pug | 59 +++++------ client/src/translations/rules/Baroque/es.pug | 54 +++++----- client/src/translations/rules/Baroque/fr.pug | 59 ++++++----- client/src/translations/rules/Benedict/en.pug | 8 +- client/src/translations/rules/Benedict/es.pug | 10 +- client/src/translations/rules/Benedict/fr.pug | 14 ++- client/src/translations/rules/Berolina/es.pug | 6 +- client/src/translations/rules/Cannibal/en.pug | 3 +- client/src/translations/rules/Cannibal/es.pug | 3 +- client/src/translations/rules/Cannibal/fr.pug | 3 +- .../src/translations/rules/Checkered/en.pug | 35 ++++--- .../src/translations/rules/Checkered/es.pug | 15 +-- .../src/translations/rules/Checkered/fr.pug | 8 +- client/src/translations/rules/Chess960/en.pug | 98 ++++++++++--------- client/src/translations/rules/Chess960/es.pug | 54 +++++----- client/src/translations/rules/Chess960/fr.pug | 61 +++++++----- client/src/translations/rules/Circular/en.pug | 3 +- client/src/translations/rules/Circular/es.pug | 3 +- client/src/translations/rules/Circular/fr.pug | 3 +- .../src/translations/rules/Crazyhouse/en.pug | 10 +- client/src/translations/rules/Cylinder/en.pug | 3 +- client/src/translations/rules/Cylinder/es.pug | 8 +- client/src/translations/rules/Cylinder/fr.pug | 5 +- .../src/translations/rules/Eightpieces/en.pug | 3 +- .../src/translations/rules/Eightpieces/es.pug | 3 +- .../src/translations/rules/Eightpieces/fr.pug | 3 +- .../src/translations/rules/Extinction/en.pug | 13 +-- .../src/translations/rules/Extinction/es.pug | 8 +- .../src/translations/rules/Extinction/fr.pug | 3 +- client/src/translations/rules/Grand/en.pug | 23 ++--- client/src/translations/rules/Grand/es.pug | 7 +- client/src/translations/rules/Grand/fr.pug | 3 +- .../src/translations/rules/Grasshopper/en.pug | 18 ++-- .../src/translations/rules/Grasshopper/es.pug | 14 ++- .../src/translations/rules/Grasshopper/fr.pug | 18 ++-- client/src/translations/rules/Hidden/es.pug | 8 +- client/src/translations/rules/Hidden/fr.pug | 12 ++- .../src/translations/rules/Hiddenqueen/en.pug | 6 +- .../src/translations/rules/Hiddenqueen/fr.pug | 4 +- .../src/translations/rules/Knightmate/en.pug | 2 +- .../src/translations/rules/Knightmate/es.pug | 6 +- .../src/translations/rules/Knightmate/fr.pug | 6 +- .../translations/rules/Knightrelay1/en.pug | 12 ++- .../translations/rules/Knightrelay1/es.pug | 12 ++- .../translations/rules/Knightrelay1/fr.pug | 9 +- .../translations/rules/Knightrelay2/en.pug | 18 ++-- .../translations/rules/Knightrelay2/es.pug | 15 +-- .../translations/rules/Knightrelay2/fr.pug | 24 +++-- client/src/translations/rules/Losers/es.pug | 3 +- client/src/translations/rules/Losers/fr.pug | 7 +- client/src/translations/rules/Magnetic/en.pug | 22 +++-- client/src/translations/rules/Magnetic/es.pug | 7 +- client/src/translations/rules/Magnetic/fr.pug | 12 +-- .../src/translations/rules/Marseille/es.pug | 3 +- .../src/translations/rules/Marseille/fr.pug | 14 +-- client/src/translations/rules/Orda/es.pug | 3 +- client/src/translations/rules/Perfect/en.pug | 5 +- client/src/translations/rules/Perfect/es.pug | 5 +- client/src/translations/rules/Perfect/fr.pug | 5 +- .../src/translations/rules/Racingkings/fr.pug | 8 +- client/src/translations/rules/Recycle/en.pug | 7 +- client/src/translations/rules/Recycle/es.pug | 3 +- client/src/translations/rules/Recycle/fr.pug | 3 +- client/src/translations/rules/Rifle/en.pug | 5 +- client/src/translations/rules/Rifle/es.pug | 16 +-- client/src/translations/rules/Rifle/fr.pug | 9 +- .../src/translations/rules/Royalrace/en.pug | 8 +- .../src/translations/rules/Royalrace/fr.pug | 15 +-- client/src/translations/rules/Schess/es.pug | 1 - client/src/translations/rules/Shatranj/en.pug | 10 +- client/src/translations/rules/Shatranj/es.pug | 15 +-- client/src/translations/rules/Shatranj/fr.pug | 9 +- client/src/translations/rules/Suicide/en.pug | 14 ++- client/src/translations/rules/Suicide/fr.pug | 11 ++- .../src/translations/rules/Synchrone/en.pug | 3 +- .../src/translations/rules/Synchrone/fr.pug | 6 +- .../src/translations/rules/Upsidedown/en.pug | 6 +- .../src/translations/rules/Upsidedown/es.pug | 17 ++-- .../src/translations/rules/Upsidedown/fr.pug | 10 +- .../src/translations/rules/Wildebeest/en.pug | 11 ++- .../src/translations/rules/Wildebeest/es.pug | 16 +-- .../src/translations/rules/Wildebeest/fr.pug | 20 ++-- client/src/translations/rules/Wormhole/en.pug | 7 +- client/src/translations/rules/Wormhole/es.pug | 16 +-- client/src/translations/rules/Wormhole/fr.pug | 3 +- client/src/translations/rules/Zen/en.pug | 3 +- client/src/translations/rules/Zen/es.pug | 6 +- client/src/translations/rules/Zen/fr.pug | 9 +- client/src/utils/alea.js | 2 +- client/src/utils/compgameStorage.js | 3 +- client/src/utils/gameStorage.js | 3 +- client/src/utils/notation.js | 7 +- client/src/variants/Alice.js | 14 ++- client/src/variants/Apocalypse.js | 8 -- client/src/variants/Ball.js | 34 +++---- client/src/variants/Baroque.js | 27 +++-- client/src/variants/Berolina.js | 4 +- client/src/variants/Checkered.js | 5 +- client/src/variants/Circular.js | 6 +- client/src/variants/Coregal.js | 21 +++- client/src/variants/Crazyhouse.js | 3 +- client/src/variants/Dark.js | 13 +-- client/src/variants/Dynamo.js | 6 +- client/src/variants/Eightpieces.js | 10 +- client/src/variants/Enpassant.js | 5 +- client/src/variants/Extinction.js | 5 +- client/src/variants/Grand.js | 11 ++- client/src/variants/Hidden.js | 16 +-- client/src/variants/Knightrelay1.js | 3 +- client/src/variants/Knightrelay2.js | 3 +- client/src/variants/Magnetic.js | 6 +- client/src/variants/Recycle.js | 3 +- client/src/variants/Schess.js | 6 +- client/src/variants/Synchrone.js | 5 +- client/src/variants/Threechecks.js | 2 +- client/src/variants/Wildebeest.js | 8 +- client/src/variants/Zen.js | 2 +- client/src/views/Analyse.vue | 3 +- client/src/views/Game.vue | 31 +++--- client/src/views/Hall.vue | 32 +++--- client/src/views/MyGames.vue | 2 +- client/src/views/News.vue | 2 +- client/src/views/Problems.vue | 17 +++- server/db/create.sql | 3 +- server/db/populate.sql | 10 +- server/models/User.js | 8 +- server/sockets.js | 7 +- server/utils/access.js | 14 +-- 155 files changed, 1108 insertions(+), 768 deletions(-) rename client/public/images/pieces/Ball/{bc.svg => bi.svg} (54%) rename client/public/images/pieces/Ball/{wc.svg => wi.svg} (59%) diff --git a/client/public/images/pieces/Ball/bh.svg b/client/public/images/pieces/Ball/bh.svg index 8c5339cc..6dbea895 100644 --- a/client/public/images/pieces/Ball/bh.svg +++ b/client/public/images/pieces/Ball/bh.svg @@ -11,11 +11,11 @@ width="100%" version="1.1" viewBox="0 0 2048 2048" - id="svg18" - sodipodi:docname="bd.svg" + id="svg112" + sodipodi:docname="bh.svg" inkscape:version="0.92.4 5da689c313, 2019-01-14"> <metadata - id="metadata24"> + id="metadata118"> <rdf:RDF> <cc:Work rdf:about=""> @@ -27,7 +27,7 @@ </rdf:RDF> </metadata> <defs - id="defs22" /> + id="defs116" /> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" @@ -39,65 +39,60 @@ inkscape:pageshadow="2" inkscape:window-width="960" inkscape:window-height="1060" - id="namedview20" + id="namedview114" showgrid="false" inkscape:zoom="0.11523438" - inkscape:cx="1058.7119" + inkscape:cx="1024" inkscape:cy="1024" inkscape:window-x="0" inkscape:window-y="20" inkscape:window-maximized="0" - inkscape:current-layer="svg18" /> + inkscape:current-layer="svg112" /> <path style="color:#000000;display:block;fill:#000000;fill-rule:nonzero" d="m 490,643 q 4,9 13,27 17,42 17,50 -2,28 -29,28 -20,0 -47,-57 -4,-8 -12,-14 -27,-28 8,-47 32,-19 50,13 z m 590,371 q 70,92 69,205 -4,33 -38,33 -46,0 -36,-34 3,-55 -11,-91 -23,-57 -51,-85 -15,-30 18,-44 32,-15 49,16 z m -261,488 q -5,36 2,78 -60,-12 -113,-56 -32,-17 -15,-47 17,-31 47,-10 21,11 38,20 17,9 41,15 z M 1756,234 q -1,0 2,54 3,54 3,118 1,125 0,258 -1,133 -36,267 -34,128 -75,218 -41,90 -89,157 -72,108 -196,183 -124,75 -259,98 4,-23 3,-47 -1,-24 0,-46 97,-33 183,-82 86,-49 126,-106 48,-66 89,-156 41,-90 75,-219 34,-133 35,-266 1,-133 1,-259 0,-63 -3,-117 -3,-54 0,-55 z m -677,1423 q 157,-10 291,-81 134,-71 228,-182 66,-78 124,-188 58,-110 94,-233 40,-143 50,-300 10,-157 11,-292 V 163 q 0,0 -155,0 -155,0 -404,0 H 647 q -9,0 -9,49 0,49 7,79 4,24 19,68 15,44 50,107 16,32 76,93 60,61 138,143 45,46 70,116 25,70 22,127 -37,-30 -81,-49 -212,-76 -307,-220 -7,-9 -45,-81 -20,-38 -34,-52 -19,-19 -55,-21 -56,-3 -87,54 -42,-12 -75,-10 -56,21 -81,45 -51,51 -66,102 -15,51 -16,110 0,84 104,222 122,159 130,242 0,36 7,81 6,31 25,60 13,20 17,27 4,7 17,23 9,12 15,18 6,6 15,18 11,13 28,30 -53,146 -43,301 199,-71 334,-223 33,113 130,183 80,-56 127,-148 z M 404,821 q 29,20 6,48 -24,23 -53,4 -61,-40 -65,-105 1,-33 39,-31 36,3 35,37 8,32 38,47 z m 252,498 q 22,11 22,11 30,12 19,44 -12,30 -46,20 -118,-43 -163,-158 -7,-33 24,-45 31,-10 42,22 8,17 12,22 11,-9 29,-12 61,-10 71,54 3,22 -10,42 z" display="block" - id="path2" + id="path96" inkscape:connector-curvature="0" /> <g - id="g16" + id="g110" transform="matrix(1,0,0,-1,0,2008)" style="fill:#ffffff;fill-rule:nonzero"> <path style="color:#000000;display:block" d="m 490,1365 q 4,-9 13,-27 17,-42 17,-50 -2,-28 -29,-28 -20,0 -47,57 -4,8 -12,14 -27,28 8,47 32,19 50,-13 z" display="block" - id="path4" + id="path98" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 1080,994 q 70,-92 69,-205 -4,-33 -38,-33 -46,0 -36,34 3,55 -11,91 -23,57 -51,85 -15,30 18,44 32,15 49,-16 z" display="block" - id="path6" + id="path100" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 819,506 q -5,-36 2,-78 -60,12 -113,56 -32,17 -15,47 17,31 47,10 21,-11 38,-20 17,-9 41,-15 z" display="block" - id="path8" + id="path102" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 1756,1774 q -1,0 2,-54 3,-54 3,-118 1,-125 0,-258 -1,-133 -36,-267 -34,-128 -75,-218 -41,-90 -89,-157 -72,-108 -196,-183 -124,-75 -259,-98 4,23 3,47 -1,24 0,46 97,33 183,82 86,49 126,106 48,66 89,156 41,90 75,219 34,133 35,266 1,133 1,259 0,63 -3,117 -3,54 0,55 z" display="block" - id="path10" + id="path104" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 404,1187 q 29,-20 6,-48 -24,-23 -53,-4 -61,40 -65,105 1,33 39,31 36,-3 35,-37 8,-32 38,-47 z" display="block" - id="path12" + id="path106" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 656,689 q 22,-11 22,-11 30,-12 19,-44 -12,-30 -46,-20 -118,43 -163,158 -7,33 24,45 31,10 42,-22 8,-17 12,-22 11,9 29,12 61,10 71,-54 3,-22 -10,-42 z" display="block" - id="path14" + id="path108" inkscape:connector-curvature="0" /> </g> - <path - style="fill:#aa0000;fill-opacity:1;stroke-width:8.67796612" - d="m 646.21921,175.7921 c -10.00828,10.0082 -6.30707,75.2883 7.31789,129.0694 27.57329,108.8385 73.24924,181.1348 197.493,312.5933 128.44638,135.9053 160.6095,189.813 169.0975,283.4197 l 4.725,52.1083 -33.83647,-22.2525 C 972.40607,918.4914 927.89153,896.0671 892.09492,880.8984 814.15749,847.8727 749.05703,807.3133 697.06758,759.3912 660.11356,725.3281 641.81606,699.5021 579.76729,593.8278 536.34666,519.8789 489.79786,506.2067 437.57098,552.0626 c -26.00964,22.8367 -34.35014,25.5487 -63.99469,20.8083 -67.1276,-10.7341 -154.55105,60.6648 -180.25316,147.2132 -33.0723,111.3665 -11.69934,184.2653 99.51191,339.4142 86.82291,121.1252 111.75745,175.1201 121.88812,263.9448 8.87757,77.8376 21.35225,103.8007 88.01133,183.175 l 32.96696,39.2554 -17.81128,56.2023 c -10.64395,33.5862 -19.77595,92.3966 -22.69362,146.1478 l -4.88234,89.9456 20.82256,-6.4593 c 69.74805,-21.6364 181.04741,-92.4125 256.8937,-163.3607 l 54.17301,-50.6745 20.73439,46.3355 c 24.62032,55.0195 87.52909,128.7762 109.83614,128.7762 16.95035,0 88.96959,-74.9661 108.73049,-113.1795 10.4458,-20.1998 20.4378,-24.5143 78.4435,-33.8717 281.7725,-45.4547 487.1035,-222.2127 620.3091,-533.9895 78.1472,-182.9086 102.0903,-333.0787 109.6803,-687.9084 l 5.4296,-253.8305 h -611.6812 c -336.42473,0 -614.28467,2.6034 -617.46659,5.7853 z M 1762.8767,315.3627 c 13.654,206.1902 2.6158,460.2011 -25.2131,580.1967 -34.5017,148.7685 -87.7838,281.2056 -154.8356,384.8571 -76.2582,117.8831 -159.8738,189.6003 -292.9046,251.2247 -65.0716,30.1433 -179.5274,65.7966 -187.0557,58.2683 -1.6178,-1.6178 -0.2907,-25.4936 2.9486,-53.0572 4.6832,-39.8466 9.4128,-51.037 23.0817,-54.6114 34.386,-8.9922 175.7428,-81.9213 215.8462,-111.3599 97.5639,-71.6185 192.5346,-263.6222 246.305,-497.959 11.9645,-52.1423 15.7265,-122.4629 18.9182,-353.6271 l 3.984,-288.5424 h 71.6612 71.6612 z M 507.37237,673.0288 c 20.55826,51.706 15.68732,78.4017 -14.30534,78.4017 -16.11508,0 -78.26025,-81.3404 -78.26025,-102.4331 0,-14.353 27.61574,-27.8896 52.04043,-25.5092 17.46106,1.7019 25.32851,11.3195 40.52516,49.5406 z M 360.47983,744.922 c 4.69917,5.9661 10.98909,21.1073 13.97759,33.647 2.98851,12.5399 15.24222,29.2265 27.23049,37.0815 37.59148,24.6308 23.39389,65.9495 -22.66105,65.9495 -48.06383,0 -106.80373,-90.7585 -85.04876,-131.408 9.9471,-18.5863 53.30676,-22.0223 66.50173,-5.27 z m 719.12927,262.6575 c 49.0435,49.0436 91.0188,201.7774 64.301,233.9703 -12.9227,15.5709 -57.148,17.6161 -66.1449,3.0588 -3.4481,-5.5791 -7.1601,-30.2561 -8.2488,-54.8377 -1.8989,-42.87 -35.3883,-126.2551 -55.7649,-138.8486 -15.31299,-9.4639 -9.6222,-37.6229 10.4438,-51.6777 25.5672,-17.9079 29.8089,-17.2699 55.4138,8.3349 z m -525.28107,197.4576 c 7.59653,16.6725 14.31795,19.1991 43.63712,16.4031 47.48399,-4.5284 68.50265,15.2454 68.50265,64.4454 0,29.4996 3.56342,38.2521 17.35593,42.6297 21.36617,6.7813 23.78917,48.9425 3.76768,65.5589 -11.14905,9.2528 -19.32737,9.24 -45.55933,-0.071 -94.58155,-33.5733 -185.04038,-152.38 -149.04466,-195.7522 16.50526,-19.8876 50.92201,-16.0799 61.34061,6.7864 z m 220.42209,272.8114 47.92107,23.5027 v 42.1668 c 0,39.7279 -1.12936,41.8185 -19.52543,36.1437 -51.63915,-15.9295 -119.32203,-61.1884 -119.32203,-79.7896 0,-19.8835 17.17128,-45.5263 30.48595,-45.5263 6.88566,0 34.08385,10.5762 60.44044,23.5027 z" - id="path26" - inkscape:connector-curvature="0" /> </svg> diff --git a/client/public/images/pieces/Ball/bc.svg b/client/public/images/pieces/Ball/bi.svg similarity index 54% rename from client/public/images/pieces/Ball/bc.svg rename to client/public/images/pieces/Ball/bi.svg index 6dbea895..8c5339cc 100644 --- a/client/public/images/pieces/Ball/bc.svg +++ b/client/public/images/pieces/Ball/bi.svg @@ -11,11 +11,11 @@ width="100%" version="1.1" viewBox="0 0 2048 2048" - id="svg112" - sodipodi:docname="bh.svg" + id="svg18" + sodipodi:docname="bd.svg" inkscape:version="0.92.4 5da689c313, 2019-01-14"> <metadata - id="metadata118"> + id="metadata24"> <rdf:RDF> <cc:Work rdf:about=""> @@ -27,7 +27,7 @@ </rdf:RDF> </metadata> <defs - id="defs116" /> + id="defs22" /> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" @@ -39,60 +39,65 @@ inkscape:pageshadow="2" inkscape:window-width="960" inkscape:window-height="1060" - id="namedview114" + id="namedview20" showgrid="false" inkscape:zoom="0.11523438" - inkscape:cx="1024" + inkscape:cx="1058.7119" inkscape:cy="1024" inkscape:window-x="0" inkscape:window-y="20" inkscape:window-maximized="0" - inkscape:current-layer="svg112" /> + inkscape:current-layer="svg18" /> <path style="color:#000000;display:block;fill:#000000;fill-rule:nonzero" d="m 490,643 q 4,9 13,27 17,42 17,50 -2,28 -29,28 -20,0 -47,-57 -4,-8 -12,-14 -27,-28 8,-47 32,-19 50,13 z m 590,371 q 70,92 69,205 -4,33 -38,33 -46,0 -36,-34 3,-55 -11,-91 -23,-57 -51,-85 -15,-30 18,-44 32,-15 49,16 z m -261,488 q -5,36 2,78 -60,-12 -113,-56 -32,-17 -15,-47 17,-31 47,-10 21,11 38,20 17,9 41,15 z M 1756,234 q -1,0 2,54 3,54 3,118 1,125 0,258 -1,133 -36,267 -34,128 -75,218 -41,90 -89,157 -72,108 -196,183 -124,75 -259,98 4,-23 3,-47 -1,-24 0,-46 97,-33 183,-82 86,-49 126,-106 48,-66 89,-156 41,-90 75,-219 34,-133 35,-266 1,-133 1,-259 0,-63 -3,-117 -3,-54 0,-55 z m -677,1423 q 157,-10 291,-81 134,-71 228,-182 66,-78 124,-188 58,-110 94,-233 40,-143 50,-300 10,-157 11,-292 V 163 q 0,0 -155,0 -155,0 -404,0 H 647 q -9,0 -9,49 0,49 7,79 4,24 19,68 15,44 50,107 16,32 76,93 60,61 138,143 45,46 70,116 25,70 22,127 -37,-30 -81,-49 -212,-76 -307,-220 -7,-9 -45,-81 -20,-38 -34,-52 -19,-19 -55,-21 -56,-3 -87,54 -42,-12 -75,-10 -56,21 -81,45 -51,51 -66,102 -15,51 -16,110 0,84 104,222 122,159 130,242 0,36 7,81 6,31 25,60 13,20 17,27 4,7 17,23 9,12 15,18 6,6 15,18 11,13 28,30 -53,146 -43,301 199,-71 334,-223 33,113 130,183 80,-56 127,-148 z M 404,821 q 29,20 6,48 -24,23 -53,4 -61,-40 -65,-105 1,-33 39,-31 36,3 35,37 8,32 38,47 z m 252,498 q 22,11 22,11 30,12 19,44 -12,30 -46,20 -118,-43 -163,-158 -7,-33 24,-45 31,-10 42,22 8,17 12,22 11,-9 29,-12 61,-10 71,54 3,22 -10,42 z" display="block" - id="path96" + id="path2" inkscape:connector-curvature="0" /> <g - id="g110" + id="g16" transform="matrix(1,0,0,-1,0,2008)" style="fill:#ffffff;fill-rule:nonzero"> <path style="color:#000000;display:block" d="m 490,1365 q 4,-9 13,-27 17,-42 17,-50 -2,-28 -29,-28 -20,0 -47,57 -4,8 -12,14 -27,28 8,47 32,19 50,-13 z" display="block" - id="path98" + id="path4" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 1080,994 q 70,-92 69,-205 -4,-33 -38,-33 -46,0 -36,34 3,55 -11,91 -23,57 -51,85 -15,30 18,44 32,15 49,-16 z" display="block" - id="path100" + id="path6" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 819,506 q -5,-36 2,-78 -60,12 -113,56 -32,17 -15,47 17,31 47,10 21,-11 38,-20 17,-9 41,-15 z" display="block" - id="path102" + id="path8" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 1756,1774 q -1,0 2,-54 3,-54 3,-118 1,-125 0,-258 -1,-133 -36,-267 -34,-128 -75,-218 -41,-90 -89,-157 -72,-108 -196,-183 -124,-75 -259,-98 4,23 3,47 -1,24 0,46 97,33 183,82 86,49 126,106 48,66 89,156 41,90 75,219 34,133 35,266 1,133 1,259 0,63 -3,117 -3,54 0,55 z" display="block" - id="path104" + id="path10" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 404,1187 q 29,-20 6,-48 -24,-23 -53,-4 -61,40 -65,105 1,33 39,31 36,-3 35,-37 8,-32 38,-47 z" display="block" - id="path106" + id="path12" inkscape:connector-curvature="0" /> <path style="color:#000000;display:block" d="m 656,689 q 22,-11 22,-11 30,-12 19,-44 -12,-30 -46,-20 -118,43 -163,158 -7,33 24,45 31,10 42,-22 8,-17 12,-22 11,9 29,12 61,10 71,-54 3,-22 -10,-42 z" display="block" - id="path108" + id="path14" inkscape:connector-curvature="0" /> </g> + <path + style="fill:#aa0000;fill-opacity:1;stroke-width:8.67796612" + d="m 646.21921,175.7921 c -10.00828,10.0082 -6.30707,75.2883 7.31789,129.0694 27.57329,108.8385 73.24924,181.1348 197.493,312.5933 128.44638,135.9053 160.6095,189.813 169.0975,283.4197 l 4.725,52.1083 -33.83647,-22.2525 C 972.40607,918.4914 927.89153,896.0671 892.09492,880.8984 814.15749,847.8727 749.05703,807.3133 697.06758,759.3912 660.11356,725.3281 641.81606,699.5021 579.76729,593.8278 536.34666,519.8789 489.79786,506.2067 437.57098,552.0626 c -26.00964,22.8367 -34.35014,25.5487 -63.99469,20.8083 -67.1276,-10.7341 -154.55105,60.6648 -180.25316,147.2132 -33.0723,111.3665 -11.69934,184.2653 99.51191,339.4142 86.82291,121.1252 111.75745,175.1201 121.88812,263.9448 8.87757,77.8376 21.35225,103.8007 88.01133,183.175 l 32.96696,39.2554 -17.81128,56.2023 c -10.64395,33.5862 -19.77595,92.3966 -22.69362,146.1478 l -4.88234,89.9456 20.82256,-6.4593 c 69.74805,-21.6364 181.04741,-92.4125 256.8937,-163.3607 l 54.17301,-50.6745 20.73439,46.3355 c 24.62032,55.0195 87.52909,128.7762 109.83614,128.7762 16.95035,0 88.96959,-74.9661 108.73049,-113.1795 10.4458,-20.1998 20.4378,-24.5143 78.4435,-33.8717 281.7725,-45.4547 487.1035,-222.2127 620.3091,-533.9895 78.1472,-182.9086 102.0903,-333.0787 109.6803,-687.9084 l 5.4296,-253.8305 h -611.6812 c -336.42473,0 -614.28467,2.6034 -617.46659,5.7853 z M 1762.8767,315.3627 c 13.654,206.1902 2.6158,460.2011 -25.2131,580.1967 -34.5017,148.7685 -87.7838,281.2056 -154.8356,384.8571 -76.2582,117.8831 -159.8738,189.6003 -292.9046,251.2247 -65.0716,30.1433 -179.5274,65.7966 -187.0557,58.2683 -1.6178,-1.6178 -0.2907,-25.4936 2.9486,-53.0572 4.6832,-39.8466 9.4128,-51.037 23.0817,-54.6114 34.386,-8.9922 175.7428,-81.9213 215.8462,-111.3599 97.5639,-71.6185 192.5346,-263.6222 246.305,-497.959 11.9645,-52.1423 15.7265,-122.4629 18.9182,-353.6271 l 3.984,-288.5424 h 71.6612 71.6612 z M 507.37237,673.0288 c 20.55826,51.706 15.68732,78.4017 -14.30534,78.4017 -16.11508,0 -78.26025,-81.3404 -78.26025,-102.4331 0,-14.353 27.61574,-27.8896 52.04043,-25.5092 17.46106,1.7019 25.32851,11.3195 40.52516,49.5406 z M 360.47983,744.922 c 4.69917,5.9661 10.98909,21.1073 13.97759,33.647 2.98851,12.5399 15.24222,29.2265 27.23049,37.0815 37.59148,24.6308 23.39389,65.9495 -22.66105,65.9495 -48.06383,0 -106.80373,-90.7585 -85.04876,-131.408 9.9471,-18.5863 53.30676,-22.0223 66.50173,-5.27 z m 719.12927,262.6575 c 49.0435,49.0436 91.0188,201.7774 64.301,233.9703 -12.9227,15.5709 -57.148,17.6161 -66.1449,3.0588 -3.4481,-5.5791 -7.1601,-30.2561 -8.2488,-54.8377 -1.8989,-42.87 -35.3883,-126.2551 -55.7649,-138.8486 -15.31299,-9.4639 -9.6222,-37.6229 10.4438,-51.6777 25.5672,-17.9079 29.8089,-17.2699 55.4138,8.3349 z m -525.28107,197.4576 c 7.59653,16.6725 14.31795,19.1991 43.63712,16.4031 47.48399,-4.5284 68.50265,15.2454 68.50265,64.4454 0,29.4996 3.56342,38.2521 17.35593,42.6297 21.36617,6.7813 23.78917,48.9425 3.76768,65.5589 -11.14905,9.2528 -19.32737,9.24 -45.55933,-0.071 -94.58155,-33.5733 -185.04038,-152.38 -149.04466,-195.7522 16.50526,-19.8876 50.92201,-16.0799 61.34061,6.7864 z m 220.42209,272.8114 47.92107,23.5027 v 42.1668 c 0,39.7279 -1.12936,41.8185 -19.52543,36.1437 -51.63915,-15.9295 -119.32203,-61.1884 -119.32203,-79.7896 0,-19.8835 17.17128,-45.5263 30.48595,-45.5263 6.88566,0 34.08385,10.5762 60.44044,23.5027 z" + id="path26" + inkscape:connector-curvature="0" /> </svg> diff --git a/client/public/images/pieces/Ball/wh.svg b/client/public/images/pieces/Ball/wh.svg index d10a14fe..eac3db53 100644 --- a/client/public/images/pieces/Ball/wh.svg +++ b/client/public/images/pieces/Ball/wh.svg @@ -12,7 +12,7 @@ version="1.1" viewBox="0 0 2048 2048" id="svg6" - sodipodi:docname="wd.svg" + sodipodi:docname="wh.svg" inkscape:version="0.92.4 5da689c313, 2019-01-14"> <metadata id="metadata12"> @@ -42,7 +42,7 @@ id="namedview8" showgrid="false" inkscape:zoom="0.11523438" - inkscape:cx="1058.7119" + inkscape:cx="1041.3559" inkscape:cy="1024" inkscape:window-x="0" inkscape:window-y="20" @@ -60,9 +60,4 @@ display="block" id="path4" inkscape:connector-curvature="0" /> - <path - style="fill:#ffcc00;fill-opacity:1;stroke-width:8.67796612" - d="m 722.74458,280.6393 c 16.40726,109.4115 63.67577,182.6701 199.96743,309.9175 83.23649,77.713 104.10369,102.5993 129.91119,154.9325 38.7086,78.4943 53.3173,152.8139 42.3597,215.499 -7.3451,42.0189 -5.7974,51.4946 16.2498,99.4901 29.0323,63.2018 43.8935,142.6732 32.3551,173.0216 -6.0672,15.9577 -14.4923,21.2525 -33.8168,21.2525 -32.2052,0 -37.9061,-9.2458 -39.6909,-64.3713 -0.7855,-24.2568 -9.4727,-62.1541 -19.3051,-84.2163 C 1018.2276,1033.1343 978.35888,999.2764 852.82037,938.0551 701.93084,864.4709 624.80219,794.9675 554.20941,668.9661 506.59176,583.973 490.93259,567.6979 473.52368,585.1069 c -6.93497,6.9349 -1.83237,24.7258 18.68537,65.149 31.8715,62.792 32.79204,95.3592 2.8157,99.6156 -14.60744,2.0742 -23.42111,-4.3334 -34.71186,-25.2359 -8.32328,-15.4087 -25.37742,-39.895 -37.8981,-54.4138 -56.20367,-65.1735 -161.78391,-2.1435 -176.57684,105.4139 -8.3618,60.7976 10.55309,105.8294 105.67285,251.5819 102.82608,157.5609 123.8202,201.2119 124.04174,257.9078 0.18267,46.7461 30.82423,124.2095 62.51052,158.0299 l 17.97199,19.1823 16.79537,-21.3518 c 18.20256,-23.1408 40.68698,-27.4413 57.18992,-10.9383 15.47223,15.4722 13.27433,27.9693 -19.34645,110.002 -27.52833,69.2265 -54.37982,180.1677 -45.706,188.8416 5.77615,5.7761 128.94222,-79.1139 155.9892,-107.5128 l 24.11642,-25.3219 -35.49115,-16.0043 c -44.41077,-20.0264 -55.43387,-38.5441 -37.87079,-63.6189 16.49659,-23.5522 27.89964,-23.4312 78.03159,0.8278 l 40.34981,19.5254 13.0086,-19.5254 c 8.43604,-12.6622 21.72941,-19.5254 37.81868,-19.5254 20.06687,0 25.767,4.5624 29.81528,23.8644 17.49782,83.4285 25.29925,106.2769 48.89022,143.1864 14.49044,22.6712 29.64551,41.2204 33.67793,41.2204 13.11696,0 52.47762,-58.6544 69.59962,-103.716 9.1944,-24.1976 16.717,-62.6981 16.717,-85.5568 0,-47.5478 10.6948,-62.3882 44.9601,-62.3882 29.3042,0 37.8281,24.2325 30.4467,86.5564 -5.6719,47.891 -10.5631,47.0403 89.4746,15.561 145.9368,-45.9226 280.8633,-145.6645 363.2466,-268.5231 69.6749,-103.9064 133.4153,-263.4264 166.6274,-417.0104 20.2898,-93.8263 32.0005,-386.0828 21.5662,-538.2111 l -6.3985,-93.2881 H 1233.0542 716.56493 Z m -364.96444,484.428 c 7.50025,7.5002 13.63681,20.4873 13.63681,28.8602 0,8.3729 9.94031,24.5618 22.08958,35.9755 24.88653,23.3797 25.9875,57.3133 2.33977,72.1159 -31.07515,19.4519 -86.83428,-35.2232 -99.25463,-97.3249 -9.16803,-45.8402 29.76275,-71.0525 61.18847,-39.6267 z m 236.46459,439.7869 c 12.64983,15.6164 23.03712,18.9992 51.88393,16.8968 29.40919,-2.1434 38.62092,1.0166 49.8983,17.1173 7.60686,10.8603 13.83067,32.8953 13.83067,48.9665 0,19.4332 6.25147,34.2826 18.66417,44.3338 22.50576,18.2241 16.93304,57.2265 -9.36938,65.5746 -55.67266,17.6698 -191.53208,-102.0486 -191.53208,-168.7768 0,-44.2527 38.9045,-58.3327 66.62439,-24.1122 z" - id="path14" - inkscape:connector-curvature="0" /> </svg> diff --git a/client/public/images/pieces/Ball/wc.svg b/client/public/images/pieces/Ball/wi.svg similarity index 59% rename from client/public/images/pieces/Ball/wc.svg rename to client/public/images/pieces/Ball/wi.svg index eac3db53..d10a14fe 100644 --- a/client/public/images/pieces/Ball/wc.svg +++ b/client/public/images/pieces/Ball/wi.svg @@ -12,7 +12,7 @@ version="1.1" viewBox="0 0 2048 2048" id="svg6" - sodipodi:docname="wh.svg" + sodipodi:docname="wd.svg" inkscape:version="0.92.4 5da689c313, 2019-01-14"> <metadata id="metadata12"> @@ -42,7 +42,7 @@ id="namedview8" showgrid="false" inkscape:zoom="0.11523438" - inkscape:cx="1041.3559" + inkscape:cx="1058.7119" inkscape:cy="1024" inkscape:window-x="0" inkscape:window-y="20" @@ -60,4 +60,9 @@ display="block" id="path4" inkscape:connector-curvature="0" /> + <path + style="fill:#ffcc00;fill-opacity:1;stroke-width:8.67796612" + d="m 722.74458,280.6393 c 16.40726,109.4115 63.67577,182.6701 199.96743,309.9175 83.23649,77.713 104.10369,102.5993 129.91119,154.9325 38.7086,78.4943 53.3173,152.8139 42.3597,215.499 -7.3451,42.0189 -5.7974,51.4946 16.2498,99.4901 29.0323,63.2018 43.8935,142.6732 32.3551,173.0216 -6.0672,15.9577 -14.4923,21.2525 -33.8168,21.2525 -32.2052,0 -37.9061,-9.2458 -39.6909,-64.3713 -0.7855,-24.2568 -9.4727,-62.1541 -19.3051,-84.2163 C 1018.2276,1033.1343 978.35888,999.2764 852.82037,938.0551 701.93084,864.4709 624.80219,794.9675 554.20941,668.9661 506.59176,583.973 490.93259,567.6979 473.52368,585.1069 c -6.93497,6.9349 -1.83237,24.7258 18.68537,65.149 31.8715,62.792 32.79204,95.3592 2.8157,99.6156 -14.60744,2.0742 -23.42111,-4.3334 -34.71186,-25.2359 -8.32328,-15.4087 -25.37742,-39.895 -37.8981,-54.4138 -56.20367,-65.1735 -161.78391,-2.1435 -176.57684,105.4139 -8.3618,60.7976 10.55309,105.8294 105.67285,251.5819 102.82608,157.5609 123.8202,201.2119 124.04174,257.9078 0.18267,46.7461 30.82423,124.2095 62.51052,158.0299 l 17.97199,19.1823 16.79537,-21.3518 c 18.20256,-23.1408 40.68698,-27.4413 57.18992,-10.9383 15.47223,15.4722 13.27433,27.9693 -19.34645,110.002 -27.52833,69.2265 -54.37982,180.1677 -45.706,188.8416 5.77615,5.7761 128.94222,-79.1139 155.9892,-107.5128 l 24.11642,-25.3219 -35.49115,-16.0043 c -44.41077,-20.0264 -55.43387,-38.5441 -37.87079,-63.6189 16.49659,-23.5522 27.89964,-23.4312 78.03159,0.8278 l 40.34981,19.5254 13.0086,-19.5254 c 8.43604,-12.6622 21.72941,-19.5254 37.81868,-19.5254 20.06687,0 25.767,4.5624 29.81528,23.8644 17.49782,83.4285 25.29925,106.2769 48.89022,143.1864 14.49044,22.6712 29.64551,41.2204 33.67793,41.2204 13.11696,0 52.47762,-58.6544 69.59962,-103.716 9.1944,-24.1976 16.717,-62.6981 16.717,-85.5568 0,-47.5478 10.6948,-62.3882 44.9601,-62.3882 29.3042,0 37.8281,24.2325 30.4467,86.5564 -5.6719,47.891 -10.5631,47.0403 89.4746,15.561 145.9368,-45.9226 280.8633,-145.6645 363.2466,-268.5231 69.6749,-103.9064 133.4153,-263.4264 166.6274,-417.0104 20.2898,-93.8263 32.0005,-386.0828 21.5662,-538.2111 l -6.3985,-93.2881 H 1233.0542 716.56493 Z m -364.96444,484.428 c 7.50025,7.5002 13.63681,20.4873 13.63681,28.8602 0,8.3729 9.94031,24.5618 22.08958,35.9755 24.88653,23.3797 25.9875,57.3133 2.33977,72.1159 -31.07515,19.4519 -86.83428,-35.2232 -99.25463,-97.3249 -9.16803,-45.8402 29.76275,-71.0525 61.18847,-39.6267 z m 236.46459,439.7869 c 12.64983,15.6164 23.03712,18.9992 51.88393,16.8968 29.40919,-2.1434 38.62092,1.0166 49.8983,17.1173 7.60686,10.8603 13.83067,32.8953 13.83067,48.9665 0,19.4332 6.25147,34.2826 18.66417,44.3338 22.50576,18.2241 16.93304,57.2265 -9.36938,65.5746 -55.67266,17.6698 -191.53208,-102.0486 -191.53208,-168.7768 0,-44.2527 38.9045,-58.3327 66.62439,-24.1122 z" + id="path14" + inkscape:connector-curvature="0" /> </svg> diff --git a/client/src/App.vue b/client/src/App.vue index caf91a96..ed8d1520 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -24,8 +24,7 @@ router-link(to="/problems") | {{ st.tr["Problems"] }} #rightMenu - .clickable(onClick="window.doClick('modalUser')") - | {{ st.user.id > 0 ? (st.user.name || "@nonymous") : "Login" }} + .clickable(onClick="window.doClick('modalUser')") {{ userName }} #divSettings.clickable(onClick="window.doClick('modalSettings')") span {{ st.tr["Settings"] }} img(src="/images/icons/settings.svg") @@ -72,6 +71,15 @@ export default { } ); }, + computed: { + userName: function() { + return ( + this.st.user.id > 0 + ? (this.st.user.name || "@nonymous") + : "Login" + ); + } + }, methods: { hideDrawer: function(e) { e.preventDefault(); //TODO: why is this needed? diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 177fc9b6..d1348e71 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -27,7 +27,8 @@ export const Move = class Move { } }; -// NOTE: x coords = top to bottom; y = left to right (from white player perspective) +// NOTE: x coords = top to bottom; y = left to right +// (from white player perspective) export const ChessRules = class ChessRules { ////////////// // MISC UTILS @@ -257,7 +258,8 @@ export const ChessRules = class ChessRules { getCheckSquares(color) { return ( this.underCheck(color) - ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! + // kingPos must be duplicated, because it may change: + ? [JSON.parse(JSON.stringify(this.kingPos[color]))] : [] ); } @@ -466,7 +468,8 @@ export const ChessRules = class ChessRules { // Scan board for kings positions scanKings(fen) { this.INIT_COL_KING = { w: -1, b: -1 }; - this.kingPos = { w: [-1, -1], b: [-1, -1] }; //squares of white and black king + // Squares of white and black king: + this.kingPos = { w: [-1, -1], b: [-1, -1] }; const fenRows = V.ParseFen(fen).position.split("/"); const startRow = { 'w': V.size.x - 1, 'b': 0 }; for (let i = 0; i < fenRows.length; i++) { @@ -841,7 +844,7 @@ export const ChessRules = class ChessRules { if (this.castleFlags[c][castleSide] >= V.size.y) continue; // If this code is reached, rook and king are on initial position - // NOTE: in some variants this is not a rook, but let's keep variable name + // NOTE: in some variants this is not a rook const rookPos = this.castleFlags[c][castleSide]; const castlingPiece = this.getPiece(x, rookPos); if (this.getColor(x, rookPos) != c) @@ -886,8 +889,18 @@ export const ChessRules = class ChessRules { moves.push( new Move({ appear: [ - new PiPo({ x: x, y: finalSquares[castleSide][0], p: V.KING, c: c }), - new PiPo({ x: x, y: finalSquares[castleSide][1], p: castlingPiece, c: c }) + new PiPo({ + x: x, + y: finalSquares[castleSide][0], + p: V.KING, + c: c + }), + new PiPo({ + x: x, + y: finalSquares[castleSide][1], + p: castlingPiece, + c: c + }) ], vanish: [ new PiPo({ x: x, y: y, p: V.KING, c: c }), @@ -943,7 +956,7 @@ export const ChessRules = class ChessRules { } // Stop at the first move found - // TODO: not really, it explores all moves from a square but one would suffice. + // TODO: not really, it explores all moves from a square (one is enough). atLeastOneMove() { const color = this.turn; for (let i = 0; i < V.size.x; i++) { @@ -1082,7 +1095,8 @@ export const ChessRules = class ChessRules { // this.states.push(stateFen); this.prePlay(move); - if (V.HasFlags) move.flags = JSON.stringify(this.aggregateFlags()); //save flags (for undo) + // Save flags (for undo) + if (V.HasFlags) move.flags = JSON.stringify(this.aggregateFlags()); if (V.HasEnpassant) this.epSquares.push(this.getEpSquare(move)); V.PlayOnBoard(this.board, move); this.turn = V.GetOppCol(this.turn); @@ -1200,7 +1214,7 @@ export const ChessRules = class ChessRules { return V.INFINITY; } - // Search depth: 1,2 for high branching factor, 4 for small (Loser chess, eg.) + // Search depth: 1,2 for e.g. higher branching factor, 4 for smaller static get SEARCH_DEPTH() { return 3; } @@ -1373,4 +1387,28 @@ export const ChessRules = class ChessRules { finalSquare ); } + + static GetUnambiguousNotation(move) { + // Machine-readable format with all the informations about the move + return ( + (!!move.start && V.OnBoard(move.start.x, move.start.y) + ? V.CoordsToSquare(move.start) + : "-" + ) + "." + + (!!move.end && V.OnBoard(move.end.x, move.end.y) + ? V.CoordsToSquare(move.end) + : "-" + ) + " " + + (!!move.appear && move.appear.length > 0 + ? move.appear.map(a => + a.c + a.p + V.CoordsToSquare({ x: a.x, y: a.y })).join(".") + : "-" + ) + "/" + + (!!move.vanish && move.vanish.length > 0 + ? move.vanish.map(a => + a.c + a.p + V.CoordsToSquare({ x: a.x, y: a.y })).join(".") + : "-" + ) + ); + } }; diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index d9540eb3..0ed908a5 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -60,6 +60,7 @@ div#baseGame <script> import Board from "@/components/Board.vue"; import MoveList from "@/components/MoveList.vue"; +import params from "@/parameters"; import { store } from "@/store"; import { getSquareId } from "@/utils/squareId"; import { getDate } from "@/utils/datetime"; @@ -205,6 +206,7 @@ export default { if (!Array.isArray(move)) move = [move]; move.forEach((m,idx) => { m.notation = this.vr.getNotation(m); + m.unambiguous = V.GetUnambiguousNotation(m); this.vr.play(m); if (idx < L - 1 && this.vr.getCheckSquares(this.vr.turn).length > 0) m.notation += "+"; @@ -214,6 +216,7 @@ export default { // 'start' & 'end' is required for Board component this.moves.unshift({ notation: "...", + unambiguous: "...", start: { x: -1, y: -1 }, end: { x: -1, y: -1 }, fen: game.fenStart @@ -271,13 +274,23 @@ export default { pgn += '[White "' + this.game.players[0].name + '"]\n'; pgn += '[Black "' + this.game.players[1].name + '"]\n'; pgn += '[Fen "' + this.game.fenStart + '"]\n'; - pgn += '[Result "' + this.game.score + '"]\n\n'; + pgn += '[Result "' + this.game.score + '"]\n'; + if (!!this.game.id) + pgn += '[URL "' + params.serverUrl + '/game/' + this.game.id + '"]\n'; + pgn += '\n'; for (let i = 0; i < this.moves.length; i += 2) { - pgn += (i/2+1) + "." + getFullNotation(this.moves[i]) + " "; + if (i > 0) pgn += " "; + pgn += (i/2+1) + "." + getFullNotation(this.moves[i]); if (i+1 < this.moves.length) - pgn += getFullNotation(this.moves[i+1]) + " "; + pgn += " " + getFullNotation(this.moves[i+1]); } - return pgn + "\n"; + pgn += "\n\n"; + for (let i = 0; i < this.moves.length; i += 2) { + pgn += getFullNotation(this.moves[i], "unambiguous") + "\n"; + if (i+1 < this.moves.length) + pgn += getFullNotation(this.moves[i+1], "unambiguous") + "\n"; + } + return pgn; }, showEndgameMsg: function(message) { this.endgameMessage = message; @@ -321,14 +334,15 @@ export default { "#" + getSquareId(move.start) + " > img.piece" ); // For some unknown reasons Opera get "movingPiece == null" error - // TOOO: is it calling 'animate()' twice ? One extra time ? + // TODO: is it calling 'animate()' twice ? One extra time ? if (!movingPiece) return; - // HACK for animation (with positive translate, image slides "under background") - // Possible improvement: just alter squares on the piece's way... const squares = document.getElementsByClassName("board"); for (let i = 0; i < squares.length; i++) { let square = squares.item(i); - if (square.id != getSquareId(move.start)) square.style.zIndex = "-1"; + if (square.id != getSquareId(move.start)) + // HACK for animation: + // (with positive translate, image slides "under background") + square.style.zIndex = "-1"; } movingPiece.style.transform = "translate(" + translation.x + "px," + translation.y + "px)"; @@ -365,6 +379,7 @@ export default { const navigate = !move; const playSubmove = (smove) => { smove.notation = this.vr.getNotation(smove); + smove.unambiguous = V.GetUnambiguousNotation(smove); this.vr.play(smove); this.lastMove = smove; if (!this.inMultimove) { @@ -429,7 +444,7 @@ export default { if (this.vr.turn != initurn) { // Turn has changed: move is complete if (!smove.fen) - // NOTE: only FEN of last sub-move is required (thus setting it here) + // NOTE: only FEN of last sub-move is required (=> setting it here) smove.fen = this.vr.getFen(); // Is opponent in check? this.incheck = this.vr.getCheckSquares(this.vr.turn); diff --git a/client/src/components/Board.vue b/client/src/components/Board.vue index 5f888805..71cac153 100644 --- a/client/src/components/Board.vue +++ b/client/src/components/Board.vue @@ -4,7 +4,7 @@ import { ArrayFun } from "@/utils/array"; import { store } from "@/store"; export default { name: "my-board", - // Last move cannot be guessed from here, and is required to highlight squares + // Last move cannot be guessed from here, and is required for highlights. // vr: object to check moves, print board... // userColor is left undefined for an external observer props: [ @@ -153,8 +153,10 @@ export default { "in-shadow": inShadow(ci, cj), "highlight-light": inHighlight(ci, cj) && lightSquare, "highlight-dark": inHighlight(ci, cj) && !lightSquare, - "incheck-light": showCheck && lightSquare && incheckSq[ci][cj], - "incheck-dark": showCheck && !lightSquare && incheckSq[ci][cj] + "incheck-light": + showCheck && lightSquare && incheckSq[ci][cj], + "incheck-dark": + showCheck && !lightSquare && incheckSq[ci][cj] }, attrs: { id: getSquareId({ x: ci, y: cj }) diff --git a/client/src/components/ChallengeList.vue b/client/src/components/ChallengeList.vue index 8c1f2dd5..1107b58c 100644 --- a/client/src/components/ChallengeList.vue +++ b/client/src/components/ChallengeList.vue @@ -33,7 +33,8 @@ export default { }, computed: { sortedChallenges: function() { - // Show in order: challenges I sent, challenges I received, other challenges + // Show in order: + // challenges I sent, challenges I received, other challenges let minAdded = Number.MAX_SAFE_INTEGER; let maxAdded = 0; let augmentedChalls = this.challenges.map(c => { diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 2bad3014..91d138ef 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -114,9 +114,11 @@ export default { // $nextTick to wait for table > tr to be rendered this.$nextTick(() => { let curMove = document.querySelector(".td.highlight-lm"); - if (!curMove && this.moves.length > 0) + if (!curMove && this.moves.length > 0) { // Cursor is before game beginning, and some moves were made: - curMove = document.querySelector(".moves-list > .tr:first-child > .td"); + curMove = + document.querySelector(".moves-list > .tr:first-child > .td"); + } if (!!curMove) { curMove.scrollIntoView({ behavior: "auto", diff --git a/client/src/data/userCheck.js b/client/src/data/userCheck.js index 0d3a801b..d6fa7c13 100644 --- a/client/src/data/userCheck.js +++ b/client/src/data/userCheck.js @@ -1,7 +1,8 @@ export function checkNameEmail(o) { if (typeof o.name === "string") { if (o.name.length == 0) return "Missing name"; - if (!o.name.match(/^[\w-]+$/)) return "Name: alphanumerics, hyphen and underscore"; + if (!o.name.match(/^[\w-]+$/)) + return "Name: alphanumerics, hyphen and underscore"; } if (typeof o.email === "string") { diff --git a/client/src/store.js b/client/src/store.js index 792d2a5b..33d03121 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -1,8 +1,9 @@ -// NOTE: do not use ajax() here because ajax.js require the store for translations +// NOTE: do not use ajax() here because ajax.js requires the store import params from "./parameters"; //for server URL import { getRandString } from "./utils/alea"; -// Global store: see https://medium.com/fullstackio/managing-state-in-vue-js-23a0352b1c87 +// Global store: see +// https://medium.com/fullstackio/managing-state-in-vue-js-23a0352b1c87 export const store = { state: { variants: [], diff --git a/client/src/translations/rules/Alice/es.pug b/client/src/translations/rules/Alice/es.pug index 017a53b3..fe2fe056 100644 --- a/client/src/translations/rules/Alice/es.pug +++ b/client/src/translations/rules/Alice/es.pug @@ -51,7 +51,8 @@ h3 Más información p | Ver las páginas dedicadas a esta variante en - a(href="https://www.chessvariants.com/other.dir/alice.html") chessvariants.com + a(href="https://www.chessvariants.com/other.dir/alice.html") + | chessvariants.com | y a(href="https://www.schemingmind.com/journalarticle.aspx?article_id=9") | schemingmind.com diff --git a/client/src/translations/rules/Allmate1/en.pug b/client/src/translations/rules/Allmate1/en.pug index 24dfe9d1..ab60488a 100644 --- a/client/src/translations/rules/Allmate1/en.pug +++ b/client/src/translations/rules/Allmate1/en.pug @@ -34,7 +34,8 @@ p. h3 Source p - a(href="https://www.chessvariants.com/difftaking.dir/allmate.html") Allmate chess + a(href="https://www.chessvariants.com/difftaking.dir/allmate.html") + | Allmate chess | on chessvariants.com. p Inventor: Dr. Chris Taylor (1979) diff --git a/client/src/translations/rules/Allmate1/es.pug b/client/src/translations/rules/Allmate1/es.pug index 9eca21ad..73c7bafc 100644 --- a/client/src/translations/rules/Allmate1/es.pug +++ b/client/src/translations/rules/Allmate1/es.pug @@ -2,8 +2,8 @@ p.boxed | Si una pieza es atacada y no puede escapar del ataque, se captura. p. - Si se ataca una pieza y ningún movimiento ortodoxo puede evitar su - capturado (en el sentido habitual), se considera matado y se elimina del juego. + Si se ataca una pieza y ningún movimiento ortodoxo puede evitar su capturado + (en el sentido habitual), se considera matado y se elimina del juego. Si tal movimiento ortodoxo existe, no necesita ser jugado (incluso podrÃa ser ilegal porque las capturas normales están prohibidas): la pieza no se captura. @@ -22,9 +22,9 @@ figure.diagram-container p. Nota sobre la notación de las jugadas: ya que las capturas no se realizan - en la casilla de llegada, se agrega una marca "X" al movimiento para indicar la captura. - Para evitar las notaciones demasiado largas, la lista potencial de casillas - de captura no está escrita. + en la casilla de llegada, se agrega una marca "X" al movimiento para indicar + la captura. Para evitar las notaciones demasiado largas, la lista potencial + de casillas de captura no está escrita. h3 Nota "suicidio" @@ -36,7 +36,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/difftaking.dir/allmate.html") variante Allmate + a(href="https://www.chessvariants.com/difftaking.dir/allmate.html") + | variante Allmate | en chessvariants.com. p Inventor: Dr. Chris Taylor (1979) diff --git a/client/src/translations/rules/Allmate1/fr.pug b/client/src/translations/rules/Allmate1/fr.pug index d3c9f774..bfed36ec 100644 --- a/client/src/translations/rules/Allmate1/fr.pug +++ b/client/src/translations/rules/Allmate1/fr.pug @@ -1,5 +1,6 @@ p.boxed - | Si une pièce est attaquée et ne peut se soustraire à l'attaque, elle est capturée. + | Si une pièce est attaquée et ne peut se soustraire à l'attaque, + | elle est capturée. p. Si une pièce est attaquée et qu'aucun coup orthodoxe ne peut empêcher sa @@ -10,8 +11,8 @@ p. Ainsi, les rois et autres pièces peuvent rester en échec. p. - Les pièces ne peuvent capturer au sens habituel, seulement via la "mat-capture" - décrite ci-dessus. + Les pièces ne peuvent capturer au sens habituel, seulement via la + "mat-capture" décrite ci-dessus. p La partie s'achève quand un roi est "mat-capturé". @@ -22,21 +23,23 @@ figure.diagram-container p. Note sur la notation des coups: puisque les captures ne s'effectuent pas - sur la case d'arrivée, une marque "X" est ajoutée au coup pour indiquer la capture. - Afin d'éviter les notations à rallonge la liste potentielle des cases de - capture n'est pas écrite. + sur la case d'arrivée, une marque "X" est ajoutée au coup pour indiquer la + capture. Afin d'éviter les notations à rallonge la liste potentielle des + cases de capture n'est pas écrite. h3 Note "suicide" p. - Dans l'implémentation actuelle, toutes les pièces à l'exception des rois peuvent - "se suicider", c'est-à -dire aller ou rester sur une case où elles sont matées. + Dans l'implémentation actuelle, toutes les pièces à l'exception des rois + peuvent "se suicider", c'est-à -dire aller ou rester sur une case où elles + sont matées. h3 Source p | La - a(href="https://www.chessvariants.com/difftaking.dir/allmate.html") variante Allmate + a(href="https://www.chessvariants.com/difftaking.dir/allmate.html") + | variante Allmate | sur chessvariants.com. p Inventeur : Dr. Chris Taylor (1979) diff --git a/client/src/translations/rules/Allmate2/es.pug b/client/src/translations/rules/Allmate2/es.pug index 3b4fd8ea..f3b59741 100644 --- a/client/src/translations/rules/Allmate2/es.pug +++ b/client/src/translations/rules/Allmate2/es.pug @@ -3,8 +3,8 @@ p.boxed | la toma por movimientos sin captura. p. - Esta es exactamente la variante Allmate1, con una condición de mate más débil: - no se consideran las capturas para escapar de un jaque mate. + Esta es exactamente la variante Allmate1, con una condición de mate más + débil: no se consideran las capturas para escapar de un jaque mate. Por lo tanto, las (mate-)capturas son más fáciles: en el siguiente diagrama, 1.Qe6 toma los peones d7, e7 y f7. diff --git a/client/src/translations/rules/Allmate2/fr.pug b/client/src/translations/rules/Allmate2/fr.pug index 21e96faa..b8d959f8 100644 --- a/client/src/translations/rules/Allmate2/fr.pug +++ b/client/src/translations/rules/Allmate2/fr.pug @@ -3,8 +3,8 @@ p.boxed | empêchée par des coups non capturants. p. - C'est exactement la variante Allmate1, avec une condition de mat plus faible : - les coups capturants pour échapper à un mat ne sont pas considérés. + C'est exactement la variante Allmate1, avec une condition de mat plus + faible : les coups capturants pour échapper à un mat ne sont pas considérés. Les (mat-)captures sont donc plus faciles : sur le diagramme suivant, 1.Qe6 prend les pions d7, e7 et f7. diff --git a/client/src/translations/rules/Antimatter/en.pug b/client/src/translations/rules/Antimatter/en.pug index 9fc7511b..ed99e0b3 100644 --- a/client/src/translations/rules/Antimatter/en.pug +++ b/client/src/translations/rules/Antimatter/en.pug @@ -18,7 +18,8 @@ figure.diagram-container h3 Source p - a(href="https://www.chessvariants.com/rules/antimatter-chess") Antimatter chess + a(href="https://www.chessvariants.com/rules/antimatter-chess") + | Antimatter chess | on chessvariants.com. p Inventor: Claudio Martins Jaguaribe (2010) diff --git a/client/src/translations/rules/Antimatter/es.pug b/client/src/translations/rules/Antimatter/es.pug index 05588d4a..50da7284 100644 --- a/client/src/translations/rules/Antimatter/es.pug +++ b/client/src/translations/rules/Antimatter/es.pug @@ -19,7 +19,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/rules/antimatter-chess") variante Antimateria + a(href="https://www.chessvariants.com/rules/antimatter-chess") + | variante Antimateria | en chessvariants.com. p Inventor: Claudio Martins Jaguaribe (2010) diff --git a/client/src/translations/rules/Antimatter/fr.pug b/client/src/translations/rules/Antimatter/fr.pug index 3dc01564..4c2fd111 100644 --- a/client/src/translations/rules/Antimatter/fr.pug +++ b/client/src/translations/rules/Antimatter/fr.pug @@ -19,7 +19,8 @@ h3 Source p | La - a(href="https://www.chessvariants.com/rules/antimatter-chess") variante Antimatière + a(href="https://www.chessvariants.com/rules/antimatter-chess") + | variante Antimatière | sur chessvariants.com. p Inventeur : Claudio Martins Jaguaribe (2010) diff --git a/client/src/translations/rules/Arena/en.pug b/client/src/translations/rules/Arena/en.pug index 9fd3b83f..ffe5ea6c 100644 --- a/client/src/translations/rules/Arena/en.pug +++ b/client/src/translations/rules/Arena/en.pug @@ -13,8 +13,8 @@ ul p. The 4x8 area in the center of the board (the area in which no pieces start) - is known as the Arena. A piece that is not currently in the Arena may only move - if it is to enter the Arena. A piece which is currently in the Arena may + is known as the Arena. A piece that is not currently in the Arena may only + move if it is to enter the Arena. A piece which is currently in the Arena may only move to capture something in the Arena. p A player wins if: @@ -38,7 +38,8 @@ p. h3 Source p - a(href="https://www.chessvariants.com/32turn.dir/arenachess.html") Arena chess + a(href="https://www.chessvariants.com/32turn.dir/arenachess.html") + | Arena chess | on chessvariants.com. p Inventor: Jeff Kiska (2000) diff --git a/client/src/translations/rules/Arena/es.pug b/client/src/translations/rules/Arena/es.pug index 00a64084..67366aa3 100644 --- a/client/src/translations/rules/Arena/es.pug +++ b/client/src/translations/rules/Arena/es.pug @@ -13,10 +13,10 @@ ul duques significa perder la partida. p. - El área de tamaño 4x8 en el centro del tablero de ajedrez (inicialmente vacÃa) - se llama la "arena". Una pieza fuera de la arena solo puede realizar - un movimiento entrando en él. - Una pieza que ya está en la arena solo puede moverse capturando algo en esta área. + El área de tamaño 4x8 en el centro del tablero de ajedrez (inicialmente + vacÃa) se llama la "arena". Una pieza fuera de la arena solo puede realizar + un movimiento entrando en él. Una pieza que ya está en la arena solo puede + moverse capturando algo en esta área. p Un jugador gana si: ul @@ -32,15 +32,16 @@ figure.diagram-container figcaption Después de los movimientos 1.e4 Nd6 2.Bg4 Nxe4. p. - En la situación del diagrama, el alfil en g4 no puede capturar nada en la arena, - y por lo tanto no puede moverse. Tenga en cuenta que 1...d5?? 2.exd5 1-0, - porque los negros no tendrÃa piezas en la arena. + En la situación del diagrama, el alfil en g4 no puede capturar nada en la + arena, y por lo tanto no puede moverse. Tenga en cuenta que + 1...d5?? 2.exd5 1-0, porque los negros no tendrÃa piezas en la arena. h3 Fuente p | La - a(href="https://www.chessvariants.com/32turn.dir/arenachess.html") variante Arena + a(href="https://www.chessvariants.com/32turn.dir/arenachess.html") + | variante Arena | en chessvariants.com. p Inventor: Jeff Kiska (2000) diff --git a/client/src/translations/rules/Arena/fr.pug b/client/src/translations/rules/Arena/fr.pug index 49127763..f1f1c792 100644 --- a/client/src/translations/rules/Arena/fr.pug +++ b/client/src/translations/rules/Arena/fr.pug @@ -8,9 +8,9 @@ ul le pion peut capturer en diagonale vers arrière. li. Le roi et la reine sont remplacés par des ducs. - Un duc peut se déplacer d'une, deux ou trois cases dans toutes les directions. - Il peut se retrouver en échec à tout moment, mais perdre ses deux - ducs signifie perdre la partie. + Un duc peut se déplacer d'une, deux ou trois cases dans toutes les + directions. Il peut se retrouver en échec à tout moment, mais perdre ses + deux ducs signifie perdre la partie. p. La zone de taille 4x8 au centre de l'échiquier (initialement vide) @@ -33,15 +33,16 @@ figure.diagram-container figcaption Après les coups 1.e4 Nd6 2.Bg4 Nxe4. p. - Dans la situation du diagramme, le fou en g4 ne peut rien capturer dans l'arène, - et donc ne peut pas bouger. Notez que 1...d5?? 2.exd5 1-0, car les noirs - n'auraient aucune pièce dans l'arène. + Dans la situation du diagramme, le fou en g4 ne peut rien capturer dans + l'arène, et donc ne peut pas bouger. Notez que 1...d5?? 2.exd5 1-0, + car les noirs n'auraient aucune pièce dans l'arène. h3 Source p | La - a(href="https://www.chessvariants.com/32turn.dir/arenachess.html") variante Arena + a(href="https://www.chessvariants.com/32turn.dir/arenachess.html") + | variante Arena | sur chessvariants.com. p Inventeur : Jeff Kiska (2000) diff --git a/client/src/translations/rules/Ball/en.pug b/client/src/translations/rules/Ball/en.pug index 429ec6ed..d1d750cc 100644 --- a/client/src/translations/rules/Ball/en.pug +++ b/client/src/translations/rules/Ball/en.pug @@ -18,15 +18,16 @@ p. figure.diagram-container .diagram.diag12 - | fen:rnbcq1nbr/ppppppppp/5c3/9/4a4/5P3/9/PPPPP1PPP/RNBCQCNBR: + | fen:rnbhq1nbr/ppppppppp/3h5/9/4a4/5P3/9/PPPPP1PPP/RNBHQHNBR: .diagram.diag22 - | fen:rnbcq1nbr/ppppppppp/5c3/9/4S4/9/9/PPPPP1PPP/RNBCQCNBR: + | fen:rnbhq1nbr/ppppppppp/3h5/9/4S4/9/9/PPPPP1PPP/RNBHQHNBR: figcaption Left: before fxe5 (taking ball). Right: after fxe5. -p. - The piece sitting next to the queen is a Champion (C). - It moves by jumping two squares in any direction (potentially over pieces), - or one square orthogonally. +p + | The piece sitting next to the queen is a + a(href="https://en.wikipedia.org/wiki/Phoenix_(chess)") Phoenix (H) + | . It moves by jumping two squares diagonally (potentially over pieces), + | or one square orthogonally. h3 End of the game @@ -36,15 +37,15 @@ p. figure.diagram-container .diagram.diag12 - | fen:3rn1r2/1pp3pbp/2cp2n2/p1b1pp1p1/P6P1/2N3P1P/1PP2N3/1RB1qPh2/1R2BC1CQ: + | fen:3rn1r2/1pp3pbp/2hp2n2/p1b1pp1p1/P6P1/2N3i1P/1PP2N3/1RB1qP3/1R2BH1HQ: .diagram.diag22 - | fen:3rn1r2/1pp3pbp/2cp2n2/p1b1pp1p1/P6P1/2N3P1P/1PP2N3/1RB1tPc2/1R2BC1CQ: + | fen:3rn1r2/1pp3pbp/2hp2n2/p1b1pp1p1/P6P1/2N3h1P/1PP2N3/1RB1tP3/1R2BH1HQ: figcaption. - Left: before g2Pe2 (passing the ball). + Left: before g4Pe2 (passing the ball). Right: after the move. Then ...Q(x)d1# cannot be prevented. p. - The black champion on g2 passes the ball to the black queen on e2. + The black phoenix on g4 passes the ball to the black queen on e2. Victory is then garanteed by playing a queen move on the first rank. h3 Source diff --git a/client/src/translations/rules/Ball/es.pug b/client/src/translations/rules/Ball/es.pug index 560f4eb0..763b8fd8 100644 --- a/client/src/translations/rules/Ball/es.pug +++ b/client/src/translations/rules/Ball/es.pug @@ -18,17 +18,18 @@ p. figure.diagram-container .diagram.diag12 - | fen:rnbcq1nbr/ppppppppp/5c3/9/4a4/5P3/9/PPPPP1PPP/RNBCQCNBR: + | fen:rnbhq1nbr/ppppppppp/3h5/9/4a4/5P3/9/PPPPP1PPP/RNBHQHNBR: .diagram.diag22 - | fen:rnbcq1nbr/ppppppppp/5c3/9/4S4/9/9/PPPPP1PPP/RNBCQCNBR: + | fen:rnbhq1nbr/ppppppppp/3h5/9/4S4/9/9/PPPPP1PPP/RNBHQHNBR: figcaption. Izquierda: antes de fxe5 (tomando la pelota). Derecha: después de fxe5. -p. - La pieza al lado de la dama es un Campeón (C). - Se mueve saltando dos casillas en cualquier dirección - (potencialmente sobre piezas), o una casilla ortogonalmente. +p + | La pieza al lado de la dama es un + a(href="https://en.wikipedia.org/wiki/Phoenix_(chess)") Phoenix (H) + | . Se mueve saltando dos casillas en diagonal + | (potencialmente sobre piezas), o una casilla ortogonalmente. h3 Fin de la partida @@ -38,20 +39,20 @@ p. figure.diagram-container .diagram.diag12 - | fen:3rn1r2/1pp3pbp/2cp2n2/p1b1pp1p1/P6P1/2N3P1P/1PP2N3/1RB1qPh2/1R2BC1CQ: + | fen:3rn1r2/1pp3pbp/2hp2n2/p1b1pp1p1/P6P1/2N3i1P/1PP2N3/1RB1qP3/1R2BH1HQ: .diagram.diag22 - | fen:3rn1r2/1pp3pbp/2cp2n2/p1b1pp1p1/P6P1/2N3P1P/1PP2N3/1RB1tPc2/1R2BC1CQ: + | fen:3rn1r2/1pp3pbp/2hp2n2/p1b1pp1p1/P6P1/2N3h1P/1PP2N3/1RB1tP3/1R2BH1HQ: figcaption. - Izquierda: antes de g2Pe2 (pasando el globo). + Izquierda: antes de g4Pe2 (pasando el globo). Derecha: después del movimiento. Entonces Q(x)d1# no se puede prevenir. p. - Las negras pasan el balón del campeón g2 a la dama en e2. + Las negras pasan el balón del phoenix g2 a la dama en e2. La victoria se asegura al jugar un movimiento de dama en la primera fila. h3 Fuente p. Esta variante está inspirada por una idea que tuvimos con una amiga en 2019, - lo que implicaba golpear la pelota para enviarla desde el otro lado del tablero. - La versión actual evita ciertos bloqueos observados entonces. + lo que implicaba golpear la pelota para enviarla desde el otro lado del + tablero. La versión actual evita ciertos bloqueos observados entonces. diff --git a/client/src/translations/rules/Ball/fr.pug b/client/src/translations/rules/Ball/fr.pug index 21b6d56f..42acab5d 100644 --- a/client/src/translations/rules/Ball/fr.pug +++ b/client/src/translations/rules/Ball/fr.pug @@ -19,16 +19,16 @@ p. figure.diagram-container .diagram.diag12 - | fen:rnbcq1nbr/ppppppppp/5c3/9/4a4/5P3/9/PPPPP1PPP/RNBCQCNBR: + | fen:rnbhq1nbr/ppppppppp/3h5/9/4a4/5P3/9/PPPPP1PPP/RNBHQHNBR: .diagram.diag22 - | fen:rnbcq1nbr/ppppppppp/5c3/9/4S4/9/9/PPPPP1PPP/RNBCQCNBR: + | fen:rnbhq1nbr/ppppppppp/3h5/9/4S4/9/9/PPPPP1PPP/RNBHQHNBR: figcaption Gauche : avant fxe5 (prenant le ballon). Droite : après fxe5. -p. - La pièce située à côté de la dame est un Champion (C). - Il se déplace en effectuant des sauts de deux cases dans n'importe - quelle direction (potentiellement par dessus des pièces), - ou d'une case orthogonalement. +p + | La pièce située à côté de la dame est un + a(href="https://en.wikipedia.org/wiki/Phoenix_(chess)") Phoenix (H) + | . Il se déplace en effectuant des sauts de deux cases en diagonale + | (potentiellement par dessus des pièces), ou d'une case orthogonalement. h3 Fin de la partie @@ -38,15 +38,15 @@ p. figure.diagram-container .diagram.diag12 - | fen:3rn1r2/1pp3pbp/2cp2n2/p1b1pp1p1/P6P1/2N3P1P/1PP2N3/1RB1qPh2/1R2BC1CQ: + | fen:3rn1r2/1pp3pbp/2hp2n2/p1b1pp1p1/P6P1/2N3i1P/1PP2N3/1RB1qP3/1R2BH1HQ: .diagram.diag22 - | fen:3rn1r2/1pp3pbp/2cp2n2/p1b1pp1p1/P6P1/2N3P1P/1PP2N3/1RB1tPc2/1R2BC1CQ: + | fen:3rn1r2/1pp3pbp/2hp2n2/p1b1pp1p1/P6P1/2N3h1P/1PP2N3/1RB1tP3/1R2BH1HQ: figcaption. - Gauche : avant g2Pe2 (passant le ballon). + Gauche : avant g4Pe2 (passant le ballon). Droite : après le coup. Ensuite ...Q(x)d1# ne peut être empêché. p. - Les noirs passent la balle du champion g2 vers la dame en e2. + Les noirs passent la balle du phoenix g4 vers la dame en e2. La victoire est alors assurée en jouant ensuite un coup de dame sur la première rangée. diff --git a/client/src/translations/rules/Baroque/en.pug b/client/src/translations/rules/Baroque/en.pug index 649bde07..1e94b81d 100644 --- a/client/src/translations/rules/Baroque/en.pug +++ b/client/src/translations/rules/Baroque/en.pug @@ -21,8 +21,8 @@ ul li Queen : withdrawer li King : king (same behavior as in standard chess) p. - Besides, a new piece is introduced: the immobilizer, written by the letter 'm' - in FEN diagrams and PGN games. It is represented by an upside-down rook: + Besides, a new piece is introduced: the immobilizer, written by the letter + 'm' in FEN diagrams and PGN games. It is represented by an upside-down rook: figure.diagram-container .diagram @@ -44,31 +44,34 @@ p | Note : this corresponds to the "pure rules" described on a(href="http://www.inference.org.uk/mackay/ultima/ultima.html") this page | , which slightly differ from the initial rules. - | The aim is to get rid of the weird suicide rule by weakening the immobilizers lock. - | In particular, in the original rules two adjacent immobilizer are stuck forever - | until one is captured. Note that it's still the case if all chameleons disappeared. + | The aim is to get rid of the weird suicide rule by weakening the + | immobilizers lock. In particular, in the original rules two adjacent + | immobilizer are stuck forever until one is captured. Note that it's still + | the case if all chameleons disappeared. h3 Capturing moves p. - Easy case first: the king captures as usual, by moving onto an adjacent square - occupied by an enemy piece. But this is the only piece following orthodox rules, - and also the only one which captures by moving onto an occupied square. - All other pieces capture passively: they land on a free square and captured - units are determined by some characteristics of the movement. + Easy case first: the king captures as usual, by moving onto an adjacent + square occupied by an enemy piece. But this is the only piece following + orthodox rules, and also the only one which captures by moving onto an + occupied square. All other pieces capture passively: they land on a free + square and captured units are determined by some characteristics of the + movement. p Note 1: the immobilizer does not capture. p. Note 2: for passive captures, a 'X' is added at the end of the move notation, - to indicate that something was taken (replaying the game is necessary to know where). + to indicate that something was taken (replaying the game is necessary to know + where). h4 Pawns/Pincers p. - If at the end of its movement a pawn is horizontally or vertically adjacent to an - enemy piece, which itself is next to a friendly piece (in the same direction), - the "pinced" unit is removed from the board. + If at the end of its movement a pawn is horizontally or vertically adjacent + to an enemy piece, which itself is next to a friendly piece (in the same + direction), the "pinced" unit is removed from the board. figure.diagram-container .diagram @@ -80,8 +83,8 @@ h4 Coordinators (rooks) p. Imagine that rook and king of the same color are two corners of a rectangle (this works if these two pieces are unaligned). - If at the end of a rook move an enemy piece stands in any of the two remaining - corners, it is captured. + If at the end of a rook move an enemy piece stands in any of the two + remaining corners, it is captured. figure.diagram-container .diagram @@ -91,9 +94,9 @@ figure.diagram-container h4 Long leapers (knights) p. - A knight captures exactly as a queen in international draughts game: by jumping - over its enemies, as many times as it can/want but always in the same direction. - In this respect it is less powerful than a draughts' queen: + A knight captures exactly as a queen in international draughts game: by + jumping over its enemies, as many times as it can/want but always in the same + direction. In this respect it is less powerful than a draughts' queen: on the following diagram c8 or f6 cannot be captured. However, the knight does not have to maximize the number of captured units (as is the case in draughts). @@ -106,8 +109,8 @@ figure.diagram-container h4 Withdrawer (queen) p. - The queen captures by moving away from an adjacent enemy piece, in the opposite - direction (without jumping, the path must be free). + The queen captures by moving away from an adjacent enemy piece, in the + opposite direction (without jumping, the path must be free). figure.diagram-container .diagram @@ -134,19 +137,19 @@ figure.diagram-container figcaption 1.Bd5 captures the two marked pieces. p. - Besides, chameleon immobilizes immobilizers (but cannot capture them since they - do not capture). + Besides, chameleon immobilizes immobilizers (but cannot capture them since + they do not capture). p. - A chameleon captures the king in the same way the king captures, which means that - a chameleon adjacent to a king gives check. + A chameleon captures the king in the same way the king captures, which means + that a chameleon adjacent to a king gives check. h3 End of the game p. - Checkmate or stalemate as in standard chess. Note however that checks are more - difficult to see, because of the exotic capturing rules. For example, on the - following diagram the white king cannot move to e5 because then + Checkmate or stalemate as in standard chess. Note however that checks are + more difficult to see, because of the exotic capturing rules. For example, on + the following diagram the white king cannot move to e5 because then the black pawn could capture by moving next to it. figure.diagram-container diff --git a/client/src/translations/rules/Baroque/es.pug b/client/src/translations/rules/Baroque/es.pug index dc85cd55..c35c6fc2 100644 --- a/client/src/translations/rules/Baroque/es.pug +++ b/client/src/translations/rules/Baroque/es.pug @@ -11,7 +11,9 @@ p h4 Nombre de las piezas -p Los nombres de las piezas se relacionan con su modo de captura, que se describe a continuación. +p. + Los nombres de las piezas se relacionan con su modo de captura, que se + describe a continuación. ul li Peón: peón o p "pinchazo" li Torre: coordinador @@ -37,8 +39,8 @@ p. p. Cuando una pieza está al lado de un inmovilizador enemigo, no puede moverse - a menos que este inmovilizador se encuentre con un amigo inmovilizador o camaleón - (cancelando los poderes del inmovilizador contrario). + a menos que este inmovilizador se encuentre con un amigo inmovilizador o + camaleón (cancelando los poderes del inmovilizador contrario). p | Nota: esto corresponde a las "reglas puras" como se describe en @@ -49,31 +51,32 @@ p | En particular, de acuerdo con las reglas básicas, | dos inmovilizadores adyacentes no pueden nunca moverse a menos que | uno de ellos sea capturado. - | Tenga en cuenta que este es siempre el caso si todos los camaleones desaparecen. + | Tenga en cuenta que este es siempre el caso si todos los camaleones + | desaparecen. h3 Jugadas con captura p. El caso fácil primero: el rey captura como siempre, avanzando - una casilla adyacente ocupada por el enemigo. Este es el único caso parcial según el - reglas ortodoxas, y también el único que se captura al ir a una plaza ocupada. - Todas las otras piezas capturan pasivamente: llegan a un cuadrado - gratis, y captura una o más piezas según las caracterÃsticas + una casilla adyacente ocupada por el enemigo. Este es el único caso parcial + según el reglas ortodoxas, y también el único que se captura al ir a una + plaza ocupada. Todas las otras piezas capturan pasivamente: llegan a un + cuadrado gratis, y captura una o más piezas según las caracterÃsticas del desplazamiento. p Nota 1: el inmovilizador no captura. p. - Nota 2: referente las capturas pasivas, se agrega una 'X' al final del movimiento - para indicar que se ha tomado algo (debes volver a jugar el juego para - saber qué y dónde). + Nota 2: referente las capturas pasivas, se agrega una 'X' al final del + movimiento para indicar que se ha tomado algo (debes volver a jugar el juego + para saber qué y dónde). h4 Peones/Pinchazos p. Si al final del movimiento un peón termina horizontal o verticalmente - adyacente a una habitación enemiga, que está adyacente a una habitación amiga (en - la misma dirección), luego se captura la pieza "pellizcada". + adyacente a una habitación enemiga, que está adyacente a una habitación amiga + (en la misma dirección), luego se captura la pieza "pellizcada". figure.diagram-container .diagram @@ -83,8 +86,8 @@ figure.diagram-container h4 Coordinadores (torres) p. - Imagina que la torre y el rey del mismo color son dos esquinas de un rectángulo - (funciona si las dos piezas no están alineadas). + Imagina que la torre y el rey del mismo color son dos esquinas de un + rectángulo (funciona si las dos piezas no están alineadas). Si al final de una torre se mueve una pieza opuesta está en una de las dos esquinas restantes, se captura. @@ -99,8 +102,8 @@ p. Un caballo captura exactamente como una dama en damas internacionales: saltando sobre las piezas enemigas tantas veces como quiera, pero siempre en la misma dirección. En este sentido, tiene menos poder - que una dama en el juego anterior: en el siguiente diagrama c8 y f6 no pueden ser - tomada. Sin embargo, el caballo no está obligado a maximizar el número de + que una dama en el juego anterior: en el siguiente diagrama c8 y f6 no pueden + ser tomada. Sin embargo, el caballo no está obligado a maximizar el número de piezas opuestas capturadas (como es el caso en las damas). figure.diagram-container @@ -132,8 +135,8 @@ p. p ...y estas capturas pueden acumularse. p. - Nota: en el diagrama, el trazo indicado no corresponde a un desplazamiento de - peón, y por lo tanto no captura la pieza negra en e5. + Nota: en el diagrama, el trazo indicado no corresponde a un desplazamiento + de peón, y por lo tanto no captura la pieza negra en e5. figure.diagram-container .diagram @@ -145,16 +148,17 @@ p. ya que ellos mismos no capturan). p. - Un camaleón captura al rey de la misma manera que el rey captura, lo que significa - que un camaleón junto a un rey enemigo derrota. + Un camaleón captura al rey de la misma manera que el rey captura, lo que + significa que un camaleón junto a un rey enemigo derrota. h3 Fin de la partida p. - Es necesario jaque mate al rey contrario como en el ajedrez ortodoxo (y empatate es tablas). - Sin embargo, las jaques pueden ser difÃciles de ver debido a las definiciones - capturas exóticas. Por ejemplo en el siguiente diagrama, el rey blanco no - puede ir a e5 porque serÃa capturado por el peón negro (que viene en d5). + Es necesario jaque mate al rey contrario como en el ajedrez ortodoxo (y + empate es tablas). Sin embargo, las jaques pueden ser difÃciles de ver debido + a las definiciones capturas exóticas. Por ejemplo en el siguiente diagrama, + el rey blanco no puede ir a e5 porque serÃa capturado por el peón negro + (que viene en d5). figure.diagram-container .diagram diff --git a/client/src/translations/rules/Baroque/fr.pug b/client/src/translations/rules/Baroque/fr.pug index 7d6473a1..8e4ac86c 100644 --- a/client/src/translations/rules/Baroque/fr.pug +++ b/client/src/translations/rules/Baroque/fr.pug @@ -11,7 +11,9 @@ p h4 Noms des pièces -p Les noms des pièces se rapportent à leur mode de capture, qui est décrit plus loin +p. + Les noms des pièces se rapportent à leur mode de capture, qui est décrit + plus loin ul li Pion : pion ou pinceur li Tour : coordinateur @@ -33,12 +35,13 @@ h3 Coups non capturants p. Les pions se déplacent comme des tours orthodoxes, et les déplacements du roi - sont standards. Toutes les autres pièces se déplacent comme une dame orthodoxe. + sont standards. Toutes les autres pièces se déplacent comme une dame + orthodoxe. p. Quand une pièce est à côté d'un immobiliseur ennemi, elle ne peut plus bouger - à moins que cet immobiliseur ne côtoie lui-même un immobiliseur ou caméléon ami - (annulant les pouvoirs de l'immobiliseur adverse). + à moins que cet immobiliseur ne côtoie lui-même un immobiliseur ou caméléon + ami (annulant les pouvoirs de l'immobiliseur adverse). p | Note : cela correspond aux "règles pures" telles que décrites sur @@ -54,11 +57,11 @@ h3 Coups capturants p. Le cas facile d'abord : le roi capture comme d'habitude, en se déplaçant sur - une case adjacente occupée par l'ennemi. C'est le seul cas de pièce suivant les - règles orthodoxes, et aussi la seule à capturer en allant sur une case occupée. - Toutes les autres pièces capturent passivement : elles arrivent sur une case - libre, et capturent une ou plusieurs pièces selon des caractéristiques - géométriques du déplacement. + une case adjacente occupée par l'ennemi. C'est le seul cas de pièce suivant + les règles orthodoxes, et aussi la seule à capturer en allant sur une case + occupée. Toutes les autres pièces capturent passivement : elles arrivent sur + une case libre, et capturent une ou plusieurs pièces selon des + caractéristiques géométriques du déplacement. p Note 1 : l'immobiliseur ne capture pas. @@ -71,8 +74,8 @@ h4 Pions/Pinceurs p. Si en fin de déplacement un pion se retrouve horizontalement ou verticalement - adjacent à une pièce ennemie, qui elle-même est voisine d'une pièce amie (dans - la même direction), alors la pièce "pincée" est capturée. + adjacent à une pièce ennemie, qui elle-même est voisine d'une pièce amie + (dans la même direction), alors la pièce "pincée" est capturée. figure.diagram-container .diagram @@ -95,12 +98,13 @@ figure.diagram-container h4 "Sauteurs longs" (cavaliers) p. - Un cavalier capture exactement comme une dame au jeu de dames internationales : - en sautant par dessus les pièces ennemies, autant de fois qu'il le souhaite - mais toujours dans la même direction. Dans ce sens, il a moins de pouvoir - qu'une dame au jeu précité : sur le diagramme suivant c8 et f6 ne peuvent être - pris. En revanche, le cavalier n'est pas obligé de maximiser le nombre de - pièces adverses capturés (come c'est le cas au jeu de dames). + Un cavalier capture exactement comme une dame au jeu de dames + internationales : en sautant par dessus les pièces ennemies, autant de fois + qu'il le souhaite mais toujours dans la même direction. Dans ce sens, il a + moins de pouvoir qu'une dame au jeu précité : sur le diagramme suivant c8 et + f6 ne peuvent être pris. En revanche, le cavalier n'est pas obligé de + maximiser le nombre de pièces adverses capturés (comme c'est le cas au jeu de + dames). figure.diagram-container .diagram @@ -110,8 +114,8 @@ figure.diagram-container h4 "Retireur" (dame) p. - La dame capture en s'éloignant d'une pièce adverse adjacente, dans la direction - opposée (sans effectuer de sauts, la voie doit être libre). + La dame capture en s'éloignant d'une pièce adverse adjacente, dans la + direction opposée (sans effectuer de sauts, la voie doit être libre). figure.diagram-container .diagram @@ -131,8 +135,8 @@ ul p ...et ces captures peuvent se cumuler. p. - Remarque : sur le diagramme le coup indiqué ne correspond pas à un déplacement de - pion, et ne capture donc pas le pinceur noir en e5. + Remarque : sur le diagramme le coup indiqué ne correspond pas à un + déplacement de pion, et ne capture donc pas le pinceur noir en e5. figure.diagram-container .diagram @@ -144,16 +148,17 @@ p. puisqu'eux-même ne capturent pas). p. - Un caméléon capture le roi de la même façon que le roi capture, ce qui signifie - qu'un caméléon à côté d'un roi ennemi donne échec. + Un caméléon capture le roi de la même façon que le roi capture, ce qui + signifie qu'un caméléon à côté d'un roi ennemi donne échec. h3 Fin de la partie p. - Il faut mater le roi adverse comme aux échecs orthodoxes (et le pat fait nulle). - Cependant, les échecs peuvent être difficiles à voir à cause des définitions - exotiques des captures. Par exemple sur le diagramme suivant, le roi blanc ne - peut aller en e5 car il serait capturé par le pion noir (venant en d5). + Il faut mater le roi adverse comme aux échecs orthodoxes (et le pat fait + nulle). Cependant, les échecs peuvent être difficiles à voir à cause des + définitions exotiques des captures. Par exemple sur le diagramme suivant, + le roi blanc ne peut aller en e5 car il serait capturé par le pion noir + (venant en d5). figure.diagram-container .diagram diff --git a/client/src/translations/rules/Benedict/en.pug b/client/src/translations/rules/Benedict/en.pug index 59f257cb..c1cbc33b 100644 --- a/client/src/translations/rules/Benedict/en.pug +++ b/client/src/translations/rules/Benedict/en.pug @@ -1,12 +1,13 @@ p.boxed - | Attacked pieces change color after each turn. Goal is to change king's color. + | Attacked pieces change color after each turn. + | Goal is to change king's color. p. More precisely, only pieces attacked by the moving unit are flipped. They change side, until the opponent in turn can attack them. There are no captures: only color changes. -p Castling is possible, and flips pieces attacked by the king or rook. +p Castling is possible, and flips pieces attacked by the moving unit(s). figure.diagram-container .diagram @@ -28,7 +29,8 @@ p. h3 Source p - a(href="https://www.chessvariants.com/difftaking.dir/benedict.html") Benedict chess + a(href="https://www.chessvariants.com/difftaking.dir/benedict.html") + | Benedict chess | on chessvariants.com. p Inventor: W. Dan Troyka (2002) diff --git a/client/src/translations/rules/Benedict/es.pug b/client/src/translations/rules/Benedict/es.pug index 5ba77f36..1db0741f 100644 --- a/client/src/translations/rules/Benedict/es.pug +++ b/client/src/translations/rules/Benedict/es.pug @@ -7,12 +7,15 @@ p. Cambian de lado, hasta que el oponente a su vez puede atacarlos. No hay capturas: solo cambios de color. -p El enroque es posible y cambia tanto las piezas atacadas por el rey como la torre. +p. + El enroque es posible, y cambia el color de las piezas atacadas por las + piezas en movimiento. figure.diagram-container .diagram | fen:r1bqkbnr/ppPpPppp/2n5/3N4/8/8/PPPPPPPP/R1BQKBNR: - figcaption Después de 1.Nc3 Nc6 2.Nd5: los peones en c7 y e7 cambian de color. + figcaption. + Después de 1.Nc3 Nc6 2.Nd5: los peones en c7 y e7 cambian de color. h3 Fin de la partida @@ -30,7 +33,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/difftaking.dir/benedict.html") variante Benedict + a(href="https://www.chessvariants.com/difftaking.dir/benedict.html") + | variante Benedict | en chessvariants.com. p Inventor: W. Dan Troyka (2002) diff --git a/client/src/translations/rules/Benedict/fr.pug b/client/src/translations/rules/Benedict/fr.pug index 87b90862..7686faca 100644 --- a/client/src/translations/rules/Benedict/fr.pug +++ b/client/src/translations/rules/Benedict/fr.pug @@ -3,11 +3,14 @@ p.boxed | Le but est de changer la couleur du roi. p. - Plus précisément, seules les pièces attaquées par le coup courant sont modifiées. - Elles changent de couleur, jusqu'à ce que l'adversaire au trait puisse les attaquer. - Il n'y a pas de captures : seulement des changements de couleur. + Plus précisément, seules les pièces attaquées par le coup courant sont + modifiées. Elles changent de couleur, jusqu'à ce que l'adversaire au trait + puisse les attaquer. Il n'y a pas de captures : seulement des changements de + couleur. -p Le roque est possible, et change à la fois les pièces attaquées par le roi et la tour. +p. + Le roque est possible, et change la couleur des pièces attaquées par la ou + les pièces se déplaçant. figure.diagram-container .diagram @@ -30,7 +33,8 @@ h3 Source p | La - a(href="https://www.chessvariants.com/difftaking.dir/benedict.html") variante Benedict + a(href="https://www.chessvariants.com/difftaking.dir/benedict.html") + | variante Benedict | sur chessvariants.com. p Inventeur : W. Dan Troyka (2002) diff --git a/client/src/translations/rules/Berolina/es.pug b/client/src/translations/rules/Berolina/es.pug index 0a7aa16d..0a28b342 100644 --- a/client/src/translations/rules/Berolina/es.pug +++ b/client/src/translations/rules/Berolina/es.pug @@ -20,9 +20,9 @@ p. p. Sobre la notación: ya que las capturas realizadas por los peones no son ambiguos, los notamos por ejemplo "Pxe6" ('P' es redundante pero - la escritura es más bonita asÃ) ; por otro lado los desplazamientos simples son - generalmente ambiguo y, por lo tanto, anotado por ejemplo "f2g3" (aquà nuevamente, - la fila inicial es inútil pero la escritura parece mejor asÃ). + la escritura es más bonita asÃ) ; por otro lado los desplazamientos simples + son generalmente ambiguo y, por lo tanto, anotado por ejemplo "f2g3" (aquà + nuevamente, la fila inicial es inútil pero la escritura parece mejor asÃ). figure.diagram-container .diagram diff --git a/client/src/translations/rules/Cannibal/en.pug b/client/src/translations/rules/Cannibal/en.pug index b3da21ca..b12d95a5 100644 --- a/client/src/translations/rules/Cannibal/en.pug +++ b/client/src/translations/rules/Cannibal/en.pug @@ -20,5 +20,6 @@ p If the king captures, it transforms as well but stays royal. h3 More information p - a(href="https://www.chessvariants.com/difftaking.dir/cannibal.html") Cannibal Chess + a(href="https://www.chessvariants.com/difftaking.dir/cannibal.html") + | Cannibal Chess | on chessvariants.com. I added the forced captures for more fun. diff --git a/client/src/translations/rules/Cannibal/es.pug b/client/src/translations/rules/Cannibal/es.pug index 9fd771de..ec046db3 100644 --- a/client/src/translations/rules/Cannibal/es.pug +++ b/client/src/translations/rules/Cannibal/es.pug @@ -21,6 +21,7 @@ h3 Más información p | La - a(href="https://www.chessvariants.com/difftaking.dir/cannibal.html") variante Cannibal + a(href="https://www.chessvariants.com/difftaking.dir/cannibal.html") + | variante Cannibal | en chessvariants.com. | Esta regla me parece más divertida con las capturas obligatorias. diff --git a/client/src/translations/rules/Cannibal/fr.pug b/client/src/translations/rules/Cannibal/fr.pug index 03b6497b..4626ac2e 100644 --- a/client/src/translations/rules/Cannibal/fr.pug +++ b/client/src/translations/rules/Cannibal/fr.pug @@ -21,6 +21,7 @@ h3 Plus d'information p | La - a(href="https://www.chessvariants.com/difftaking.dir/cannibal.html") variante Cannibal + a(href="https://www.chessvariants.com/difftaking.dir/cannibal.html") + | variante Cannibal | sur chessvariants.com. | Cett règle me paraît plus amusante avec des captures obligatoires. diff --git a/client/src/translations/rules/Checkered/en.pug b/client/src/translations/rules/Checkered/en.pug index af3a56d9..ca0af4da 100644 --- a/client/src/translations/rules/Checkered/en.pug +++ b/client/src/translations/rules/Checkered/en.pug @@ -47,14 +47,15 @@ h3 Pawns ul li. - Pawns can jump two squares only from their initial rank, and only once in the game: - a checkered pawn returning on the pawns' start rank cannot jump. However: + Pawns can jump two squares only from their initial rank, and only once in + the game: a checkered pawn returning on the pawns' start rank cannot jump. + However: li. - A pawn captured on its starting square (thus becoming "checkered") keeps the - right to advance two squares. + A pawn captured on its starting square (thus becoming "checkered") keeps + the right to advance two squares. li. - Checkered pawns cannot capture en passant, because while the pawn was "passing" - they were of the same color. + Checkered pawns cannot capture en passant, because while the pawn was + "passing" they were of the same color. p.bold.bigfont If you wanna play, you can stop reading here. @@ -66,7 +67,8 @@ p. Therefore, it can be considered that it's not really a check because white is unable to "give back the turn". Without the black bishop on a7 it would be mate (without debate), because - the king could virtually go to g1 before being captured by the pawn-chamaleon. + the king could virtually go to g1 before being captured by the + pawn-chamaleon. figure.diagram-container .diagram @@ -85,17 +87,18 @@ p.warn This stage is not (and probably will never be) implemented. p. During the game one of the two players can decide to take control of the checkered pieces. - They thus become autonomous and vulnerable to being captured - stage 2 begins. - The other player is in charge of both the white and black pieces, and tries to - eliminate checkered pieces. + They thus become autonomous and vulnerable to being captured - stage 2 + begins. The other player is in charge of both the white and black pieces, and + tries to eliminate checkered pieces. The checkered side wins by checkmating either the white or black king. h4 Variant of stage 2 p. An observer could decide to join the game by taking the checkered pieces at any moment. - It then becomes a chess game with three players, with some subtelties to be resolved. - It was tested in some (real life) games organised by the variant creator. + It then becomes a chess game with three players, with some subtelties to be + resolved. It was tested in some (real life) games organised by the variant + inventor. h3 Special moves @@ -109,8 +112,8 @@ h3 Credits ul li. - The rules of Checkered Chess were thought up by Patrick Bernier and developed - with the help of Benjamin Auder around 2011-2012. + The rules of Checkered Chess were thought up by Patrick Bernier and + developed with the help of Benjamin Auder around 2011-2012. li. - Thanks also to Olive Martin, Christian Poisson, Bevis Martin, Laurent Nouhaud - and Frédéric Fradet. + Thanks also to Olive Martin, Christian Poisson, Bevis Martin, Laurent + Nouhaud and Frédéric Fradet. diff --git a/client/src/translations/rules/Checkered/es.pug b/client/src/translations/rules/Checkered/es.pug index fddefc03..0c66d662 100644 --- a/client/src/translations/rules/Checkered/es.pug +++ b/client/src/translations/rules/Checkered/es.pug @@ -21,8 +21,8 @@ ol Cualquier captura produce una nueva pieza, ya sea tomando la naturaleza de la capturando, o la de los capturados. li. - La nueva pieza resultante de este proceso tiene un nuevo color: "a cuadros", - como se muestra arriba. + La nueva pieza resultante de este proceso tiene un nuevo color: + "a cuadros", como se muestra arriba. li. Las piezas a cuadros pertenecen al jugador con la lÃnea, y entonces puede capturar piezas opuestas. @@ -30,8 +30,8 @@ ol p Notas: ul li. - Un movimiento a cuadros sin captura no se puede deshacer inmediatamente después, - ya que esto repetirÃa la posición. + Un movimiento a cuadros sin captura no se puede deshacer inmediatamente + después, ya que esto repetirÃa la posición. li Las piezas a cuadros no se pueden capturar. figure.diagram-container @@ -65,8 +65,8 @@ p. "atacado" por un peón a cuadros: este pertenece por el momento a las blancas. Por lo tanto, podemos considerar que no están realmente en jaque ya que no puede "rendir el turno". - Sin el alfil negro en a7 serÃa jaque mate (indiscutible), porque el rey podrÃa - vaya virtualmente a g1 antes de ser capturado por el peón camaleón. + Sin el alfil negro en a7 serÃa jaque mate (indiscutible), porque el rey + podrÃa vaya virtualmente a g1 antes de ser capturado por el peón camaleón. figure.diagram-container .diagram @@ -76,7 +76,8 @@ figure.diagram-container p. La interfaz considera que es jaque mate en ambos casos, por lo tanto el principio de que "es mate si no puedes moverte y el oponente - cal turno puede capturar al rey "(posiblemente después de un movimiento prohibido). + cal turno puede capturar al rey "(posiblemente después de un movimiento + prohibido). h2.stageDelimiter Fase 2 diff --git a/client/src/translations/rules/Checkered/fr.pug b/client/src/translations/rules/Checkered/fr.pug index 3eb7c277..1acf6ae0 100644 --- a/client/src/translations/rules/Checkered/fr.pug +++ b/client/src/translations/rules/Checkered/fr.pug @@ -26,8 +26,8 @@ ol Toute capture produit une nouvelle pièce, prenant soit la nature du capturant, soit celle du capturée. li. - La nouvelle pièce issue de ce processus a une nouvelle couleur : "échiqueté", - comme illustré ci-dessus. + La nouvelle pièce issue de ce processus a une nouvelle couleur : + "échiqueté", comme illustré ci-dessus. li. Les pièces échiquetées appartiennent au joueur ayant le trait, et peuvent alors capturer les pièces adverses. @@ -67,8 +67,8 @@ h3 Mat ou pat ? p. La situation du diagramme suivant ressemble à un mat, mais le roi est - "attaqué" par un pion échiqueté : celui-ci appartient pour l'instant aux blancs. - On peut donc considérer qu'ils ne sont pas vraiment en échec + "attaqué" par un pion échiqueté : celui-ci appartient pour l'instant aux + blancs. On peut donc considérer qu'ils ne sont pas vraiment en échec puisqu'incapables de "rendre le trait". Sans le fou noir en a7 ce serait mat (indiscutable), car le roi pourrait virtuellement aller en g1 avant de se faire capturer par le pion caméléon. diff --git a/client/src/translations/rules/Chess960/en.pug b/client/src/translations/rules/Chess960/en.pug index 2c84b0a9..670acd28 100644 --- a/client/src/translations/rules/Chess960/en.pug +++ b/client/src/translations/rules/Chess960/en.pug @@ -2,15 +2,15 @@ p.boxed | Orthodox rules (with shuffled starting position). p. - Chess is played between two players, one moving the white pieces and the other - the black pieces. A "move" consists of a piece's movement on the board. + Chess is played between two players, one moving the white pieces and the + other the black pieces. A "move" consists of a piece's movement on the board. White and black moves alternate until a specific situation occurs (checkmate, stalemate, or draw criteria met; this is detailed later). White pieces' player always make the first move. p. - Each piece has a particular way to move, but almost always captures by moving to an - occupied square (with only one exception, detailed later). + Each piece has a particular way to move, but almost always captures by moving + to an occupied square (with only one exception, detailed later). figure.diagram-container .diagram @@ -31,9 +31,9 @@ h4 Pawns p. They are the weakest units on board, but the most complex to move. - From their initial rank they can either jump two squares forward (vertically), - or advance only one square in this same direction. After that first move they - only advance one square at a time, vertically, moving up. + From their initial rank they can either jump two squares forward + (vertically), or advance only one square in this same direction. After that + first move they only advance one square at a time, vertically, moving up. p. Pawns capture by moving forward (upper on the board) one square diagonally, @@ -45,10 +45,10 @@ p. p. Moves notations: "pawn" is implicit, so for a simple move we only write the - destination square (because only one pawn at most can move forward to a specific - square). Thus, 1.e5 means "pawn from e4 to e5". However, in case of captures - the situation could be ambiguous (two pawns on the same rank), so the column - is specified too: "fxe6" (for example). + destination square (because only one pawn at most can move forward to a + specific square). Thus, 1.e5 means "pawn from e4 to e5". However, in case of + captures the situation could be ambiguous (two pawns on the same rank), so + the column is specified too: "fxe6" (for example). As you can see capture is marked by a cross symbol: "x". figure.diagram-container @@ -57,10 +57,10 @@ figure.diagram-container figcaption Possible pawn moves: g3, g4, dxc5, bxc5 p - | For a piece movement, we just prepend the upper-case piece initial before the - | previously described notation. A rook taking something on f3 square writes: - | Rxf3. There are rules for ambiguous situation, but discussing them now would - | be too far off-topic. Please visit for example the + | For a piece movement, we just prepend the upper-case piece initial before + | the previously described notation. A rook taking something on f3 square + | writes: Rxf3. There are rules for ambiguous situation, but discussing them + | now would be too far off-topic. Please visit for example the a(href="https://en.wikipedia.org/wiki/Algebraic_notation_(chess)") | Wikipedia page | for full information on this subject. @@ -68,16 +68,17 @@ p h4 Rooks p. - They move either horizontally or vertically, as far as they want while the path - is free of pieces. If this path ends with an enemy piece, it can a priori be captured - (a priori because if the move ends up with the king in check, then it's illegal). + They move either horizontally or vertically, as far as they want while the + path is free of pieces. If this path ends with an enemy piece, it can a + priori be captured (a priori because if the move ends up with the king in + check, then it's illegal). h4 Knights p. - They are the only units able to jump over other pieces (without capturing them). - They do "L" moves: two squares in one direction (horizontally or vertically), - and then one square in an orthogonal direction. + They are the only units able to jump over other pieces (without capturing + them). They do "L" moves: two squares in one direction (horizontally or + vertically), and then one square in an orthogonal direction. figure.diagram-container .diagram @@ -92,13 +93,16 @@ p. h4 Queen -p This piece combines the movement of a rook and a bishop, with the same conditions. +p. + This piece combines the movement of a rook and a bishop, with the same + conditions. h4 King p. - This piece moves like a queen, but only by one square at a time. The final square - must be either vacant or occupied by an enemy piece (therefore captured). + This piece moves like a queen, but only by one square at a time. The final + square must be either vacant or occupied by an enemy piece (therefore + captured). p. The king cannot be captured, but a move may ends up attacking enemy's king. @@ -107,7 +111,9 @@ ul li move the king to a safe square, or li capture the attacker, or li intercept the attacking line. -p Depending on the situation one or more of these counter-measures could be impossible. +p. + Depending on the situation one or more of these counter-measures could be + impossible. p Leaving our king in check after a move is forbidden. @@ -118,23 +124,26 @@ figure.diagram-container h3 Special moves -p Apart from pawn promotion which has already been introduced, two special moves exist: +p. + Apart from pawn promotion which has already been introduced, two special + moves exist: ul li. - castle: if both the king and the right-most (from white player perspective) rook - haven't moved yet, and if nothing stand in the path from king to rook, and if the - squares f1 and g1 are either free or occupied by the king or rook implied, then - the king can go to g1 while the rook moves to f1. Note that since positions are - shuffled one of these two pieces may apparently not move. - The same can be done on the other side (left-most rook), and end squares are c1 - for king and d1 for rook. The former is small castle, and the latter large castle. + castle: if both the king and the right-most (from white player perspective) + rook haven't moved yet, and if nothing stand in the path from king to rook, + and if the squares f1 and g1 are either free or occupied by the king or + rook implied, then the king can go to g1 while the rook moves to f1. Note + that since positions are shuffled one of these two pieces may apparently + not move. The same can be done on the other side (left-most rook), and end + squares are c1 for king and d1 for rook. The former is small castle, and + the latter large castle. Notation: small castle writes "0-0" while large castle is "0-0-0". li. - en-passant: after a pawn has jumped two squares, if an enemy pawn stands just next - to it then it can capture the jumping pawn "en passant", exactly as if it had - advanced only one square. The move is noted as usual, but with "e.p." in the end - to indicate the special move. - The capture is possible only right after the pawn jump: not later in the game. + en-passant: after a pawn has jumped two squares, if an enemy pawn stands + just next to it then it can capture the jumping pawn "en passant", exactly + as if it had advanced only one square. The move is noted as usual, but + with "e.p." in the end to indicate the special move. The capture is + possible only right after the pawn jump: not later in the game. figure.diagram-container .diagram.diag12 @@ -151,8 +160,8 @@ p. The best-known way to end a game is by "checkmating" the enemy king. This means that you end a move in a situation where the king can be captured, and your opponent has no way to avoid the capture. - The checkmating player has one point and the other zero, so the score writes 1-0 - or 0-1 depending if white pieces or black pieces mated. + The checkmating player has one point and the other zero, so the score writes + 1-0 or 0-1 depending if white pieces or black pieces mated. figure.diagram-container .diagram @@ -167,7 +176,8 @@ ul same player in turn, li when 50 moves are played without pawn movement or capture. p. - Note: this last way to end a game is not implemented, because it quite seldom occurs, - does not generalize so well to variants (it depends), and more important because - games played on this website are not official tournament games. If you feel like - manoeuvring for 200 moves and your opponent isn't bored, then why would I stop you? :) + Note: this last way to end a game is not implemented, because it quite seldom + occurs, does not generalize so well to variants (it depends), and more + important because games played on this website are not official tournament + games. If you feel like manoeuvring for 200 moves and your opponent isn't + bored, then keep going :) diff --git a/client/src/translations/rules/Chess960/es.pug b/client/src/translations/rules/Chess960/es.pug index f03c091a..fb40c38a 100644 --- a/client/src/translations/rules/Chess960/es.pug +++ b/client/src/translations/rules/Chess960/es.pug @@ -4,10 +4,10 @@ p.boxed p. El ajedrez es un juego entre dos jugadores, uno que mueve las piezas blancas y el otro las piezas negras. Una "jugada" consiste en tal movimiento en - el tablero (de ajedrez). Las piezas blancas y negras se mueven alternativamente, - hasta la aparición de una situación especÃfica (jaque mate, empate u otro criterio - de nulidad ; esto se detalla a continuación). El jugador de las piezas blancas - siempre comienza. + el tablero (de ajedrez). Las piezas blancas y negras se mueven + alternativamente, hasta la aparición de una situación especÃfica (jaque mate, + empate u otro criterio de nulidad ; esto se detalla a continuación). El + jugador de las piezas blancas siempre comienza. p. Cada pieza tiene un modo de movimiento especÃfico, pero generalmente captura @@ -32,11 +32,11 @@ h3 Jugadas sin captura h4 Peones p. - Son la unidad la más débil del juego, pero también la unidad de desplazamiento - el más complejo. Desde su fila inicial, los peones pueden avanzar - dos casillas (verticalmente), o una casilla solo en esta misma dirección. - Después de este primer movimiento, solo pueden avanzar un espacio a la vez, - siempre hacia adelante. + Son la unidad la más débil del juego, pero también la unidad de + desplazamiento el más complejo. Desde su fila inicial, los peones pueden + avanzar dos casillas (verticalmente), o una casilla solo en esta misma + dirección. Después de este primer movimiento, solo pueden avanzar un espacio + a la vez, siempre hacia adelante. p. Los peones capturan moviendo un casilla hacia adelante en diagonal, @@ -113,13 +113,15 @@ p. (quien se encuentra capturado). p. - El rey no puede ser capturado, pero una jugada puede terminar amenazando al rey - oponerse. Este último está entonces "en jaque" y el oponente debe: + El rey no puede ser capturado, pero una jugada puede terminar amenazando al + rey oponerse. Este último está entonces "en jaque" y el oponente debe: ul li mover a su rey a un lugar seguro, o li capturar al atacante, o li intercepto la lÃnea de ataque. -p Dependiendo de la situación, una o más de estas contramedidas pueden no ser aplicables. +p. + Dependiendo de la situación, una o más de estas contramedidas pueden no ser + aplicables. p Está prohibido dejar a tu rey en jaque al final de un movimiento. @@ -131,8 +133,8 @@ figure.diagram-container h3 Jugadas especiales p. - Además de la promoción de peones introducida previamente, dos movimientos especiales - son para informar: + Además de la promoción de peones introducida previamente, dos movimientos + especiales son para informar: ul li. el enroque: si el rey y la torre más a la derecha desde el punto de vista @@ -146,15 +148,16 @@ ul tablero con la otra torre ; las piezas llegan a las casillas c1 (rey) y d1 (Torre). Este último movimiento se llama "enroque grande" y el otro "enroque pequeño". - Nota: el enroque pequeño (resp. Enroque grande) se escribe 0-0 (resp. 0-0-0). + Nota: el enroque pequeño (resp. Enroque grande) se escribe 0-0 + (resp. 0-0-0). li. en passant: después de que un peón ha avanzado dos espacios, si un peón contrario es justo al lado (horizontalmente) se puede capturar "en passant", como si solo hubiera avanzado un espacio. Este movimiento se escribe como las otras capturas, pero con "e.p." al final para indicar esta jugada especial. - La captura solo es posible inmediatamente después del salto de dos casillas: - no se puede hacer más adelante en el juego. + La captura solo es posible inmediatamente después del salto de dos + casillas: no se puede hacer más adelante en el juego. figure.diagram-container .diagram.diag12 @@ -172,7 +175,8 @@ p. simplemente "mate"). Significa terminar su movimiento atacando al rey oponente, que no tiene forma de evitar su captura en el siguiente movimiento. El jugador que da mate tiene un punto y el otro cero, por lo que se escribe - el puntaje "1-0" (resp. "0-1") en caso de victoria blanca (resp. victoria negra). + el puntaje "1-0" (resp. "0-1") en caso de victoria blanca (resp. victoria + negra). figure.diagram-container .diagram @@ -183,14 +187,16 @@ p. Todas las otras formas de finalizar un juego conducen a las tablas (1/2-1/2) ; nadie gana: ul - li cuando un jugador no tiene movimiento legal disponible sin estar en jaque (empate), li. - cuando una posición se repite tres veces con los mismos derechos de enroque, - y el mismo jugador al turno, + cuando un jugador no tiene movimiento legal disponible sin estar en jaque + (empate), + li. + cuando una posición se repite tres veces con los mismos derechos de + enroque, y el mismo jugador al turno, li cuando se realizan 50 jugadas sin movimiento de peón o captura. p. Nota: esta última forma de finalizar un juego no está implementada, porque no se generaliza fácilmente a variantes (no a todas), - pero sobre todo porque las partidas que se juegan aquà son sobre todo por diversión. - Si te embarcas en maniobras de 200 movimientos y tu oponente - no está harto de eso, ¿por qué deberÃa arrestarte?:) + pero sobre todo porque las partidas que se juegan aquà son sobre todo por + diversión. Si te embarcas en maniobras de 200 movimientos y tu oponente + no está harto de eso, asà que sigue adelante :) diff --git a/client/src/translations/rules/Chess960/fr.pug b/client/src/translations/rules/Chess960/fr.pug index 1eacf844..18e4fad3 100644 --- a/client/src/translations/rules/Chess960/fr.pug +++ b/client/src/translations/rules/Chess960/fr.pug @@ -11,7 +11,8 @@ p. p. Chaque pièce a un mode de déplacement particulier, mais capture généralement - en arrivant sur une case occupée (avec une seule exception, détaillée plus bas). + en arrivant sur une case occupée (avec une seule exception, détaillée plus + bas). figure.diagram-container .diagram @@ -33,9 +34,9 @@ h4 Pions p. Ils forment l'unité la plus faible du jeu, mais aussi celle au déplacement le plus complexe. Depuis leur rangée initiale les pions peuvent avancer de - deux cases (verticalement), ou d'une case seulement dans cette même direction. - Après ce premier coup, ils ne peuvent avancer que d'une case à la fois, - toujours vers l'avant. + deux cases (verticalement), ou d'une case seulement dans cette même + direction. Après ce premier coup, ils ne peuvent avancer que d'une case à la + fois, toujours vers l'avant. p. Les pions capturent en se déplaçant d'une case en avant en diagonale, @@ -49,9 +50,9 @@ p. p. Notation des coups : "pion" est implicite, donc pour un simple déplacement de pion on se contente de noter la case d'arrivée (puisqu'il n'y a pas - d'ambiguité). Ainsi, 1.e5 veut dire "pion de e4 en e5". Cependant, dans le cas - d'une capture il peut y avoir une ambiguité (deux pions sur la même rangée), - donc la colonne est indiquée aussi : "fxe6" (par exemple). + d'ambiguité). Ainsi, 1.e5 veut dire "pion de e4 en e5". Cependant, dans le + cas d'une capture il peut y avoir une ambiguité (deux pions sur la même + rangée), donc la colonne est indiquée aussi : "fxe6" (par exemple). Comme vous le constatez une capture est notée par une croix : "x". figure.diagram-container @@ -73,17 +74,19 @@ p h4 Tours p. - Elles se déplacent horizontalement ou verticalement, d'autant de cases qu'elles - le souhaitent du moment que la voie est libre. + Elles se déplacent horizontalement ou verticalement, d'autant de cases + qu'elles le souhaitent du moment que la voie est libre. Si leur chemin s'arrête sur une pièce adverses, celle-ci peut être capturée - a priori. (A priori car le roi ne doit pas être en échec à la suite de ce coup). + a priori. (A priori car le roi ne doit pas être en échec à la suite de ce + coup). h4 Cavaliers p. - C'est la seule pièce capable de sauter par dessus les autres (sans les capturer). - Ils effectuent des déplacements en "L" : deux cases dans une direction - (horizontale ou verticale), puis une dans une direction orthogonale. + C'est la seule pièce capable de sauter par dessus les autres (sans les + capturer). Ils effectuent des déplacements en "L" : deux cases dans une + direction (horizontale ou verticale), puis une dans une direction + orthogonale. figure.diagram-container .diagram @@ -93,8 +96,8 @@ figure.diagram-container h4 Fous p. - Ils se déplacent en diagonale, aussi loin qu'ils le souhaitent tant que la voie - est libre. Si leur chemin s'arrête sur une pièce ennemie, celle-ci peut + Ils se déplacent en diagonale, aussi loin qu'ils le souhaitent tant que la + voie est libre. Si leur chemin s'arrête sur une pièce ennemie, celle-ci peut a priori être capturée. h4 Dame @@ -117,7 +120,9 @@ ul li déplacer son roi en lieu sûr, ou li capturer l'attaquant, ou li intercepter la ligne d'attaque. -p Selon la situation une ou plus de ces contre-mesures peuvent être inapplicables. +p. + Selon la situation une ou plus de ces contre-mesures peuvent être + inapplicables. p Il est interdit de laisser son roi en échec à la fin d'un coup. @@ -129,20 +134,20 @@ figure.diagram-container h3 Coups spéciaux p. - En plus de la promotion des pions précédemment introduite, deux coups spéciaux - sont à signaler : + En plus de la promotion des pions précédemment introduite, deux coups + spéciaux sont à signaler : ul li. le roque : si le roi et la tour la plus à droite du point de vue des blancs n'ont pas encore bougé, et si rien ne se trouve sur le chemin du roi à la - tour, et si enfin les cases f1 et g1 ne sont pas occupées (ou éventuellement - par les pièces impliquées dans le roque), alors le roi peut aller en g1 et la - tour en f1. + tour, et si enfin les cases f1 et g1 ne sont pas occupées (ou + éventuellement par les pièces impliquées dans le roque), alors le roi peut + aller en g1 et la tour en f1. Note : puisque les pièces sont disposées aléatoirement, le roi ou la tour - peut sembler rester immobile pendant ce coup. - La même chose peut être effectué côté noir, et du "côté gauche" de - l'échiquier avec l'autre tour ; on arrive alors sur les cases c1 (roi) et d1 - (tour). Ce dernier coup est appelé "grand roque", et l'autre "petit roque". + peut sembler rester immobile pendant ce coup. La même chose peut être + effectué côté noir, et du "côté gauche" de l'échiquier avec l'autre tour ; + on arrive alors sur les cases c1 (roi) et d1 (tour). Ce dernier coup est + appelé "grand roque", et l'autre "petit roque". Notation : le petit roque (resp. grand roque) se note 0-0 (resp. 0-0-0). li. en passant : après qu'un pion a avancé de deux cases, si un pion adverse se @@ -180,7 +185,9 @@ p. Toutes les autres façons d'achever une partie mènent à une nulle (1/2-1/2) ; personne ne gagne : ul - li quant un joueur n'a pas de coup légal à disposition sans être en échec (pat), + li. + quand un joueur n'a pas de coup légal à disposition sans être en échec + (pat), li. quand une position est répétée trois fois avec les mêmes droits au roque, et le même joueur au trait, @@ -190,4 +197,4 @@ p. car elle ne se généralise pas facilement aux variantes (pas à toutes), mais surtout car les parties jouées ici le sont avant tout pour s'amuser. Si vous vous lancez dans des manoeuvres de 200 coups et que votre adversaire - n'en a pas marre, pourquoi vous arrêterais-je ? :) + n'en a pas marre, alors continuez :) diff --git a/client/src/translations/rules/Circular/en.pug b/client/src/translations/rules/Circular/en.pug index ab626e5e..377295c6 100644 --- a/client/src/translations/rules/Circular/en.pug +++ b/client/src/translations/rules/Circular/en.pug @@ -23,7 +23,8 @@ p. h3 Source p - a(href="https://www.chessvariants.com/d.betza/chessvar/race.html") 8x8 Race Chess + a(href="https://www.chessvariants.com/d.betza/chessvar/race.html") + | 8x8 Race Chess | on chessvariants.com. p Inventor: Ralph Betza (1997) diff --git a/client/src/translations/rules/Circular/es.pug b/client/src/translations/rules/Circular/es.pug index 301fbcfc..d63ef221 100644 --- a/client/src/translations/rules/Circular/es.pug +++ b/client/src/translations/rules/Circular/es.pug @@ -26,7 +26,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/d.betza/chessvar/race.html") variante 8x8 Race + a(href="https://www.chessvariants.com/d.betza/chessvar/race.html") + | variante 8x8 Race | en chessvariants.com. p Inventor: Ralph Betza (1997) diff --git a/client/src/translations/rules/Circular/fr.pug b/client/src/translations/rules/Circular/fr.pug index 9087f1cb..3326df9b 100644 --- a/client/src/translations/rules/Circular/fr.pug +++ b/client/src/translations/rules/Circular/fr.pug @@ -26,7 +26,8 @@ h3 Source p | La - a(href="https://www.chessvariants.com/d.betza/chessvar/race.html") variante 8x8 Race + a(href="https://www.chessvariants.com/d.betza/chessvar/race.html") + | variante 8x8 Race | sur chessvariants.com. p Inventeur : Ralph Betza (1997) diff --git a/client/src/translations/rules/Crazyhouse/en.pug b/client/src/translations/rules/Crazyhouse/en.pug index 66b5f736..8658dd0f 100644 --- a/client/src/translations/rules/Crazyhouse/en.pug +++ b/client/src/translations/rules/Crazyhouse/en.pug @@ -5,9 +5,9 @@ p.boxed p | Orthodox rules apply, with only one change: | every time a piece is captured, the capturer "reserve" of pieces is - | augmented with this figure. At every move, you may choose to land one of your - | reserve pieces anywhere on the board (except first and last ranks for pawns), - | instead of playing a regular move. + | augmented with this figure. At every move, you may choose to land one of + | your reserve pieces anywhere on the board (except first and last ranks for + | pawns), instead of playing a regular move. p. Move notation: an arobase '@' indicate piece landing. For example B@d4 means @@ -20,8 +20,8 @@ figure.diagram-container p. Note: capturing a promoted pawn put a pawn in the reserve, - not the promoted piece. This is to allow to gain material on last rank without - fear of giving a queen to the opponent. + not the promoted piece. This is to allow to gain material on last rank + without fear of giving a queen to the opponent. h3 More information diff --git a/client/src/translations/rules/Cylinder/en.pug b/client/src/translations/rules/Cylinder/en.pug index 0b436765..c46e14da 100644 --- a/client/src/translations/rules/Cylinder/en.pug +++ b/client/src/translations/rules/Cylinder/en.pug @@ -20,5 +20,6 @@ figure.diagram-container h3 Source p - a(href="https://www.chessvariants.com/boardrules.dir/cylindrical.html") Cylinder Chess + a(href="https://www.chessvariants.com/boardrules.dir/cylindrical.html") + | Cylinder Chess | on chessvariants.com. diff --git a/client/src/translations/rules/Cylinder/es.pug b/client/src/translations/rules/Cylinder/es.pug index 358a8e43..a4d40fcd 100644 --- a/client/src/translations/rules/Cylinder/es.pug +++ b/client/src/translations/rules/Cylinder/es.pug @@ -7,8 +7,9 @@ p. p. Esto permite dobles jaques dadas por una sola pieza. En el diagrama - a continuación, el alfil da jaque por dos caminos diferentes: e2-d3-c4 y g2-h3-a4. - No es posible cubrir las dos lÃneas de ataque, por lo que el rey debe moverse. + a continuación, el alfil da jaque por dos caminos diferentes: e2-d3-c4 y + g2-h3-a4. No es posible cubrir las dos lÃneas de ataque, por lo que el rey + debe moverse. figure.diagram-container .diagram.diag12 @@ -16,7 +17,8 @@ figure.diagram-container .diagram.diag22 | fen:4k3/2p5/8/8/7N/8/3P4/7K a2,b3,b5,a6,g2,f3,f5,g6: figcaption. - Izquierda: doble-jaque en b5. Derecha: posibles movimientos de caballo desde h4. + Izquierda: doble-jaque en b5. + Derecha: posibles movimientos de caballo desde h4. h3 Fuente diff --git a/client/src/translations/rules/Cylinder/fr.pug b/client/src/translations/rules/Cylinder/fr.pug index cd411085..6f9359f9 100644 --- a/client/src/translations/rules/Cylinder/fr.pug +++ b/client/src/translations/rules/Cylinder/fr.pug @@ -7,8 +7,9 @@ p. p. Ceci permet des double échecs donnés par une seule pièce. Sur le diagramme - suivant, le fou donne échec par deux chemins différents : e2-d3-c4 et g2-h3-a4. - Il n'est pas possible de couvrir les deux lignes d'attaque, donc le roi doit bouger. + suivant, le fou donne échec par deux chemins différents : e2-d3-c4 et + g2-h3-a4. Il n'est pas possible de couvrir les deux lignes d'attaque, donc + le roi doit bouger. figure.diagram-container .diagram.diag12 diff --git a/client/src/translations/rules/Eightpieces/en.pug b/client/src/translations/rules/Eightpieces/en.pug index 9a00364f..66105525 100644 --- a/client/src/translations/rules/Eightpieces/en.pug +++ b/client/src/translations/rules/Eightpieces/en.pug @@ -37,6 +37,7 @@ h3 Complete rules p | The rules were invented by Jeff Kubach (2020), who described them much | more precisely on the - a(href="https://www.chessvariants.com/rules/8-piece-chess") chessvariants page + a(href="https://www.chessvariants.com/rules/8-piece-chess") + | chessvariants page | . While the summary given above may suffice to start playing, | you should read the complete rules to fully understand this variant. diff --git a/client/src/translations/rules/Eightpieces/es.pug b/client/src/translations/rules/Eightpieces/es.pug index 27bdf936..9ef6a66f 100644 --- a/client/src/translations/rules/Eightpieces/es.pug +++ b/client/src/translations/rules/Eightpieces/es.pug @@ -43,7 +43,8 @@ h3 Reglas completas p | Las reglas fueron inventadas por Jeff Kubach (2020), quien las describió | mucho más especÃficamente en la - a(href="https://www.chessvariants.com/rules/8-piece-chess") página chessvariants + a(href="https://www.chessvariants.com/rules/8-piece-chess") + | página chessvariants | . El resumen anterior puede ser suficiente para comenzar a jugar, | pero deberÃas leer todas las reglas para entender completamente | esta variante. diff --git a/client/src/translations/rules/Eightpieces/fr.pug b/client/src/translations/rules/Eightpieces/fr.pug index f904b7db..a91103b1 100644 --- a/client/src/translations/rules/Eightpieces/fr.pug +++ b/client/src/translations/rules/Eightpieces/fr.pug @@ -40,7 +40,8 @@ h3 Règles complètes p | Les règles ont été inventées par Jeff Kubach (2020), qui les a décrites | beaucoup plus précisément sur la - a(href="https://www.chessvariants.com/rules/8-piece-chess") page chessvariants + a(href="https://www.chessvariants.com/rules/8-piece-chess") + | page chessvariants | . Le résumé donné ci-dessus peut suffire pour commencer à jouer, | mais vous devriez lire l'intégralité des règles afin de bien comprendre | cette variante. diff --git a/client/src/translations/rules/Extinction/en.pug b/client/src/translations/rules/Extinction/en.pug index fada86dc..ebd0e1a5 100644 --- a/client/src/translations/rules/Extinction/en.pug +++ b/client/src/translations/rules/Extinction/en.pug @@ -2,9 +2,9 @@ p.boxed | Win by eliminating all opponent pieces of the same type. p. - Standard rules apply, but the game ends when all pieces of a kind disappeared. - Kings are treated as normal pieces (no royal power), but may castle - - without any concern about checks. + Standard rules apply, but the game ends when all pieces of a kind + disappeared. Kings are treated as normal pieces (no royal power), but may + castle - without any concern about checks. Pawns may promote into king. If all pieces of a kind disappear, the game is lost; except if it's a pawns extinction which results in a non-pawn extinction by capturing and @@ -13,8 +13,8 @@ p. h3 End of the game p. - Win by eliminating all enemy pawns, or rooks, or knights, or bishops, or queen(s), - or king(s) (there may be several if promotions happened). + Win by eliminating all enemy pawns, or rooks, or knights, or bishops, or + queen(s), or king(s) (there may be several if promotions happened). figure.diagram-container .diagram @@ -24,7 +24,8 @@ figure.diagram-container h3 Source p - a(href="https://www.chessvariants.com/winning.dir/extinction.html") Extinction chess + a(href="https://www.chessvariants.com/winning.dir/extinction.html") + | Extinction chess | on chessvariants.com. p Inventor: R. Wayne Schmittberger (1985) diff --git a/client/src/translations/rules/Extinction/es.pug b/client/src/translations/rules/Extinction/es.pug index d0a993db..034d007a 100644 --- a/client/src/translations/rules/Extinction/es.pug +++ b/client/src/translations/rules/Extinction/es.pug @@ -8,13 +8,15 @@ p. Los peones pueden ser promovidos a reyes. Si se capturan todas las piezas del mismo tipo, el juego se pierde; excepto en el caso de una extinción de peones que resulte en una extinción - (de cierto tipo de pieza) mediante la realización de una promoción con captura. + (de cierto tipo de pieza) mediante la realización de una promoción con + captura. h3 Fin de la partida p. - Ganas eliminando todos los peones de tu oponente, o todas sus torres o dama(s), - o todos sus caballos, alfiles o reye(s) (peones promovidos potenciales). + Ganas eliminando todos los peones de tu oponente, o todas sus torres o + dama(s), o todos sus caballos, alfiles o reye(s) (peones promovidos + potenciales). figure.diagram-container .diagram diff --git a/client/src/translations/rules/Extinction/fr.pug b/client/src/translations/rules/Extinction/fr.pug index a1a0c830..6db9cd79 100644 --- a/client/src/translations/rules/Extinction/fr.pug +++ b/client/src/translations/rules/Extinction/fr.pug @@ -14,7 +14,8 @@ p. h3 Fin de la partie p. - On gagne en éliminant tous les pions adverses, ou toutes ses tours ou dame(s), ou tous ses cavaliers, fous ou roi(s) (pions promus potentiels). + On gagne en éliminant tous les pions adverses, ou toutes ses tours ou + dame(s), ou tous ses cavaliers, fous ou roi(s) (pions promus potentiels). figure.diagram-container .diagram diff --git a/client/src/translations/rules/Grand/en.pug b/client/src/translations/rules/Grand/en.pug index 76c5b6e2..5154cdfa 100644 --- a/client/src/translations/rules/Grand/en.pug +++ b/client/src/translations/rules/Grand/en.pug @@ -4,9 +4,9 @@ p.boxed p. Grand chess is played on a 10x10 board. - Two new pieces appear: the marshall and the cardinal, written respectively M and C. - A marshall has the moving abilities of a knight + a rook, while the cardinal - equals a knight + a bishop. + Two new pieces appear: the marshall and the cardinal, written respectively + M and C. A marshall has the moving abilities of a knight + a rook, while the + cardinal equals a knight + a bishop. figure.diagram-container .diagram @@ -16,15 +16,15 @@ figure.diagram-container h3 Special moves p. - Castling is possible as in orthodox 8x8 game. The white king move to c1 or i1 - (one square to the left of bottom-right corner) for large (resp. small) castle. - Same for black on the other side. + Castling is possible as in orthodox 8x8 game. The white king move to c1 or + i1 (one square to the left of bottom-right corner) for large (resp. small) + castle. Same for black on the other side. p. - Promotion is mandatory for a pawn reaching the last rank. However, they can only - promote into a friendly piece captured (which is back on the board). If none is - available, the promotion on last rank is impossible and the pawn cannot move - (but still gives check). + Promotion is mandatory for a pawn reaching the last rank. However, they can + only promote into a friendly piece captured (which is back on the board). + If none is available, the promotion on last rank is impossible and the pawn + cannot move (but still gives check). p. Pawn promotion is possible (but not forced) on the two ranks before last, @@ -40,7 +40,8 @@ h3 Source p | Grand chess page on - a(href="https://www.chessvariants.com/large.dir/freeling.html") chessvariants.com + a(href="https://www.chessvariants.com/large.dir/freeling.html") + | chessvariants.com | . p Inventor: Christian Freeling (1984) diff --git a/client/src/translations/rules/Grand/es.pug b/client/src/translations/rules/Grand/es.pug index 6a00e276..38970302 100644 --- a/client/src/translations/rules/Grand/es.pug +++ b/client/src/translations/rules/Grand/es.pug @@ -35,14 +35,15 @@ p. p. Nota: cambié la posición inicial planificada por el autor, a aumentar el alea de la situación inicial (y estandarizar con los demás - variantes). De repente, la regla de enroque se agregó en comparación con las reglas - inicialmente descrito. + variantes). De repente, la regla de enroque se agregó en comparación con las + reglas inicialmente descrito. h3 Fuente p | La página dedicada a la variante Grand en - a(href="https://www.chessvariants.com/large.dir/freeling.html") chessvariants.com + a(href="https://www.chessvariants.com/large.dir/freeling.html") + | chessvariants.com | . p Inventor: Christian Freeling (1984) diff --git a/client/src/translations/rules/Grand/fr.pug b/client/src/translations/rules/Grand/fr.pug index 6c36de57..b058b77c 100644 --- a/client/src/translations/rules/Grand/fr.pug +++ b/client/src/translations/rules/Grand/fr.pug @@ -41,7 +41,8 @@ h3 Source p | La page dédiée à la variante Grand sur - a(href="https://www.chessvariants.com/large.dir/freeling.html") chessvariants.com + a(href="https://www.chessvariants.com/large.dir/freeling.html") + | chessvariants.com | . p Inventeur : Christian Freeling (1984) diff --git a/client/src/translations/rules/Grasshopper/en.pug b/client/src/translations/rules/Grasshopper/en.pug index 1dd58eb3..d5cd3ddf 100644 --- a/client/src/translations/rules/Grasshopper/en.pug +++ b/client/src/translations/rules/Grasshopper/en.pug @@ -1,13 +1,14 @@ p.boxed - | A new piece appears: the grasshopper (G), jumping over a piece and landing right after. + | A new piece appears: the grasshopper (G), jumping over a piece and landing + | right after. p. Each player begins with eight grasshoppers between the first rank and the pawns on the third rank. The grasshopper moves potentially in all directions, but needs the help of a piece for its movement : it jumps over the first encountered piece (of any color), - and land on the very next square. - This square must be either empty or occupied by an enemy piece (which is eaten). + and land on the very next square. This square must be either empty or + occupied by an enemy piece (which is eaten). figure.diagram-container .diagram @@ -21,10 +22,13 @@ p. h3 Source p - a(href="https://www.chessvariants.com/dpieces.dir/grashopper.html") Grasshopper Chess + a(href="https://www.chessvariants.com/dpieces.dir/grashopper.html") + | Grasshopper Chess | on chessvariants.com. - | This variant is also playable + | This variant is also playable a(href="https://greenchess.net/rules.php?v=grasshopper") on greenchess.net - | (with a deterministic initial position). + | . -p Inventor: Joseph Boyer (1951), with a piece defined in 1912 by Thomas R. Dawson +p. + Inventor: Joseph Boyer (1951), + with a piece defined in 1912 by Thomas R. Dawson diff --git a/client/src/translations/rules/Grasshopper/es.pug b/client/src/translations/rules/Grasshopper/es.pug index 456d1b8d..000a6fc6 100644 --- a/client/src/translations/rules/Grasshopper/es.pug +++ b/client/src/translations/rules/Grasshopper/es.pug @@ -13,7 +13,8 @@ p. pero necesita la ayuda de una pieza para su movimiento: el salta sobre la primera pieza encontrada (de cualquier color), y aterriza en la casilla justo detrás. - Este última debe estar vacÃo u ocupado por el enemigo (que se encuentra comido). + Este última debe estar vacÃo u ocupado por el enemigo (que se encuentra + comido). figure.diagram-container .diagram @@ -28,10 +29,13 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/dpieces.dir/grashopper.html") variante Grasshopper + a(href="https://www.chessvariants.com/dpieces.dir/grashopper.html") + | variante Grasshopper | en chessvariants.com. - | También podemos jugarlo + | También podemos jugarlo a(href="https://greenchess.net/rules.php?v=grasshopper") en greenchess.net - | (con una posición inicial determinista). + | . -p Inventor: Joseph Boyer (1951), con una pieza definida en 1912 por Thomas R. Dawson +p. + Inventor: Joseph Boyer (1951), + con una pieza definida en 1912 por Thomas R. Dawson diff --git a/client/src/translations/rules/Grasshopper/fr.pug b/client/src/translations/rules/Grasshopper/fr.pug index fb0de792..24236e38 100644 --- a/client/src/translations/rules/Grasshopper/fr.pug +++ b/client/src/translations/rules/Grasshopper/fr.pug @@ -11,9 +11,10 @@ p. rangée et les pions sur la troisième. La sauterelle se déplace potentiellement dans toutes les directions, mais a besoin de l'aide d'une pièce pour son mouvement : - elle saute par dessus la première pièce rencontrée (de n'importe quelle couleur), - et atterrit sur la case située juste derrière. - Cette dernière doit être vide ou occupée par l'ennemi (qui se retrouve mangé). + elle saute par dessus la première pièce rencontrée (de n'importe quelle + couleur), et atterrit sur la case située juste derrière. + Cette dernière doit être vide ou occupée par l'ennemi (qui se retrouve + mangé). figure.diagram-container .diagram @@ -28,10 +29,13 @@ h3 Source p | La - a(href="https://www.chessvariants.com/dpieces.dir/grashopper.html") variante Grasshopper + a(href="https://www.chessvariants.com/dpieces.dir/grashopper.html") + | variante Grasshopper | sur chessvariants.com. - | On peut y jouer également + | On peut y jouer également a(href="https://greenchess.net/rules.php?v=grasshopper") sur greenchess.net - | (avec une position initiale déterministe). + | . -p Inventeur : Joseph Boyer (1951), avec une pièce définie en 1912 par Thomas R. Dawson +p. + Inventeur : Joseph Boyer (1951), + avec une pièce définie en 1912 par Thomas R. Dawson diff --git a/client/src/translations/rules/Hidden/es.pug b/client/src/translations/rules/Hidden/es.pug index d07f40f1..d11369e2 100644 --- a/client/src/translations/rules/Hidden/es.pug +++ b/client/src/translations/rules/Hidden/es.pug @@ -25,14 +25,16 @@ ul humano podrÃa hacer pero mejor que un juego aleatorio. li. Las piezas se distribuyen al azar en las dos primeras filas. - El rey podrÃa estar en la segunda fila, atacado por una torre o dama enemiga. - Dicho eso, ya que no tienes de esta información es una apuesta arriesgada :) + El rey podrÃa estar en la segunda fila, atacado por una torre o dama + enemiga. Dicho eso, ya que no tienes de esta información es una apuesta + arriesgada :) h3 Fuente p | La - a(href="https://www.chessvariants.com/rules/strate-go-chess") variante Strate-Go + a(href="https://www.chessvariants.com/rules/strate-go-chess") + | variante Strate-Go | en chessvariants.com. p Inventor: John Lewis (2005) diff --git a/client/src/translations/rules/Hidden/fr.pug b/client/src/translations/rules/Hidden/fr.pug index 84c3965e..b822b728 100644 --- a/client/src/translations/rules/Hidden/fr.pug +++ b/client/src/translations/rules/Hidden/fr.pug @@ -1,6 +1,6 @@ p.boxed - | La disposition des pièces est cachée : les joueurs connaissent l'emplacement - | des pièces adverses mais pas leur nature. + | La disposition des pièces est cachée : les joueurs connaissent + | l'emplacement des pièces adverses mais pas leur nature. p. Les pièces restent cachées jusqu'à ce qu'elles effectuent une capture, @@ -25,14 +25,16 @@ ul humain pourrait faire mais meilleure qu'un jeu aléatoire. li. Les pièces sont réparties au hasard sur les deux premières rangées. - Le roi pourrait être sur la seconde rangée, attaqué par une tour ou dame ennemie. - Ceci dit, puisque vous ne disposez pas de cette information c'est un pari risqué :) + Le roi pourrait être sur la seconde rangée, attaqué par une tour ou dame + ennemie. Ceci dit, puisque vous ne disposez pas de cette information c'est + un pari risqué :) h3 Source p | La - a(href="https://www.chessvariants.com/rules/strate-go-chess") variante Strate-Go + a(href="https://www.chessvariants.com/rules/strate-go-chess") + | variante Strate-Go | sur chessvariants.com. p Inventeur : John Lewis (2005) diff --git a/client/src/translations/rules/Hiddenqueen/en.pug b/client/src/translations/rules/Hiddenqueen/en.pug index 4ace8ffd..40fb0135 100644 --- a/client/src/translations/rules/Hiddenqueen/en.pug +++ b/client/src/translations/rules/Hiddenqueen/en.pug @@ -3,9 +3,9 @@ p.boxed | She is revealed only when not moving like a pawn. p. - The hidden queen cannot give check (because the opponent cannot see her nature), - but she could sometimes capture the king. This capture ends the game. - Except that, everything goes as in orthodox chess. + The hidden queen cannot give check (because the opponent cannot see her + nature), but she could sometimes capture the king. This capture ends the + game. Except that, everything goes as in orthodox chess. figure.diagram-container .diagram diff --git a/client/src/translations/rules/Hiddenqueen/fr.pug b/client/src/translations/rules/Hiddenqueen/fr.pug index ccc94328..8e0724be 100644 --- a/client/src/translations/rules/Hiddenqueen/fr.pug +++ b/client/src/translations/rules/Hiddenqueen/fr.pug @@ -4,8 +4,8 @@ p.boxed p. La dame cachée ne donne pas échec (car l'adversaire ne voit pas sa nature), - mais elle peut éventuellement capturer le roi. Cette capture met fin à la partie. - à part ça tout se déroule comme aux échecs orthodoxes. + mais elle peut éventuellement capturer le roi. Cette capture met fin à la + partie. à part ça tout se déroule comme aux échecs orthodoxes. figure.diagram-container .diagram diff --git a/client/src/translations/rules/Knightmate/en.pug b/client/src/translations/rules/Knightmate/en.pug index 935c3941..14371613 100644 --- a/client/src/translations/rules/Knightmate/en.pug +++ b/client/src/translations/rules/Knightmate/en.pug @@ -27,6 +27,6 @@ p | on chessvariants.com. | This variant is also playable a(href="https://greenchess.net/rules.php?v=knightmate") on greenchess.net - | (with a deterministic initial position). + | . p Inventor: Bruce Zimov (1972) diff --git a/client/src/translations/rules/Knightmate/es.pug b/client/src/translations/rules/Knightmate/es.pug index 250f26ba..b2221a64 100644 --- a/client/src/translations/rules/Knightmate/es.pug +++ b/client/src/translations/rules/Knightmate/es.pug @@ -6,7 +6,9 @@ p. Los "caballos que se mueven como reyes" son entonces lógicamente llamado "plebeyos", señaló 'C' para "commoner" en inglés. -p El enroque todavÃa es posible, bajo las mismas condiciones que el ajedrez ortodoxo +p. + El enroque todavÃa es posible, bajo las mismas condiciones que el ajedrez + ortodoxo figure.diagram-container .diagram.diag12 @@ -30,6 +32,6 @@ p | en chessvariants.com. | También podemos jugarlo a(href="https://greenchess.net/rules.php?v=knightmate") en greenchess.net - | (con una posición inicial determinista). + | . p Inventor: Bruce Zimov (1972) diff --git a/client/src/translations/rules/Knightmate/fr.pug b/client/src/translations/rules/Knightmate/fr.pug index 742b3b32..7e0b3867 100644 --- a/client/src/translations/rules/Knightmate/fr.pug +++ b/client/src/translations/rules/Knightmate/fr.pug @@ -6,7 +6,9 @@ p. Les "cavaliers se déplaçant comme des rois" sont alors assez logiquement appelés des "roturiers", notés 'C' pour "commoner" en anglais. -p Le roque est toujours possible, sous les mêmes conditions qu'aux échecs orthodoxes. +p. + Le roque est toujours possible, sous les mêmes conditions qu'aux échecs + orthodoxes. figure.diagram-container .diagram.diag12 @@ -30,6 +32,6 @@ p | sur chessvariants.com. | On peut y jouer également a(href="https://greenchess.net/rules.php?v=knightmate") sur greenchess.net - | (avec une position initiale déterministe). + | . p Inventeur : Bruce Zimov (1972) diff --git a/client/src/translations/rules/Knightrelay1/en.pug b/client/src/translations/rules/Knightrelay1/en.pug index 33ba1c2c..72266af7 100644 --- a/client/src/translations/rules/Knightrelay1/en.pug +++ b/client/src/translations/rules/Knightrelay1/en.pug @@ -2,10 +2,11 @@ p.boxed | Any piece guarded by a friendly knight can also move like a knight. p. - In addition to its normal abilities, a piece guarded by a knight can move like him. - On the following diagram, 1.Nf4 would checkmate because it guard the g6 queen. - If it is black to play, then 1...Rxe2 is forbidden because of the knight - immunity exception. Exceptions to the orthodox rules are the following: + In addition to its normal abilities, a piece guarded by a knight can move + like him. On the following diagram, 1.Nf4 would checkmate because it guard + the g6 queen. If it is black to play, then 1...Rxe2 is forbidden because of + the knight immunity exception. Exceptions to the orthodox rules are the + following: ul li Knights cannot capture or be captured. @@ -21,7 +22,8 @@ figure.diagram-container h3 Source p - | These are the original N-relay or Knight-relay rules, described for example + | These are the original N-relay or Knight-relay rules, described for + | example a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") on this page | . See also Knightrelay2. diff --git a/client/src/translations/rules/Knightrelay1/es.pug b/client/src/translations/rules/Knightrelay1/es.pug index 3ab9f8cc..e1ca71cb 100644 --- a/client/src/translations/rules/Knightrelay1/es.pug +++ b/client/src/translations/rules/Knightrelay1/es.pug @@ -1,11 +1,12 @@ p.boxed - | Cualquier parte protegida por un caballo también puede moverse como un caballo. + | Cualquier parte protegida por un caballo también puede moverse como un + | caballo. p. Además de sus capacidades normales, una pieza defendida por un caballo puede - muévete como él. - En el siguiente diagrama, 1.Nf4 serÃa jaque mate porque protege a la dama en g6. - Si son las negras para jugar, entonces 1...Rxe2 es posible gracias al caballo c8. + muévete como él. En el siguiente diagrama, 1.Nf4 serÃa jaque mate porque + protege a la dama en g6. Si son las negras para jugar, entonces 1...Rxe2 es + posible gracias al caballo c8. Si son las negras para jugar, entonces 1...Txe2 está prohibido debido a excepción de la inmunidad del caballo. Las excepciones a las reglas @@ -28,7 +29,8 @@ h3 Fuente p | Esta es la regla de origen de N-relay o Knight-relay, descrita por ejemplo - a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") en esta página + a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") + | en esta página | . Ver también Knightrelay2. p Inventor: Mannis Charosh (1972) diff --git a/client/src/translations/rules/Knightrelay1/fr.pug b/client/src/translations/rules/Knightrelay1/fr.pug index b9d2d8a0..87319293 100644 --- a/client/src/translations/rules/Knightrelay1/fr.pug +++ b/client/src/translations/rules/Knightrelay1/fr.pug @@ -1,5 +1,6 @@ p.boxed - | Toute pièce protégée par un cavalier peut aussi se déplacer comme un cavalier. + | Toute pièce protégée par un cavalier peut aussi se déplacer comme un + | cavalier. p. En plus de ses capacités normales, une pièce défendue par un cavalier peut se @@ -25,8 +26,10 @@ p Ces bizarreries exceptées, les règles orthodoxes s'appliquent. h3 Source p - | Il s'agit de la règle d'origine du N-relay ou Knight-relay, décrite par exemple - a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") sur cette page + | Il s'agit de la règle d'origine du N-relay ou Knight-relay, décrite par + | exemple + a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") + | sur cette page | . Voir aussi Knightrelay2. p Inventeur : Mannis Charosh (1972) diff --git a/client/src/translations/rules/Knightrelay2/en.pug b/client/src/translations/rules/Knightrelay2/en.pug index 2cb3a8b8..71b840f7 100644 --- a/client/src/translations/rules/Knightrelay2/en.pug +++ b/client/src/translations/rules/Knightrelay2/en.pug @@ -2,24 +2,26 @@ p.boxed | Any piece guarded by a friendly knight can also move like a knight. p. - In addition to its normal abilities, a piece guarded by a knight can move like him. - On the following diagram, 1.Nf4 would checkmate because it guard the g6 queen. - If it is black to play, then 1...Rxe2 is possible due to the c8 knight. + In addition to its normal abilities, a piece guarded by a knight can move + like him. On the following diagram, 1.Nf4 would checkmate because it guard + the g6 queen. If it is black to play, then 1...Rxe2 is possible due to the + c8 knight. figure.diagram-container .diagram | fen:7k/8/6Q1/1n6/8/2r5/4N3/K7: p. - A pawn on the sixth rank guarded by a knight could thus make a knight move to reach - the last rank and promote. + A pawn on the sixth rank guarded by a knight could thus make a knight move to + reach the last rank and promote. p These oddities excepted, orthodox rules apply. h3 Source p - | The original rule invented by Mannis Charosh (1972) is described for example + | The original rule invented by Mannis Charosh (1972) is described for + | example a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") on this page - | . However, I don't really like the invulnerability condition and the restrictions - | imposed in these rules, so I implemented this simpler version. + | . However, I don't really like the invulnerability condition and the + | restrictions imposed in these rules, so I implemented this simpler version. diff --git a/client/src/translations/rules/Knightrelay2/es.pug b/client/src/translations/rules/Knightrelay2/es.pug index 941e72d4..d9e6f07c 100644 --- a/client/src/translations/rules/Knightrelay2/es.pug +++ b/client/src/translations/rules/Knightrelay2/es.pug @@ -1,11 +1,12 @@ p.boxed - | Cualquier parte protegida por un caballo también puede moverse como un caballo. + | Cualquier parte protegida por un caballo también puede moverse como un + | caballo. p. Además de sus capacidades normales, una pieza defendida por un caballo puede - muévete como él. - En el siguiente diagrama, 1.Nf4 serÃa jaque mate porque protege a la dama en g6. - Si son las negras para jugar, entonces 1...Rxe2 es posible gracias al caballo c8. + muévete como él. En el siguiente diagrama, 1.Nf4 serÃa jaque mate porque + protege a la dama en g6. Si son las negras para jugar, entonces 1...Rxe2 es + posible gracias al caballo c8. figure.diagram-container .diagram @@ -22,6 +23,8 @@ h3 Fuente p | Las reglas de origen inventado por Mannis Charosh (1972) se describen | por ejemplo - a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") en esta página + a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") + | en esta página | . Sin embargo, no me gusta mucho la condición de invulnerabilidad y las - | restricciones impuestas por estas reglas, por lo que implementé esta versión simplificada. + | restricciones impuestas por estas reglas, por lo que implementé esta + | versión simplificada. diff --git a/client/src/translations/rules/Knightrelay2/fr.pug b/client/src/translations/rules/Knightrelay2/fr.pug index 994d2495..f523dadd 100644 --- a/client/src/translations/rules/Knightrelay2/fr.pug +++ b/client/src/translations/rules/Knightrelay2/fr.pug @@ -1,27 +1,31 @@ p.boxed - | Toute pièce protégée par un cavalier peut aussi se déplacer comme un cavalier. + | Toute pièce protégée par un cavalier peut aussi se déplacer comme un + | cavalier. p. En plus de ses capacités normales, une pièce défendue par un cavalier peut se - déplacer comme lui. - Sur le diagramme suivant, 1.Nf4 ferait mat car il protège la dame en g6. - Si c'est aux noirs de jouer, alors 1...Txe2 est possible grâce au cavalier c8. + déplacer comme lui. Sur le diagramme suivant, 1.Nf4 ferait mat car il protège + la dame en g6. Si c'est aux noirs de jouer, alors 1...Txe2 est possible grâce + au cavalier c8. figure.diagram-container .diagram | fen:7k/8/6Q1/1n6/8/2r5/4N3/K7: p. - Un pion sur la sixième rangée protégé par un cavalier pourrait ainsi effectuer - un coup de cavalier pour atteindre la dernière rangée et se promouvoir. + Un pion sur la sixième rangée protégé par un cavalier pourrait ainsi + effectuer un coup de cavalier pour atteindre la dernière rangée et se + promouvoir. p Ces bizarreries exceptées, les règles orthodoxes s'appliquent. h3 Source p - | Les règles d'origine inventées par Mannis Charosh (1972) sont décrites par exemple - a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") sur cette page + | Les règles d'origine inventées par Mannis Charosh (1972) sont décrites par + | exemple + a(href="https://www.chessvariants.com/diffmove.dir/nrelay.html") + | sur cette page | . Cependant, je n'aime pas vraiment la condition d'invulnérabilité et les - | restrictions imposées par ces règles, donc j'ai implémenté cette version simplifiée. - + | restrictions imposées par ces règles, donc j'ai implémenté cette version + | simplifiée. diff --git a/client/src/translations/rules/Losers/es.pug b/client/src/translations/rules/Losers/es.pug index f4e95220..e095f06d 100644 --- a/client/src/translations/rules/Losers/es.pug +++ b/client/src/translations/rules/Losers/es.pug @@ -6,7 +6,8 @@ p. o jaque mate como en el siguiente diagrama. Se aplican todas las reglas habituales, pero las capturas son obligatorias. Cuando son posibles varias capturas, puede elegir: desde - posición del diagrama 1.Nf3?? y 1.g4?! permiten 1...Qxf3 y 1...Nxg4 respectivamente. + posición del diagrama 1.Nf3?? y 1.g4?! permiten 1...Qxf3 y 1...Nxg4 + respectivamente. figure.diagram-container .diagrama diff --git a/client/src/translations/rules/Losers/fr.pug b/client/src/translations/rules/Losers/fr.pug index 507ce030..626b541f 100644 --- a/client/src/translations/rules/Losers/fr.pug +++ b/client/src/translations/rules/Losers/fr.pug @@ -4,9 +4,10 @@ p.boxed p. L'objectif est de perdre toutes ses pièces sauf le roi, ou d'être pat ou mat comme sur le diagramme suivant. - Toutes les règles habituelles s'appliquent, mais les capturees sont obligatoires. - Quand plusieurs captures sont possibles vous pouvez choisir : depuis la - position du diagramme 1.Nf3?? et 1.g4?! permettent respectivement 1...Qxf3 et 1...Nxg4. + Toutes les règles habituelles s'appliquent, mais les capturees sont + obligatoires. Quand plusieurs captures sont possibles vous pouvez choisir : + depuis la position du diagramme 1.Nf3?? et 1.g4?! permettent respectivement + 1...Qxf3 et 1...Nxg4. figure.diagram-container .diagram diff --git a/client/src/translations/rules/Magnetic/en.pug b/client/src/translations/rules/Magnetic/en.pug index 2a7d80f8..67114031 100644 --- a/client/src/translations/rules/Magnetic/en.pug +++ b/client/src/translations/rules/Magnetic/en.pug @@ -4,12 +4,13 @@ p.boxed p. Every piece has a charge generating a magnetic field, except the two kings - which have a neutral charge. - Pieces of the same color have let's say a positive charge, - while the others have a negative charge. - After each move positive charges attract negative ones, and repel positive ones. + which have a neutral charge. Pieces of the same color have let's say a + positive charge, while the others have a negative charge. After each move + positive charges attract negative ones, and repel positive ones. -p Win by capturing opponent's king. There is no notion of check or stalemate here. +p. + Win by capturing opponent's king. There is no notion of check or stalemate + here. figure.diagram-container .diagram.diag12 @@ -19,9 +20,9 @@ figure.diagram-container figcaption Left: before white move Qd5. Right: after this move. p. - Remember that since kings have a neutral charge, any of their movement does not - change anything on the board. They also block magnetic actions which go in - their direction. + Remember that since kings have a neutral charge, any of their movement does + not change anything on the board. They also block magnetic actions which go + in their direction. p. Castling is possible, but no en-passant captures. @@ -30,7 +31,8 @@ p. h3 Source p - a(href="https://www.chessvariants.com/other.dir/magnetic.html") Magnetic chess - | on chessvariants.com. + a(href="https://www.chessvariants.com/other.dir/magnetic.html") + | Magnetic chess + | on chessvariants.com. p Inventors: Joao Pedro Neto and Claude Chaunier (1996) diff --git a/client/src/translations/rules/Magnetic/es.pug b/client/src/translations/rules/Magnetic/es.pug index d8475c1d..128132a4 100644 --- a/client/src/translations/rules/Magnetic/es.pug +++ b/client/src/translations/rules/Magnetic/es.pug @@ -17,7 +17,9 @@ figure.diagram-container | fen:3b4/8/3K4/q1R2rP1/3Q4/8/3b4/8: .diagram.diag22 | fen:3b4/8/3K4/qR1Qr1P1/3b4/8/8/8: - figcaption Izquierda: antes del movimiento blanco Qd5. Derecha: después de este movimiento. + figcaption. + Izquierda: antes del movimiento blanco Qd5. + Derecha: después de este movimiento. p. Los reyes son neutrales, sus movimientos no cambian nada a la @@ -32,7 +34,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/other.dir/magnetic.html") variante magnética + a(href="https://www.chessvariants.com/other.dir/magnetic.html") + | variante magnética | en chessvariants.com. p Inventores: Joao Pedro Neto y Claude Chaunier (1996) diff --git a/client/src/translations/rules/Magnetic/fr.pug b/client/src/translations/rules/Magnetic/fr.pug index 98c1a25c..217c0148 100644 --- a/client/src/translations/rules/Magnetic/fr.pug +++ b/client/src/translations/rules/Magnetic/fr.pug @@ -1,12 +1,11 @@ p.boxed - | Chaque pièce comporte une charge générant un champ magnétique, - | qui attire les pièces de couleur opposée tout en repoussant les pièces amies. + | Chaque pièce comporte une charge générant un champ magnétique, qui attire + | les pièces de couleur opposée tout en repoussant les pièces amies. p. Chaque pièce contient une charge générant un champ magnétique, excepté les - rois qui sont neutres. - Disons que les pièces d'une même couleur sont chargées positivement, - tandis que les autres sont chargées négativement. + rois qui sont neutres. Disons que les pièces d'une même couleur sont chargées + positivement, tandis que les autres sont chargées négativement. Après chaque coup les charges positives attirent les charges négatives, et repoussent les autres charges positives. @@ -32,7 +31,8 @@ h3 Source p | La - a(href="https://www.chessvariants.com/other.dir/magnetic.html") variante Magnetic + a(href="https://www.chessvariants.com/other.dir/magnetic.html") + | variante Magnetic | sur chessvariants.com. p Inventeurs : Joao Pedro Neto et Claude Chaunier (1996) diff --git a/client/src/translations/rules/Marseille/es.pug b/client/src/translations/rules/Marseille/es.pug index aa80c592..0e57e661 100644 --- a/client/src/translations/rules/Marseille/es.pug +++ b/client/src/translations/rules/Marseille/es.pug @@ -36,7 +36,8 @@ p. Si el oponente ha movido un peón permitiendo tal captura (una o dos veces), entonces para aprovecharlo debes tomar en passant en el primer movimiento de tu turno. Entonces, si (y solo si) hay - otra captura en passant disponible, puede ejecutarla en el segundo movimiento. + otra captura en passant disponible, puede ejecutarla en el segundo + movimiento. p. Nota: si un peón mueve dos casillas y después una pieza ocupa el espacio de diff --git a/client/src/translations/rules/Marseille/fr.pug b/client/src/translations/rules/Marseille/fr.pug index da165c70..5afadd38 100644 --- a/client/src/translations/rules/Marseille/fr.pug +++ b/client/src/translations/rules/Marseille/fr.pug @@ -2,8 +2,8 @@ p.boxed | Jouez deux coups à chaque tour. p. - La seule différence avec le jeu orthodoxe est la règle du double-coup, mais cela - affecte beaucoup le jeu. + La seule différence avec le jeu orthodoxe est la règle du double-coup, mais + cela affecte beaucoup le jeu. p. Au tout début de la partie les blancs ne jouent qu'un seul coup, comme @@ -19,9 +19,9 @@ ul une fois encore il n'y a pas de deuxième coup. p. - Au sujet du format PGN de la partie : quand un camp joue deux coups d'affilée, - ils sont séparés (dans l'ordre) par une virgule. Exemple : 3.Na5,Bd3 e6,f4 - (les deux premiers sont des coups blancs, les deux suivants + Au sujet du format PGN de la partie : quand un camp joue deux coups + d'affilée, ils sont séparés (dans l'ordre) par une virgule. Exemple : + 3.Na5,Bd3 e6,f4 (les deux premiers sont des coups blancs, les deux suivants sont des coups noirs). figure.diagram-container @@ -39,8 +39,8 @@ p. une autre prise en passant disponible, vous pouvez l'exécuter au second coup. p. - Note : si un pion se déplace de deux cases puis qu'une pièce occupe la case de - prise en passant au second coup d'un tour, une capture sur cette case ne + Note : si un pion se déplace de deux cases puis qu'une pièce occupe la case + de prise en passant au second coup d'un tour, une capture sur cette case ne prendra que la pièce. Et, si un pion a avancé deux fois la prise en passant sur son premier déplacement est impossible (le pion est "trop loin" désormais). diff --git a/client/src/translations/rules/Orda/es.pug b/client/src/translations/rules/Orda/es.pug index 7f5ab78a..72c4ac18 100644 --- a/client/src/translations/rules/Orda/es.pug +++ b/client/src/translations/rules/Orda/es.pug @@ -211,7 +211,8 @@ table p | Para aquellos que desean un enfoque simplificado, esta tabla puede ser | usado como una aproximación. - span.italic Nota: esta simplificación es utilizada por el bot equivocada aquÃ. + span.italic + | Nota: esta simplificación es utilizada por el bot equivocada aquÃ. table tr diff --git a/client/src/translations/rules/Perfect/en.pug b/client/src/translations/rules/Perfect/en.pug index 5973aa8f..ed04deef 100644 --- a/client/src/translations/rules/Perfect/en.pug +++ b/client/src/translations/rules/Perfect/en.pug @@ -22,10 +22,11 @@ p. h3 Source p - a(href="https://www.chessvariants.com/diffmove.dir/perfectchess.html") Perfect chess + a(href="https://www.chessvariants.com/diffmove.dir/perfectchess.html") + | Perfect chess | on chessvariants.com. | You can also play this variant - a(href="https://greenchess.net/rules.php?v=perfect") on greenchess + a(href="https://greenchess.net/rules.php?v=perfect") on greenchess.net | . p Inventor: Köksal Karakus (2000) diff --git a/client/src/translations/rules/Perfect/es.pug b/client/src/translations/rules/Perfect/es.pug index f5a5240e..c2d40d40 100644 --- a/client/src/translations/rules/Perfect/es.pug +++ b/client/src/translations/rules/Perfect/es.pug @@ -23,10 +23,11 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/diffmove.dir/perfectchess.html") variante Perfect + a(href="https://www.chessvariants.com/diffmove.dir/perfectchess.html") + | variante Perfect | en chessvariants.com. | Esta variante también es jugable - a(href="https://greenchess.net/rules.php?v=perfect") en greenchess + a(href="https://greenchess.net/rules.php?v=perfect") en greenchess.net | . p Inventor: Köksal Karakus (2000) diff --git a/client/src/translations/rules/Perfect/fr.pug b/client/src/translations/rules/Perfect/fr.pug index 07e3b38a..51a7cb81 100644 --- a/client/src/translations/rules/Perfect/fr.pug +++ b/client/src/translations/rules/Perfect/fr.pug @@ -23,10 +23,11 @@ h3 Source p | La - a(href="https://www.chessvariants.com/diffmove.dir/perfectchess.html") variante Perfect + a(href="https://www.chessvariants.com/diffmove.dir/perfectchess.html") + | variante Perfect | sur chessvariants.com. | Cette variante est également jouable - a(href="https://greenchess.net/rules.php?v=perfect") sur greenchess + a(href="https://greenchess.net/rules.php?v=perfect") sur greenchess.net | . p Inventeur : Köksal Karakus (2000) diff --git a/client/src/translations/rules/Racingkings/fr.pug b/client/src/translations/rules/Racingkings/fr.pug index 41d0091f..b84b9a8b 100644 --- a/client/src/translations/rules/Racingkings/fr.pug +++ b/client/src/translations/rules/Racingkings/fr.pug @@ -5,11 +5,13 @@ p.boxed p. Pour gagner votre roi doit parvenir sur la 8eme rangée. Il ne peut jamais être en échec (il n'y a donc pas de mat). - Le pat signifierait match nul, mais il arrive très rarement dans cette variante. + Le pat signifierait match nul, mais il arrive très rarement dans cette + variante. p. - La stratégie de base consiste à ériger des barrières sur le chemin du roi adverse, - avec des tours et la dame par exemple, tandis que votre roi avance à côté. + La stratégie de base consiste à ériger des barrières sur le chemin du roi + adverse, avec des tours et la dame par exemple, tandis que votre roi avance + à côté. figure.diagram-container .diagram diff --git a/client/src/translations/rules/Recycle/en.pug b/client/src/translations/rules/Recycle/en.pug index a89fd21d..673b5871 100644 --- a/client/src/translations/rules/Recycle/en.pug +++ b/client/src/translations/rules/Recycle/en.pug @@ -19,13 +19,14 @@ figure.diagram-container figcaption After 1.Rxb1 Nxe7 2.N@e5 @d4 p. - Note: when a pawn reaches the 8th(1st) rank, it will get removed from the board. - It will not be replaced by another piece. It does not promote. + Note: when a pawn reaches the 8th(1st) rank, it will get removed from the + board. It will not be replaced by another piece. It does not promote. h3 Source p - a(href="https://www.chessvariants.com/difftaking.dir/recyclechess.html") Recycle chess + a(href="https://www.chessvariants.com/difftaking.dir/recyclechess.html") + | Recycle chess | on chessvariants.com. p Inventor: Robert Huber (2000) diff --git a/client/src/translations/rules/Recycle/es.pug b/client/src/translations/rules/Recycle/es.pug index b2cb3007..8edbadc0 100644 --- a/client/src/translations/rules/Recycle/es.pug +++ b/client/src/translations/rules/Recycle/es.pug @@ -28,7 +28,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/difftaking.dir/recyclechess.html") variante Reciclaje + a(href="https://www.chessvariants.com/difftaking.dir/recyclechess.html") + | variante Reciclaje | en chessvariants.com. p Inventor: Robert Huber (2000) diff --git a/client/src/translations/rules/Recycle/fr.pug b/client/src/translations/rules/Recycle/fr.pug index 6c4c6e3b..57d0fd82 100644 --- a/client/src/translations/rules/Recycle/fr.pug +++ b/client/src/translations/rules/Recycle/fr.pug @@ -28,7 +28,8 @@ h3 Source p | La - a(href="https://www.chessvariants.com/difftaking.dir/recyclechess.html") variante Recyclage + a(href="https://www.chessvariants.com/difftaking.dir/recyclechess.html") + | variante Recyclage | sur chessvariants.com. p Inventeur : Robert Huber (2000) diff --git a/client/src/translations/rules/Rifle/en.pug b/client/src/translations/rules/Rifle/en.pug index 1f87778a..04c41724 100644 --- a/client/src/translations/rules/Rifle/en.pug +++ b/client/src/translations/rules/Rifle/en.pug @@ -13,8 +13,9 @@ figure.diagram-container figcaption Left: after 1.e4 Nc6 2.Qh5 b6??. Right: after 3.Qxf7+ g6 4.Qxg6#. p. - This "small" difference alters the strategy a lot: guarding pieces is useless, - for example, and the king cannot escape a distant check by capturing. + This "small" difference alters the strategy a lot: guarding pieces is + useless, for example, and the king cannot escape a distant check by + capturing. h3 Source diff --git a/client/src/translations/rules/Rifle/es.pug b/client/src/translations/rules/Rifle/es.pug index 5226ea8a..5b76a3e8 100644 --- a/client/src/translations/rules/Rifle/es.pug +++ b/client/src/translations/rules/Rifle/es.pug @@ -2,25 +2,29 @@ p.boxed | Las piezas que capturan no se mueven. p. - Todo sigue como en el ajedrez ortodoxo, excepto que después de haber capturado - una pieza, el atacante se queda en su casilla. + Todo sigue como en el ajedrez ortodoxo, excepto que después de haber + capturado una pieza, el atacante se queda en su casilla. figure.diagram-container .diagram.diag12 | fen:r1bqkbnr/p1pppppp/1pn5/7Q/4P3/8/PPPP1PPP/RNB1KBNR: .diagram.diag22 | fen:r1bqkbnr/p1ppp2p/1pn5/7Q/4P3/8/PPPP1PPP/RNB1KBNR: - figcaption Izquierda: después de 1.e4 Nc6 2.Qh5 b6??. Derecha: después de 3.Qxf7+ g6 4.Qxg6#. + figcaption. + Izquierda: después de 1.e4 Nc6 2.Qh5 b6??. + Derecha: después de 3.Qxf7+ g6 4.Qxg6#. p. - Esta "pequeña" diferencia altera enormemente la estrategia: defender las piezas - es inútil, por ejemplo, y el rey no puede escapar un jaque remota capturando. + Esta "pequeña" diferencia altera enormemente la estrategia: defender las + piezas es inútil, por ejemplo, y el rey no puede escapar un jaque remota + capturando. h3 Fuente p | La - a(href="https://www.chessvariants.com/difftaking.dir/rifle.html") variante Rifle + a(href="https://www.chessvariants.com/difftaking.dir/rifle.html") + | variante Rifle | en chessvariants.com. p Inventor: W. B. Seabrook (1921) diff --git a/client/src/translations/rules/Rifle/fr.pug b/client/src/translations/rules/Rifle/fr.pug index f291f857..08913d10 100644 --- a/client/src/translations/rules/Rifle/fr.pug +++ b/client/src/translations/rules/Rifle/fr.pug @@ -10,17 +10,20 @@ figure.diagram-container | fen:r1bqkbnr/p1pppppp/1pn5/7Q/4P3/8/PPPP1PPP/RNB1KBNR: .diagram.diag22 | fen:r1bqkbnr/p1ppp2p/1pn5/7Q/4P3/8/PPPP1PPP/RNB1KBNR: - figcaption Gauche: après 1.e4 Nc6 2.Qh5 b6??. Droite: après 3.Qxf7+ g6 4.Qxg6#. + figcaption. + Gauche: après 1.e4 Nc6 2.Qh5 b6??. Droite: après 3.Qxf7+ g6 4.Qxg6#. p. Cette "petite" différence altère beaucoup la stratégie : défendre les pièces - est inutile, par exemple, et le roi ne pas échapper à un échec distant en capturant. + est inutile, par exemple, et le roi ne pas se soustraire à un échec distant + en capturant. h3 Source p | La - a(href="https://www.chessvariants.com/difftaking.dir/rifle.html") variante Rifle + a(href="https://www.chessvariants.com/difftaking.dir/rifle.html") + | variante Rifle | sur chessvariants.com. p Inventeur : W. B. Seabrook (1921) diff --git a/client/src/translations/rules/Royalrace/en.pug b/client/src/translations/rules/Royalrace/en.pug index 8198d101..ef4f02bf 100644 --- a/client/src/translations/rules/Royalrace/en.pug +++ b/client/src/translations/rules/Royalrace/en.pug @@ -3,8 +3,8 @@ p.boxed | Giving check is not allowed. p. - The board is of size 11 by 11, and to win your king must arrive on the 11th rank. - He can never be in check (thus there is no checkmate). + The board is of size 11 by 11, and to win your king must arrive on the 11th + rank. He can never be in check (thus there is no checkmate). Stalemate would be a draw, but it seldom occur in this variant. p. @@ -29,7 +29,7 @@ ul h3 Source p - | Strongly inspired by the Racing Kings variant invented by Vernon R. Parton (1961), - | playable for example + | Strongly inspired by the Racing Kings variant invented by Vernon R. Parton + | (1961), playable for example a(href="https://lichess.org/variant/racingKings") on lichess | , and also here: see "Racingkings" variant :-) diff --git a/client/src/translations/rules/Royalrace/fr.pug b/client/src/translations/rules/Royalrace/fr.pug index 02f42f69..21f6dae4 100644 --- a/client/src/translations/rules/Royalrace/fr.pug +++ b/client/src/translations/rules/Royalrace/fr.pug @@ -4,13 +4,14 @@ p.boxed p. L'échiquier est de taille 11 par 11, et pour gagner votre roi doit parvenir - sur la 11eme rangée. - Il ne peut jamais être en échec (il n'y a donc pas de mat). - Le pat signifierait match nul, mais il arrive très rarement dans cette variante. + sur la 11eme rangée. Il ne peut jamais être en échec (il n'y a donc pas de + mat). Le pat signifierait match nul, mais il arrive très rarement dans cette + variante. p. - La stratégie de base consiste à ériger des barrières sur le chemin du roi adverse, - avec des tours et la dame par exemple, tandis que votre roi avance à côté. + La stratégie de base consiste à ériger des barrières sur le chemin du roi + adverse, avec des tours et la dame par exemple, tandis que votre roi avance + à côté. figure.diagram-container .diagram @@ -31,7 +32,7 @@ ul h3 Source p - | Fortement inspiré par la variante Racing Kings inventée par Vernon R. Parton (1961), - | jouable entre autres + | Fortement inspiré par la variante Racing Kings inventée par Vernon R. + | Parton (1961), jouable entre autres a(href="https://lichess.org/variant/racingKings") sur lichess | , et également ici : voir la variante "Racingkings" :-) diff --git a/client/src/translations/rules/Schess/es.pug b/client/src/translations/rules/Schess/es.pug index ecac438a..f9a4e515 100644 --- a/client/src/translations/rules/Schess/es.pug +++ b/client/src/translations/rules/Schess/es.pug @@ -35,7 +35,6 @@ p | . Esta variante se puede jugar en a(href="https://www.pychess.org/variant/seirawan") pychess-variantes | con un módulo disponible para análisis. Ver también la - a(href= "https://www.pousseurdebois.fr/variantes-du-jeu-dechecs/echecsseirawan/") a(href="https://en.wikipedia.org/wiki/Seirawan_chess") página Wikipedia | . diff --git a/client/src/translations/rules/Shatranj/en.pug b/client/src/translations/rules/Shatranj/en.pug index ec346ef6..76a2ce8d 100644 --- a/client/src/translations/rules/Shatranj/en.pug +++ b/client/src/translations/rules/Shatranj/en.pug @@ -6,7 +6,8 @@ ul li General or vizir replace the orthodox queen. li The only special pawn move is the promotion, always to a vizir. li There is no castling option. - li Stalemate or bare king counts as a win, but two bare kings count as a draw. + li. + Stalemate or bare king counts as a win, but two bare kings count as a draw. p. Note: I didn't find nice images for general and elephants. Please tell me if you have some :) @@ -14,7 +15,8 @@ p. p | I implemented a slightly different version of Shatranj | as described for example - a(href="https://www.chessvariants.com/historic.dir/shatranj.html") on chessvariants.com + a(href="https://www.chessvariants.com/historic.dir/shatranj.html") + | on chessvariants.com | , because otherwise elephants could only evolve on a quarter of the board, | and the vizirs would be colorbound as well as the promoted pawns. @@ -28,8 +30,8 @@ ul li. Generals can move (without capturing) to any adjacent square horizontally or vertically. - They capture on any diagonally adjacent square, so that a general corresponds - to a natural pawn promotion. + They capture on any diagonally adjacent square, so that a general + corresponds to a natural pawn promotion. p All other pieces move like in orthodoxe chess. figure.diagram-container diff --git a/client/src/translations/rules/Shatranj/es.pug b/client/src/translations/rules/Shatranj/es.pug index a5a68d31..ae04c2ef 100644 --- a/client/src/translations/rules/Shatranj/es.pug +++ b/client/src/translations/rules/Shatranj/es.pug @@ -16,10 +16,11 @@ p. p | Implementé una versión ligeramente diferente de Shatranj como | descrito por ejemplo - a(href="https://www.chessvariants.com/historic.dir/shatranj.html") en chessvariants.com - | , porque de lo contrario los elefantes solo evolucionan en un cuarto de tablero, - | y los vizires (asà como los peones promocionados) solo viajan un medio tablero - | de ajedrez. + a(href="https://www.chessvariants.com/historic.dir/shatranj.html") + | en chessvariants.com + | , porque de lo contrario los elefantes solo evolucionan en un cuarto de + | tablero, y los vizires (asà como los peones promocionados) solo viajan un + | medio tablero de ajedrez. p. Entonces, al tratar de permanecer en el espÃritu de este antiguo juego, @@ -27,7 +28,8 @@ p. ul li. Los elefantes pueden mover una o dos cajas en diagonal. - Solo los saltos de dos cajas (posiblemente sobre una pieza) pueden capturar. + Solo los saltos de dos cajas (posiblemente sobre una pieza) pueden + capturar. li. Los generales se mueven (sin capturar) en cualquier casilla adyacente, horizontal o verticalmente. @@ -38,4 +40,5 @@ p Todas las otras piezas se mueven como en el ajedrez ortodoxo. figure.diagram-container .diagram | fen:2bkn3/7R/2qPP3/8/8/3n4/1r3r2/3K4: - figcaption Las blancas pueden mate en dos jugadas: vea la sección de problemas. + figcaption. + Las blancas pueden mate en dos jugadas: vea la sección de problemas. diff --git a/client/src/translations/rules/Shatranj/fr.pug b/client/src/translations/rules/Shatranj/fr.pug index 3029c3bf..caefd2de 100644 --- a/client/src/translations/rules/Shatranj/fr.pug +++ b/client/src/translations/rules/Shatranj/fr.pug @@ -16,9 +16,11 @@ p. p | J'ai implémenté une version légèrement différente du Shatranj telle que | décrite par exemple - a(href="https://www.chessvariants.com/historic.dir/shatranj.html") sur chessvariants.com + a(href="https://www.chessvariants.com/historic.dir/shatranj.html") + | sur chessvariants.com | , car sinon les éléphants n'évoluent que sur un quart d'échiquier, - | et les vizirs (ainsi que les pions promus) ne parcourent qu'un demi-échiquier. + | et les vizirs (ainsi que les pions promus) ne parcourent qu'un + | demi-échiquier. p. Donc, tout en essayant de rester dans l'esprit de ce jeu ancien, @@ -38,4 +40,5 @@ p Toutes les autres pièces se déplacent comme aux échecs orthodoxes. figure.diagram-container .diagram | fen:2bkn3/7R/2qPP3/8/8/3n4/1r3r2/3K4: - figcaption Les blancs peuvent mater en deux coups : voir la section problèmes. + figcaption. + Les blancs peuvent mater en deux coups : voir la section problèmes. diff --git a/client/src/translations/rules/Suicide/en.pug b/client/src/translations/rules/Suicide/en.pug index 8ece4861..a868b398 100644 --- a/client/src/translations/rules/Suicide/en.pug +++ b/client/src/translations/rules/Suicide/en.pug @@ -2,11 +2,13 @@ p.boxed | Win by losing all your pieces. Capture is mandatory. p. - The goal is to lose all pieces, or get stalemated like on the following diagram. - The king has no royal status: it can be taken as any other piece. + The goal is to lose all pieces, or get stalemated like on the following + diagram. The king has no royal status: it can be taken as any other piece. Thus, there is no castle rule, no checks. -p Captures are mandatory, but when several capturing moves are possible you can choose. +p. + Captures are mandatory, but when several capturing moves are possible you + can choose. figure.diagram-container .diagram @@ -17,7 +19,8 @@ h3 Special moves p. Castling is not possible, but en-passant captures are allowed. - Pawns may promote into king (so you can potentially have several kings on the board). + Pawns may promote into king (so you can potentially have several kings on + the board). h3 More information @@ -26,5 +29,6 @@ p | A starting point can be the a(href="https://en.wikipedia.org/wiki/Losing_Chess") Wikipedia page | . Note: this variant has several names, we choose here the same as - a(href="https://www.freechess.org/Help/HelpFiles/suicide_chess.html") on FICS + a(href="https://www.freechess.org/Help/HelpFiles/suicide_chess.html") + | on FICS | . diff --git a/client/src/translations/rules/Suicide/fr.pug b/client/src/translations/rules/Suicide/fr.pug index 5a5f735b..502bc878 100644 --- a/client/src/translations/rules/Suicide/fr.pug +++ b/client/src/translations/rules/Suicide/fr.pug @@ -7,7 +7,9 @@ p. Le roi n'a pas de statut particulier : il peut être capturé. Il n'y a pas de notion d'échec, et pas de roque. -p Les captures sont obligatoires, mais si plusieurs sont possibles vous pouvez choisir. +p. + Les captures sont obligatoires, mais si plusieurs sont possibles vous pouvez + choisir. figure.diagram-container .diagram @@ -24,10 +26,11 @@ p. h3 Plus d'information p - | Cette variante est très populaire, et est jouée en divers endroits sur internet. - | La + | Cette variante est très populaire, et est jouée en divers endroits sur + | internet. La a(href="https://en.wikipedia.org/wiki/Losing_Chess") page Wikipedia | est un point de départ possible. | Note : cette variante a plusieurs noms, nous choisisson ici le même que - a(href="https://www.freechess.org/Help/HelpFiles/suicide_chess.html") sur FICS + a(href="https://www.freechess.org/Help/HelpFiles/suicide_chess.html") + | sur FICS | . diff --git a/client/src/translations/rules/Synchrone/en.pug b/client/src/translations/rules/Synchrone/en.pug index 74322081..3344652e 100644 --- a/client/src/translations/rules/Synchrone/en.pug +++ b/client/src/translations/rules/Synchrone/en.pug @@ -48,5 +48,6 @@ p a(href="http://www.hexenspiel.de/engl/synchronous-chess/") Synchronous chess | , modified to allow en-passant captures | and disable the "exchange of captures" stage. - a(href="http://www.pion.ch/echecs/variante.php?jeu=synchro") Another description + a(href="http://www.pion.ch/echecs/variante.php?jeu=synchro") + | Another description | (in French). diff --git a/client/src/translations/rules/Synchrone/fr.pug b/client/src/translations/rules/Synchrone/fr.pug index 1d7fe61d..df48a123 100644 --- a/client/src/translations/rules/Synchrone/fr.pug +++ b/client/src/translations/rules/Synchrone/fr.pug @@ -46,8 +46,10 @@ figure.diagram-container h3 Source p - a(href="http://www.hexenspiel.de/engl/synchronous-chess/") Ãchecs synchronisés + a(href="http://www.hexenspiel.de/engl/synchronous-chess/") + | Ãchecs synchronisés | , modifés pour autoriser la prise en passant et annuler la phase | "d'échange de captures". - a(href="http://www.pion.ch/echecs/variante.php?jeu=synchro") Autre description + a(href="http://www.pion.ch/echecs/variante.php?jeu=synchro") + | Autre description | . diff --git a/client/src/translations/rules/Upsidedown/en.pug b/client/src/translations/rules/Upsidedown/en.pug index db673e5a..9c48e23b 100644 --- a/client/src/translations/rules/Upsidedown/en.pug +++ b/client/src/translations/rules/Upsidedown/en.pug @@ -4,7 +4,8 @@ p.boxed p. ...Only the initial position changes, but this makes a huge difference. In particular, castling would be rather pointless so it's disabled here. - En-passant captures are impossible because all pawns already reached 7th rank. + En-passant captures are impossible because all pawns already reached 7th + rank. h3 About the initial position @@ -30,5 +31,6 @@ h3 Source p | See for example the - a(href="https://www.chessvariants.com/diffsetup.dir/upside.html") Upside down chess + a(href="https://www.chessvariants.com/diffsetup.dir/upside.html") + | Upside down chess | page on chessvariants.com. diff --git a/client/src/translations/rules/Upsidedown/es.pug b/client/src/translations/rules/Upsidedown/es.pug index 80d76fdc..4d8e2c4f 100644 --- a/client/src/translations/rules/Upsidedown/es.pug +++ b/client/src/translations/rules/Upsidedown/es.pug @@ -3,17 +3,17 @@ p.boxed p. ...Solo cambia la posición inicial, pero es una gran diferencia. - En particular, el enroque no serÃa interesante y, por lo tanto, está deshabilitado aquÃ. - Las capturas en passant también son imposibles porque todos los peones - ya están en la 7ma fila. + En particular, el enroque no serÃa interesante y, por lo tanto, está + deshabilitado aquÃ. Las capturas en passant también son imposibles porque + todos los peones ya están en la 7ma fila. h3 Acerca de la posición inicial p. Una disposición de piezas completamente al azar puede permitir un mate en 3 con un caballo: es por eso que el rey siempre está al lado de a menos - un caballo al comienzo del juego. Esto le permite liberarse de jaques tan pronto - primer movimiento. + un caballo al comienzo del juego. Esto le permite liberarse de jaques tan + pronto primer movimiento. p. Para ilustrar este fenómeno, los blancos pueden mate en 3 en la posición @@ -26,11 +26,14 @@ figure.diagram-container | fen:R1BQKBNR/PPPPPPP/N7/8/8/8/pppppppp/rnbqkbrn c5,d3: figcaption Posición inicial estándar después de 1.Na6 -p Nota: en la posición inicial habitual, los reyes y los caballos no son vecinos. +p. + Nota: en la posición inicial habitual, los reyes y los caballos no son + vecinos. h3 Fuente p | Ver por ejemplo la página - a(href="https://www.chessvariants.com/diffsetup.dir/upside.html") ajedrez al revés + a(href="https://www.chessvariants.com/diffsetup.dir/upside.html") + | Ajedrez al revés | en chessvariants.com. diff --git a/client/src/translations/rules/Upsidedown/fr.pug b/client/src/translations/rules/Upsidedown/fr.pug index 0631994b..000cd315 100644 --- a/client/src/translations/rules/Upsidedown/fr.pug +++ b/client/src/translations/rules/Upsidedown/fr.pug @@ -1,5 +1,6 @@ p.boxed - | Les pions démarrent sur la 7eme rangée. Déplacez un cavalier pour en promouvoir un. + | Les pions démarrent sur la 7eme rangée. + | Déplacez un cavalier pour en promouvoir un. p. ...Seule la position de départ change, mais c'est une énorme différence. @@ -26,11 +27,14 @@ figure.diagram-container | fen:R1BQKBNR/PPPPPPP/N7/8/8/8/pppppppp/rnbqkbrn c5,d3: figcaption Standard initial position after 1.Na6 -p Note : dans la position initiale habituelle, rois et cavaliers ne sont pas voisins. +p. + Note : dans la position initiale habituelle, rois et cavaliers ne sont pas + voisins. h3 Source p | Voir par exemple la page - a(href="https://www.chessvariants.com/diffsetup.dir/upside.html") Ãchecs Upside down + a(href="https://www.chessvariants.com/diffsetup.dir/upside.html") + | Ãchecs à l'envers | sur chessvariants.com. diff --git a/client/src/translations/rules/Wildebeest/en.pug b/client/src/translations/rules/Wildebeest/en.pug index ef491cbf..7d9dd396 100644 --- a/client/src/translations/rules/Wildebeest/en.pug +++ b/client/src/translations/rules/Wildebeest/en.pug @@ -20,22 +20,23 @@ h3 Special moves p. Castling is possible as in orthodox 8x8 game. The white king move to c1 or j1 - (one square to the left of bottom-right corner) for large (resp. small) castle. - Same for black on the other side. + (one square to the left of bottom-right corner) for large (resp. small) + castle. Same for black on the other side. p. Promotion occurs when pawns reach last rank. They can only transform into a queen or a wildebeest. p. - Note: the castling rule is more restrictive than described in the original rules. - The game seems OK like that, but this may change in the future. + Note: the castling rule is more restrictive than described in the original + rules. The game seems OK like that, but this may change in the future. h3 Source p | The - a(href="https://www.chessvariants.com/large.dir/wildebeest.html") Wildebeest page + a(href="https://www.chessvariants.com/large.dir/wildebeest.html") + | Wildebeest page | on chessvariants.com. p Inventor: R. Wayne Schmittberger (1992) diff --git a/client/src/translations/rules/Wildebeest/es.pug b/client/src/translations/rules/Wildebeest/es.pug index 62d44623..76af898a 100644 --- a/client/src/translations/rules/Wildebeest/es.pug +++ b/client/src/translations/rules/Wildebeest/es.pug @@ -5,10 +5,10 @@ p.boxed p. Aparecen dos nuevas piezas en un tablero de 10x11: - el camello y el ñu, respectivamente señalaron C y W (según el término en inglés). - El camello se mueve como un caballo pero con un salto inicial más largo: - 3 casillas en lugar de 2 (luego una casilla en una dirección ortogonal). - El ñu combina los movimientos del caballo y el camello. + el camello y el ñu, respectivamente señalaron C y W (según el término en + inglés). El camello se mueve como un caballo pero con un salto inicial más + largo: 3 casillas en lugar de 2 (luego una casilla en una dirección + ortogonal). El ñu combina los movimientos del caballo y el camello. p Ganas dando jaque mate o pateando al rey contrario. @@ -21,8 +21,9 @@ h3 Movimientos especiales p. El enroque es posible como en un juego de ajedrez ortodoxo 8x8. - El rey blanco va a c1 o j1 (un cuadro a la izquierda de la esquina inferior derecha). - para un enroque grande (resp. pequeño). Lo mismo para las negras del otro lado. + El rey blanco va a c1 o j1 (un cuadro a la izquierda de la esquina inferior + derecha) para un enroque grande (resp. pequeño). Lo mismo para las negras + del otro lado. p Un peón en la última fila es promovido a dama o ñu solamente. @@ -34,7 +35,8 @@ h3 Fuente p | La - a(href="https://www.chessvariants.com/large.dir/wildebeest.html") Variante Wildebeest + a(href="https://www.chessvariants.com/large.dir/wildebeest.html") + | Variante Wildebeest | en chessvariants.com. p Inventor: R. Wayne Schmittberger (1992) diff --git a/client/src/translations/rules/Wildebeest/fr.pug b/client/src/translations/rules/Wildebeest/fr.pug index e500b64d..3736086c 100644 --- a/client/src/translations/rules/Wildebeest/fr.pug +++ b/client/src/translations/rules/Wildebeest/fr.pug @@ -5,10 +5,10 @@ p.boxed p. Deux nouvelles pièces font leur apparition sur un échiquier de taille 10x11 : - Le chameau et le gnou, respectivement notés C et W (d'après le terme anglais). - Le chameau se déplace comme un cavalier mais avec un saut initial plus long : - 3 cases au lieu de 2 (puis une case dans une direction orthogonale). - Le gnou cumule les déplacements du cavalier et du chameau. + Le chameau et le gnou, respectivement notés C et W (d'après le terme + anglais). Le chameau se déplace comme un cavalier mais avec un saut initial + plus long : 3 cases au lieu de 2 (puis une case dans une direction + orthogonale). Le gnou cumule les déplacements du cavalier et du chameau. p On gagne en matant ou en patant le roi adverse. @@ -24,17 +24,21 @@ p. Le roi blanc va en c1 ou j1 (une case à gauche du coin inférieur droit). pour un grand (resp. petit) roque. Pareil pour les noirs de l'autre côté. -p Un pion arrivé sur la dernière rangée se promeut en une dame ou un gnou seulement. +p. + Un pion arrivé sur la dernière rangée se promeut en une dame ou un gnou + seulement. p. - Note : la règle du roque est plus restrictive que celle décrite par les règles - originelles. Le jeu semble OK comme ça, mais cela pourrait changer un jour. + Note : la règle du roque est plus restrictive que celle décrite par les + règles originelles. Le jeu semble OK comme ça, mais cela pourrait changer un + jour. h3 Source p | La - a(href="https://www.chessvariants.com/large.dir/wildebeest.html") variante Wildebeest + a(href="https://www.chessvariants.com/large.dir/wildebeest.html") + | variante Wildebeest | sur chessvariants.com. p Inventeur : R. Wayne Schmittberger (1992) diff --git a/client/src/translations/rules/Wormhole/en.pug b/client/src/translations/rules/Wormhole/en.pug index a8e669bf..32b62876 100644 --- a/client/src/translations/rules/Wormhole/en.pug +++ b/client/src/translations/rules/Wormhole/en.pug @@ -44,9 +44,10 @@ p Win by checkmate or stalemate: if you can no longer move, you lose. h3 Source p - a(href="https://www.chessvariants.com/32turn.dir/wormhole.html") Wormhole chess + a(href="https://www.chessvariants.com/32turn.dir/wormhole.html") + | Wormhole chess | on chessvariants.com. - | I changed the pieces movements because I have a better feeling with the moves - | described earlier. It might evolve. + | I changed the pieces movements because I have a better feeling with the + | moves described earlier. It might evolve. p Inventor (with other pieces' movements): Fergus Duniho (2000) diff --git a/client/src/translations/rules/Wormhole/es.pug b/client/src/translations/rules/Wormhole/es.pug index e45de58b..f458f250 100644 --- a/client/src/translations/rules/Wormhole/es.pug +++ b/client/src/translations/rules/Wormhole/es.pug @@ -4,14 +4,15 @@ p.boxed | . p. - Como todas la casillas iniciales desaparecen, el tablero de ajedrez tiene exactamente - 64 - T casillas después de T turnos. La partida no puede exceder los 32 movimientos. - De hecho, puedes saltar sobre una casilla faltante, pero ya no se puede usar. - Los agujeros se indican con la letra 'x' en la cadena FEN. + Como todas la casillas iniciales desaparecen, el tablero de ajedrez tiene + exactamente 64 - T casillas después de T turnos. La partida no puede exceder + los 32 movimientos. De hecho, puedes saltar sobre una casilla faltante, pero + ya no se puede usar. Los agujeros se indican con la letra 'x' en la + cadena FEN. p. - En la situación del diagrama, el caballo negro puede ir a las casillas marcadas: - g5 y f6 son accesibles gracias a los agujeros en f4 y e5. + En la situación del diagrama, el caballo negro puede ir a las casillas + marcadas: g5 y f6 son accesibles gracias a los agujeros en f4 y e5. De hecho, el caballo primero se mueve de una casilla horizontalmente o verticalmente, luego diagonalmente "en la misma dirección". Esta es la única descripción válida en esta variante (las otras @@ -44,7 +45,8 @@ p Gana por mate o empate: si ya no puedes jugar, pierdes. h3 Fuente | La - a(href="https://www.chessvariants.com/32turn.dir/wormhole.html") variante Wormhole + a(href="https://www.chessvariants.com/32turn.dir/wormhole.html") + | variante Wormhole | en chessvariants.com. | Cambié los movimientos de las piezas porque las descritas aquà | Parece más adecuado. Esto podrÃa evolucionar. diff --git a/client/src/translations/rules/Wormhole/fr.pug b/client/src/translations/rules/Wormhole/fr.pug index 71084a99..cd8a7bfc 100644 --- a/client/src/translations/rules/Wormhole/fr.pug +++ b/client/src/translations/rules/Wormhole/fr.pug @@ -48,7 +48,8 @@ h3 Source p | La - a(href="https://www.chessvariants.com/32turn.dir/wormhole.html") variante Wormhole + a(href="https://www.chessvariants.com/32turn.dir/wormhole.html") + | variante Wormhole | sur chessvariants.com. | J'ai changé les déplacements des pièces car ceux décrits ici me | paraissent mieux adaptés. Ceci pourrait évoluer. diff --git a/client/src/translations/rules/Zen/en.pug b/client/src/translations/rules/Zen/en.pug index b338dd67..7ef9eb2c 100644 --- a/client/src/translations/rules/Zen/en.pug +++ b/client/src/translations/rules/Zen/en.pug @@ -24,7 +24,8 @@ figure.diagram-container .diagram | fen:r7/2n5/1q6/5k2/8/8/K7/8: figcaption. - The king cannot take on a8 because it's guarded by the knight: it's checkmate + The king cannot take on a8 because the square is guarded by the knight: + it's checkmate h3 Source diff --git a/client/src/translations/rules/Zen/es.pug b/client/src/translations/rules/Zen/es.pug index 825639e3..69e5f2b5 100644 --- a/client/src/translations/rules/Zen/es.pug +++ b/client/src/translations/rules/Zen/es.pug @@ -5,7 +5,8 @@ p.boxed figure.diagram-container .diagram | fen:r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R: - figcaption Después de 3.Bb5?? las negras pueden jugar 3...Nxb5 o 3...e5xf3 por ejemplo + figcaption. + Después de 3.Bb5?? las negras pueden jugar 3...Nxb5 o 3...e5xf3 por ejemplo h3 Fin de la partida @@ -17,7 +18,8 @@ figure.diagram-container figcaption El rey blanco puede tomar la torre p. - Sin embargo, y esta es la única excepción: el rey es atacado en el sentido del ajedrez ortodoxo. + Sin embargo, y esta es la única excepción: el rey es atacado en el sentido + del ajedrez ortodoxo. figure.diagram-container .diagram diff --git a/client/src/translations/rules/Zen/fr.pug b/client/src/translations/rules/Zen/fr.pug index 25bb172d..d6317668 100644 --- a/client/src/translations/rules/Zen/fr.pug +++ b/client/src/translations/rules/Zen/fr.pug @@ -5,7 +5,8 @@ p.boxed figure.diagram-container .diagram | fen:r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R: - figcaption Après 3.Bb5?? les noirs peuvent jouer 3...Nxb5 ou 3...e5xf3 par exemple + figcaption. + Après 3.Bb5?? les noirs peuvent jouer 3...Nxb5 ou 3...e5xf3 par exemple h3 Fin de la partie @@ -17,7 +18,8 @@ figure.diagram-container figcaption Le roi blanc peut prendre la tour p. - Cependant, et c'est la seule exception : le roi est attaqué au sens des échecs orthodoxes. + Cependant, et c'est la seule exception : le roi est attaqué au sens des + échecs orthodoxes. figure.diagram-container .diagram @@ -28,7 +30,8 @@ figure.diagram-container h3 Source p - | Très peu d'informations sur le web à propos de cette variante : j'ai trouvé + | Très peu d'informations sur le web à propos de cette variante : + | j'ai trouvé a(href="http://play.chessvariants.org/erf/ZenChess.html") cette page | et a(href="http://www.pathguy.com/chess/ZenChess.htm") celle-ci diff --git a/client/src/utils/alea.js b/client/src/utils/alea.js index 1f1d1460..1b112ef9 100644 --- a/client/src/utils/alea.js +++ b/client/src/utils/alea.js @@ -16,7 +16,7 @@ export function randInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } -// Inspired by https://github.com/jashkenas/underscore/blob/master/underscore.js +// Inspired by https://github.com/jashkenas/underscore export function sample(arr, n) { n = n || 1; let cpArr = arr.map(e => e); diff --git a/client/src/utils/compgameStorage.js b/client/src/utils/compgameStorage.js index a8bcaa2a..e30a69fb 100644 --- a/client/src/utils/compgameStorage.js +++ b/client/src/utils/compgameStorage.js @@ -15,7 +15,8 @@ function dbOperation(callback) { let DBOpenRequest = window.indexedDB.open("vchess_comp", 4); DBOpenRequest.onerror = function(event) { - alert(store.state.tr["Database error: stop private browsing, or update your browser"]); + alert(store.state.tr[ + "Database error: stop private browsing, or update your browser"]); callback("error", null); }; diff --git a/client/src/utils/gameStorage.js b/client/src/utils/gameStorage.js index 6b4c7113..62ad1fab 100644 --- a/client/src/utils/gameStorage.js +++ b/client/src/utils/gameStorage.js @@ -22,7 +22,8 @@ function dbOperation(callback) { let DBOpenRequest = window.indexedDB.open("vchess", 5); DBOpenRequest.onerror = function(event) { - alert(store.state.tr["Database error: stop private browsing, or update your browser"]); + alert(store.state.tr[ + "Database error: stop private browsing, or update your browser"]); callback("error", null); }; diff --git a/client/src/utils/notation.js b/client/src/utils/notation.js index 464b5eee..4402e269 100644 --- a/client/src/utils/notation.js +++ b/client/src/utils/notation.js @@ -1,12 +1,13 @@ // Take into account that the move may be a multi-move -export function getFullNotation(move) { +export function getFullNotation(move, type) { + if (!type) type = "notation"; if (Array.isArray(move)) { let notation = ""; for (let i=0; i<move.length; i++) - notation += move[i].notation + ","; + notation += move[i][type] + ","; // Remove last comma: return notation.slice(0,-1); } // Simple (usual) case - return move.notation; + return move[type]; } diff --git a/client/src/variants/Alice.js b/client/src/variants/Alice.js index 9eb0e878..e193bbd2 100644 --- a/client/src/variants/Alice.js +++ b/client/src/variants/Alice.js @@ -2,7 +2,8 @@ import { ChessRules } from "@/base_rules"; import { ArrayFun } from "@/utils/array"; // NOTE: alternative implementation, probably cleaner = use only 1 board -// TODO? atLeastOneMove() would be more efficient if rewritten here (less sideBoard computations) +// TODO? atLeastOneMove() would be more efficient if rewritten here +// (less sideBoard computations) export class AliceRules extends ChessRules { static get ALICE_PIECES() { return { @@ -37,7 +38,8 @@ export class AliceRules extends ChessRules { super.setOtherVariables(fen); const rows = V.ParseFen(fen).position.split("/"); if (this.kingPos["w"][0] < 0 || this.kingPos["b"][0] < 0) { - // INIT_COL_XXX won't be required if Alice kings are found (means 'king moved') + // INIT_COL_XXX won't be required if Alice kings are found + // (it means 'king moved') for (let i = 0; i < rows.length; i++) { let k = 0; //column index on board for (let j = 0; j < rows[i].length; j++) { @@ -80,7 +82,8 @@ export class AliceRules extends ChessRules { return sideBoard; } - // NOTE: castle & enPassant https://www.chessvariants.com/other.dir/alice.html + // NOTE: castle & enPassant + // https://www.chessvariants.com/other.dir/alice.html getPotentialMovesFrom([x, y], sideBoard) { const pieces = Object.keys(V.ALICE_CODES); const codes = Object.keys(V.ALICE_PIECES); @@ -109,8 +112,11 @@ export class AliceRules extends ChessRules { if (m.appear.length == 2) { // Castle: appear[i] must be an empty square on the other board for (let psq of m.appear) { - if (this.getSquareOccupation(psq.x, psq.y, 3 - mirrorSide) != V.EMPTY) + if ( + this.getSquareOccupation(psq.x, psq.y, 3 - mirrorSide) != V.EMPTY + ) { return false; + } } } else if (this.board[m.end.x][m.end.y] != V.EMPTY) { // Attempt to capture diff --git a/client/src/variants/Apocalypse.js b/client/src/variants/Apocalypse.js index ef10b3e1..abcfd703 100644 --- a/client/src/variants/Apocalypse.js +++ b/client/src/variants/Apocalypse.js @@ -377,10 +377,6 @@ export class ApocalypseRules extends ChessRules { } play(move) { - if (!this.states) this.states = []; - const stateFen = this.getFen(); - this.states.push(stateFen); - // Do not play on board (would reveal the move...) move.flags = JSON.stringify(this.aggregateFlags()); this.turn = V.GetOppCol(this.turn); @@ -410,10 +406,6 @@ export class ApocalypseRules extends ChessRules { this.turn = V.GetOppCol(this.turn); this.movesCount--; this.postUndo(move); - - const stateFen = this.getFen(); - if (stateFen != this.states[this.states.length-1]) debugger; - this.states.pop(); } postUndo(move) { diff --git a/client/src/variants/Ball.js b/client/src/variants/Ball.js index 85e33e61..0f84bae3 100644 --- a/client/src/variants/Ball.js +++ b/client/src/variants/Ball.js @@ -7,7 +7,7 @@ export class BallRules extends ChessRules { return Object.assign( {}, ChessRules.PawnSpecs, - { promotions: ChessRules.PawnSpecs.promotions.concat([V.CHAMPION]) } + { promotions: ChessRules.PawnSpecs.promotions.concat([V.PHOENIX]) } ); } @@ -15,8 +15,8 @@ export class BallRules extends ChessRules { return false; } - static get CHAMPION() { - return 'c'; + static get PHOENIX() { + return 'h'; } static get BALL() { @@ -38,7 +38,7 @@ export class BallRules extends ChessRules { 'b': 'd', 'q': 't', 'k': 'l', - 'c': 'h' + 'h': 'i' }; } @@ -50,13 +50,13 @@ export class BallRules extends ChessRules { 'd': 'b', 't': 'q', 'l': 'k', - 'h': 'c' + 'i': 'h' }; } static get PIECES() { return ChessRules.PIECES - .concat([V.CHAMPION]) + .concat([V.PHOENIX]) .concat(Object.keys(V.HAS_BALL_DECODE)) .concat(['a']); } @@ -105,7 +105,7 @@ export class BallRules extends ChessRules { let prefix = ""; const withPrefix = Object.keys(V.HAS_BALL_DECODE) - .concat([V.CHAMPION]) + .concat([V.PHOENIX]) .concat(['a']); if (withPrefix.includes(b[1])) prefix = "Ball/"; return prefix + b; @@ -173,16 +173,12 @@ export class BallRules extends ChessRules { return Object.assign( {}, ChessRules.steps, - // Add champion moves + // Add phoenix moves { - c: [ + h: [ [-2, -2], - [-2, 0], [-2, 2], - [0, -2], - [0, 2], [2, -2], - [2, 0], [2, 2], [-1, 0], [1, 0], @@ -258,8 +254,8 @@ export class BallRules extends ChessRules { // So base implementation is fine. getPotentialMovesFrom([x, y]) { - if (this.getPiece(x, y) == V.CHAMPION) - return this.getPotentialChampionMoves([x, y]); + if (this.getPiece(x, y) == V.PHOENIX) + return this.getPotentialPhoenixMoves([x, y]); return super.getPotentialMovesFrom([x, y]); } @@ -283,8 +279,8 @@ export class BallRules extends ChessRules { return moves; } - getPotentialChampionMoves(sq) { - return this.getSlideNJumpMoves(sq, V.steps[V.CHAMPION], "oneStep"); + getPotentialPhoenixMoves(sq) { + return this.getSlideNJumpMoves(sq, V.steps[V.PHOENIX], "oneStep"); } filterValid(moves) { @@ -321,10 +317,10 @@ export class BallRules extends ChessRules { return { p: 1, r: 3, - n: 4, + n: 3, b: 2, q: 5, - c: 4, + h: 3, a: 0 //ball: neutral }; } diff --git a/client/src/variants/Baroque.js b/client/src/variants/Baroque.js index 031ea72c..016f7b7b 100644 --- a/client/src/variants/Baroque.js +++ b/client/src/variants/Baroque.js @@ -87,7 +87,8 @@ export class BaroqueRules extends ChessRules { } return true; //immobilizer isn't neutralized } - // Chameleons can't be immobilized twice, because there is only one immobilizer + // Chameleons can't be immobilized twice, + // because there is only one immobilizer if (oppPiece == V.BISHOP && piece == V.IMMOBILIZER) return true; } } @@ -130,7 +131,9 @@ export class BaroqueRules extends ChessRules { const color = this.turn; const oppCol = V.GetOppCol(color); moves.forEach(m => { - if (!!byChameleon && m.start.x != m.end.x && m.start.y != m.end.y) return; //chameleon not moving as pawn + if (!!byChameleon && m.start.x != m.end.x && m.start.y != m.end.y) + // Chameleon not moving as pawn + return; // Try capturing in every direction for (let step of steps) { const sq2 = [m.end.x + 2 * step[0], m.end.y + 2 * step[1]]; @@ -224,10 +227,11 @@ export class BaroqueRules extends ChessRules { ) { continue; } - // last(thing), cur(thing) : stop if "cur" is our color, or beyond board limits, - // or if "last" isn't empty and cur neither. Otherwise, if cur is empty then - // add move until cur square; if cur is occupied then stop if !!byChameleon and - // the square not occupied by a leaper. + // last(thing), cur(thing) : stop if "cur" is our color, + // or beyond board limits, or if "last" isn't empty and cur neither. + // Otherwise, if cur is empty then add move until cur square; + // if cur is occupied then stop if !!byChameleon and the square not + // occupied by a leaper. let last = [i, j]; let cur = [i + step[0], j + step[1]]; let vanished = [new PiPo({ x: x, y: y, c: color, p: piece })]; @@ -416,9 +420,11 @@ export class BaroqueRules extends ChessRules { this.getColor(i, j) == color && this.getPiece(i, j) == V.ROOK ) { - if (this.isImmobilized([i, j])) return false; //because only one rook - // Can it reach a capturing square? - // Easy but quite suboptimal way (TODO): generate all moves (turn is OK) + if (this.isImmobilized([i, j])) + // Because only one rook: + return false; + // Can it reach a capturing square? Easy but quite suboptimal way + // (TODO: generate all moves (turn is OK)) const moves = this.getPotentialMovesFrom([i, j]); for (let move of moves) { if ( @@ -457,7 +463,8 @@ export class BaroqueRules extends ChessRules { return true; continue outerLoop; } - // [else] Our color, could be captured *if there was an empty space* + // [else] Our color, + // could be captured *if there was an empty space* if (this.board[i + step[0]][j + step[1]] != V.EMPTY) continue outerLoop; i -= step[0]; diff --git a/client/src/variants/Berolina.js b/client/src/variants/Berolina.js index b14b19e8..e5a222bb 100644 --- a/client/src/variants/Berolina.js +++ b/client/src/variants/Berolina.js @@ -62,7 +62,9 @@ export class BerolinaRules extends ChessRules { const startRank = color == "w" ? sizeX - 2 : 1; const lastRank = color == "w" ? 0 : sizeX - 1; const finalPieces = - x + shiftX == lastRank ? [V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN] : [V.PAWN]; + x + shiftX == lastRank + ? [V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN] + : [V.PAWN]; // One square diagonally for (let shiftY of [-1, 1]) { diff --git a/client/src/variants/Checkered.js b/client/src/variants/Checkered.js index bca365d0..79ea63c4 100644 --- a/client/src/variants/Checkered.js +++ b/client/src/variants/Checkered.js @@ -303,7 +303,8 @@ export class CheckeredRules extends ChessRules { } isAttackedByBishop(sq, colors) { - return this.isAttackedBySlideNJump(sq, colors, V.BISHOP, V.steps[V.BISHOP]); + return this.isAttackedBySlideNJump( + sq, colors, V.BISHOP, V.steps[V.BISHOP]); } isAttackedByQueen(sq, colors) { @@ -337,7 +338,7 @@ export class CheckeredRules extends ChessRules { "c" ]); let res = kingAttacked - ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! + ? [JSON.parse(JSON.stringify(this.kingPos[color]))] : []; this.turn = color; return res; diff --git a/client/src/variants/Circular.js b/client/src/variants/Circular.js index 73f87aaa..d1f8230b 100644 --- a/client/src/variants/Circular.js +++ b/client/src/variants/Circular.js @@ -35,8 +35,10 @@ export class CircularRules extends ChessRules { } static GenRandInitFen(randomness) { - if (randomness == 0) - return "8/8/pppppppp/rnbqkbnr/8/8/PPPPPPPP/RNBQKBNR w 0 1111111111111111"; + if (randomness == 0) { + return "8/8/pppppppp/rnbqkbnr/8/8/PPPPPPPP/RNBQKBNR " + + "w 0 1111111111111111"; + } let pieces = { w: new Array(8), b: new Array(8) }; // Shuffle pieces on first and last rank diff --git a/client/src/variants/Coregal.js b/client/src/variants/Coregal.js index 2e494070..43775bfd 100644 --- a/client/src/variants/Coregal.js +++ b/client/src/variants/Coregal.js @@ -140,8 +140,8 @@ export class CoregalRules extends ChessRules { pieces[c][bishop2Pos] = "b"; pieces[c][knight2Pos] = "n"; pieces[c][rook2Pos] = "r"; - flags += - [rook1Pos, queenPos, kingPos, rook2Pos].sort().map(V.CoordToColumn).join(""); + flags += [rook1Pos, queenPos, kingPos, rook2Pos] + .sort().map(V.CoordToColumn).join(""); } // Add turn + flags + enpassant return ( @@ -235,8 +235,18 @@ export class CoregalRules extends ChessRules { moves.push( new Move({ appear: [ - new PiPo({ x: x, y: finalSquares[castleSide][0], p: castlingPiece, c: c }), - new PiPo({ x: x, y: finalSquares[castleSide][1], p: V.ROOK, c: c }) + new PiPo({ + x: x, + y: finalSquares[castleSide][0], + p: castlingPiece, + c: c + }), + new PiPo({ + x: x, + y: finalSquares[castleSide][1], + p: V.ROOK, + c: c + }) ], vanish: [ new PiPo({ x: x, y: y, p: castlingPiece, c: c }), @@ -292,7 +302,8 @@ export class CoregalRules extends ChessRules { this.castleFlags[c][flagIdx] = 8; } else if ( move.end.x == oppFirstRank && //we took opponent rook? - [this.castleFlags[oppCol][0], this.castleFlags[oppCol][3]].includes(move.end.y) + [this.castleFlags[oppCol][0], this.castleFlags[oppCol][3]] + .includes(move.end.y) ) { const flagIdx = (move.end.y == this.castleFlags[oppCol][0] ? 0 : 3); this.castleFlags[oppCol][flagIdx] = 8; diff --git a/client/src/variants/Crazyhouse.js b/client/src/variants/Crazyhouse.js index 576f7d2b..a133b275 100644 --- a/client/src/variants/Crazyhouse.js +++ b/client/src/variants/Crazyhouse.js @@ -198,7 +198,8 @@ export class CrazyhouseRules extends ChessRules { postPlay(move) { super.postPlay(move); - if (move.vanish.length == 2 && move.appear.length == 2) return; //skip castle + // Skip castle: + if (move.vanish.length == 2 && move.appear.length == 2) return; const color = move.appear[0].c; if (move.vanish.length == 0) { this.reserve[color][move.appear[0].p]--; diff --git a/client/src/variants/Dark.js b/client/src/variants/Dark.js index 3bca2340..8f941762 100644 --- a/client/src/variants/Dark.js +++ b/client/src/variants/Dark.js @@ -37,16 +37,16 @@ export class DarkRules extends ChessRules { for (let i = 0; i < V.size.x; i++) { for (let j = 0; j < V.size.y; j++) { if (this.board[i][j] != V.EMPTY) { - const color = this.getColor(i, j); - this.enlightened[color][i][j] = true; + const c = this.getColor(i, j); + this.enlightened[c][i][j] = true; // Add potential squares visible by "impossible pawn capture" if (this.getPiece(i, j) == V.PAWN) { for (let shiftY of [-1, 1]) { if ( - V.OnBoard(i + pawnShift[color], j + shiftY) && - this.board[i + pawnShift[color]][j + shiftY] == V.EMPTY + V.OnBoard(i + pawnShift[c], j + shiftY) && + this.board[i + pawnShift[c]][j + shiftY] == V.EMPTY ) { - this.enlightened[color][i + pawnShift[color]][j + shiftY] = true; + this.enlightened[c][i + pawnShift[c]][j + shiftY] = true; } } } @@ -245,7 +245,8 @@ export class DarkRules extends ChessRules { const myPieceVal = V.VALUES[move.appear[0].p]; const hisPieceVal = V.VALUES[move.vanish[1].p]; // Favor captures - if (myPieceVal <= hisPieceVal) move.eval = hisPieceVal - myPieceVal + 1; + if (myPieceVal <= hisPieceVal) + move.eval = hisPieceVal - myPieceVal + 1; else { // Taking a pawn with minor piece, // or minor piece or pawn with a rook, diff --git a/client/src/variants/Dynamo.js b/client/src/variants/Dynamo.js index 4ec1927c..4d443eb5 100644 --- a/client/src/variants/Dynamo.js +++ b/client/src/variants/Dynamo.js @@ -66,7 +66,11 @@ export class DynamoRules extends ChessRules { // Now step in the other direction: if end of the world, then attacked rx = x - step[0]; ry = y - step[1]; - while (V.OnBoard(rx, ry) && this.board[rx][ry] == V.EMPTY && !oneStep) { + while ( + V.OnBoard(rx, ry) && + this.board[rx][ry] == V.EMPTY && + !oneStep + ) { rx -= step[0]; ry -= step[1]; } diff --git a/client/src/variants/Eightpieces.js b/client/src/variants/Eightpieces.js index 0f335184..4f487647 100644 --- a/client/src/variants/Eightpieces.js +++ b/client/src/variants/Eightpieces.js @@ -293,7 +293,8 @@ export class EightpiecesRules extends ChessRules { canIplay(side, [x, y]) { return ( - (this.subTurn == 1 && this.turn == side && this.getColor(x, y) == side) || + (this.subTurn == 1 && this.turn == side && this.getColor(x, y) == side) + || (this.subTurn == 2 && x == this.sentryPos.x && y == this.sentryPos.y) ); } @@ -795,8 +796,8 @@ export class EightpiecesRules extends ChessRules { case V.QUEEN: return sliderAttack(V.steps[V.ROOK].concat(V.steps[V.BISHOP])); case V.LANCER: { - // Special case: as long as no enemy units stands in-between, it attacks - // (if it points toward the king). + // Special case: as long as no enemy units stands in-between, + // it attacks (if it points toward the king). const allowedStep = V.LANCER_DIRS[this.board[x1][y1].charAt(1)]; return sliderAttack([allowedStep], "lancer"); } @@ -1043,7 +1044,8 @@ export class EightpiecesRules extends ChessRules { Object.keys(V.LANCER_DIRNAMES).includes(move.appear[0].p) ) { // Fix promotions in lancer: - notation = notation.slice(0, -1) + "L:" + V.LANCER_DIRNAMES[move.appear[0].p]; + notation = notation.slice(0, -1) + + "L:" + V.LANCER_DIRNAMES[move.appear[0].p]; } return notation; } diff --git a/client/src/variants/Enpassant.js b/client/src/variants/Enpassant.js index ee04cf4f..5ff4c956 100644 --- a/client/src/variants/Enpassant.js +++ b/client/src/variants/Enpassant.js @@ -41,7 +41,10 @@ export class EnpassantRules extends ChessRules { const divisor = Math.min(Math.abs(delta[0]), Math.abs(delta[1])); step = [delta[0]/divisor || 0, delta[1]/divisor || 0]; } else { - step = [delta[0]/Math.abs(delta[0]) || 0, delta[1]/Math.abs(delta[1]) || 0]; + step = [ + delta[0]/Math.abs(delta[0]) || 0, + delta[1]/Math.abs(delta[1]) || 0 + ]; } let res = []; for ( diff --git a/client/src/variants/Extinction.js b/client/src/variants/Extinction.js index 8c970682..bdea80b5 100644 --- a/client/src/variants/Extinction.js +++ b/client/src/variants/Extinction.js @@ -27,7 +27,7 @@ export class ExtinctionRules extends ChessRules { setOtherVariables(fen) { super.setOtherVariables(fen); const pos = V.ParseFen(fen).position; - // NOTE: no need for safety "|| []", because each piece type must be present + // NOTE: no need for safety "|| []", because each piece type is present // (otherwise game is already over!) this.material = { w: { @@ -107,7 +107,8 @@ export class ExtinctionRules extends ChessRules { return this.material[color][p] == 0; }) ) { - // Very negative (resp. positive) if white (reps. black) pieces set is incomplete + // Very negative (resp. positive) + // if white (reps. black) pieces set is incomplete return (color == "w" ? -1 : 1) * V.INFINITY; } return super.evalPosition(); diff --git a/client/src/variants/Grand.js b/client/src/variants/Grand.js index 0809a65d..e92896b8 100644 --- a/client/src/variants/Grand.js +++ b/client/src/variants/Grand.js @@ -328,9 +328,11 @@ export class GrandRules extends ChessRules { static GenRandInitFen(randomness) { if (randomness == 0) { - // No castling in the official initial setup - return "r8r/1nbqkmcbn1/pppppppppp/91/91/91/91/PPPPPPPPPP/1NBQKMCBN1/R8R " + - "w 0 zzzz - 00000000000000"; + return ( + "r8r/1nbqkmcbn1/pppppppppp/91/91/91/91/PPPPPPPPPP/1NBQKMCBN1/R8R " + + // No castling in the official initial setup + "w 0 zzzz - 00000000000000" + ); } let pieces = { w: new Array(10), b: new Array(10) }; @@ -378,7 +380,8 @@ export class GrandRules extends ChessRules { let cardinalPos = positions[randIndex]; positions.splice(randIndex, 1); - // Rooks and king positions are now fixed, because of the ordering rook-king-rook + // Rooks and king positions are now fixed, + // because of the ordering rook-king-rook let rook1Pos = positions[0]; let kingPos = positions[1]; let rook2Pos = positions[2]; diff --git a/client/src/variants/Hidden.js b/client/src/variants/Hidden.js index 2fcab249..98a8b453 100644 --- a/client/src/variants/Hidden.js +++ b/client/src/variants/Hidden.js @@ -205,9 +205,11 @@ export class HiddenRules extends ChessRules { pieces[c][rook2Pos] = "u"; } let upFen = pieces["b"].join(""); - upFen = upFen.substr(0,8) + "/" + upFen.substr(8).split("").reverse().join(""); + upFen = upFen.substr(0,8) + "/" + + upFen.substr(8).split("").reverse().join(""); let downFen = pieces["b"].join("").toUpperCase(); - downFen = downFen.substr(0,8) + "/" + downFen.substr(8).split("").reverse().join(""); + downFen = downFen.substr(0,8) + "/" + + downFen.substr(8).split("").reverse().join(""); return upFen + "/8/8/8/8/" + downFen + " w 0"; } @@ -255,9 +257,10 @@ export class HiddenRules extends ChessRules { if (move.vanish.length == 2 && move.vanish[1].c != color) { // OK this isn't a castling move const myPieceVal = V.VALUES[move.appear[0].p]; - const hisPieceVal = Object.keys(V.HIDDEN_DECODE).includes(move.vanish[1].p) - ? undefined - : V.VALUES[move.vanish[1].p]; + const hisPieceVal = + Object.keys(V.HIDDEN_DECODE).includes(move.vanish[1].p) + ? undefined + : V.VALUES[move.vanish[1].p]; if (!hisPieceVal) { // Opponent's piece is unknown: do not take too much risk move.eval = -myPieceVal + 1.5; //so that pawns always take @@ -276,7 +279,8 @@ export class HiddenRules extends ChessRules { // If no capture, favor small step moves, // but sometimes move the knight anyway const penalty = V.Decode(move.vanish[0].p) != V.KNIGHT - ? Math.abs(move.end.x - move.start.x) + Math.abs(move.end.y - move.start.y) + ? Math.abs(move.end.x - move.start.x) + + Math.abs(move.end.y - move.start.y) : (Math.random() < 0.5 ? 3 : 1); move.eval -= penalty / (V.size.x + V.size.y - 1); } diff --git a/client/src/variants/Knightrelay1.js b/client/src/variants/Knightrelay1.js index 4f9f7e35..626519cd 100644 --- a/client/src/variants/Knightrelay1.js +++ b/client/src/variants/Knightrelay1.js @@ -120,7 +120,8 @@ export class Knightrelay1Rules extends ChessRules { const finalSquare = V.CoordsToSquare(move.end); const piece = this.getPiece(move.start.x, move.start.y); - // Since pieces and pawns could move like knight, indicate start and end squares + // Since pieces and pawns could move like knight, + // indicate start and end squares let notation = piece.toUpperCase() + initSquare + diff --git a/client/src/variants/Knightrelay2.js b/client/src/variants/Knightrelay2.js index 0fc6c331..1827accb 100644 --- a/client/src/variants/Knightrelay2.js +++ b/client/src/variants/Knightrelay2.js @@ -101,7 +101,8 @@ export class Knightrelay2Rules extends ChessRules { const finalSquare = V.CoordsToSquare(move.end); const piece = this.getPiece(move.start.x, move.start.y); - // Since pieces and pawns could move like knight, indicate start and end squares + // Since pieces and pawns could move like knight, + // indicate start and end squares let notation = piece.toUpperCase() + initSquare + diff --git a/client/src/variants/Magnetic.js b/client/src/variants/Magnetic.js index ee9fe28a..9fc4180d 100644 --- a/client/src/variants/Magnetic.js +++ b/client/src/variants/Magnetic.js @@ -116,7 +116,8 @@ export class MagneticRules extends ChessRules { cmove.appear[i].p = piece; moves.push(cmove); } - // Swap appear[i] and appear[0] for moves presentation (TODO: this is awkward) + // Swap appear[i] and appear[0] for moves presentation + // (TODO: this is awkward) moves.forEach(m => { let tmp = m.appear[0]; m.appear[0] = m.appear[i]; @@ -169,7 +170,8 @@ export class MagneticRules extends ChessRules { psq.x == oppFirstRank && this.castleFlags[oppCol].includes(psq.y) ) { - this.castleFlags[oppCol][psq.y == this.castleFlags[oppCol][0] ? 0 : 1] = 8; + const flagIdx = (psq.y == this.castleFlags[oppCol][0] ? 0 : 1); + this.castleFlags[oppCol][flagIdx] = 8; } }); } diff --git a/client/src/variants/Recycle.js b/client/src/variants/Recycle.js index adaceb04..0579de7a 100644 --- a/client/src/variants/Recycle.js +++ b/client/src/variants/Recycle.js @@ -174,7 +174,8 @@ export class RecycleRules extends ChessRules { prePlay(move) { super.prePlay(move); - if (move.vanish.length == 2 && move.appear.length == 2) return; //skip castle + // Skip castle: + if (move.vanish.length == 2 && move.appear.length == 2) return; const color = this.turn; if (move.vanish.length == 0) this.reserve[color][move.appear[0].p]--; else if (move.vanish.length == 2 && move.vanish[1].c == color) diff --git a/client/src/variants/Schess.js b/client/src/variants/Schess.js index 07556a50..0d12b749 100644 --- a/client/src/variants/Schess.js +++ b/client/src/variants/Schess.js @@ -172,7 +172,8 @@ export class SchessRules extends ChessRules { ( m.appear.length == shift+1 || // Special castle case: is initial king square free? - ![m.appear[shift].y, m.appear[shift+1].y].includes(m.vanish[0].y) + ![m.appear[shift].y, m.appear[shift+1].y] + .includes(m.vanish[0].y) ) ) { let pMove = JSON.parse(JSON.stringify(m)); @@ -191,7 +192,8 @@ export class SchessRules extends ChessRules { if ( m.appear.length >= 2 + shift && m.vanish.length == 2 && - ![m.appear[shift].y, m.appear[shift+1].y].includes(m.vanish[1].y) + ![m.appear[shift].y, m.appear[shift+1].y] + .includes(m.vanish[1].y) ) { // Special castle case: rook flag was necessarily on let pMove = JSON.parse(JSON.stringify(m)); diff --git a/client/src/variants/Synchrone.js b/client/src/variants/Synchrone.js index eb82bb55..ad14e051 100644 --- a/client/src/variants/Synchrone.js +++ b/client/src/variants/Synchrone.js @@ -215,7 +215,7 @@ export class SynchroneRules extends ChessRules { let moveSet = {}; let moves = []; oppCaptureMoves.forEach(m => { - // If another opponent capture with same endpoint already processed, skip: + // If another opponent capture with same endpoint already processed, skip const mHash = "m" + m.end.x + m.end.y; if (!moveSet[mHash]) { moveSet[mHash] = true; @@ -226,7 +226,8 @@ export class SynchroneRules extends ChessRules { }; V.PlayOnBoard(this.board, justDisappear); // Can I take on [m.end.x, m.end.y] ? If yes, add to list: - this.getCaptures(m.end.x, m.end.y, color).forEach(cm => moves.push(cm)); + this.getCaptures(m.end.x, m.end.y, color) + .forEach(cm => moves.push(cm)); V.UndoOnBoard(this.board, justDisappear); } }); diff --git a/client/src/variants/Threechecks.js b/client/src/variants/Threechecks.js index f9fd4d46..175b1246 100644 --- a/client/src/variants/Threechecks.js +++ b/client/src/variants/Threechecks.js @@ -25,7 +25,7 @@ export class ThreechecksRules extends ChessRules { } getPpath(b) { - // TODO: !!this.checkFlags condition for printDiagram, but clearly not good. + // TODO: !!this.checkFlags condition for printDiagram, but it's not good. // This is just a temporary fix. if (b[1] == 'k' && !!this.checkFlags && this.checkFlags[b[0]] > 0) return "Threechecks/" + b[0] + 'k_' + this.checkFlags[b[0]]; diff --git a/client/src/variants/Wildebeest.js b/client/src/variants/Wildebeest.js index fe2a0c04..8664e5ed 100644 --- a/client/src/variants/Wildebeest.js +++ b/client/src/variants/Wildebeest.js @@ -245,8 +245,12 @@ export class WildebeestRules extends ChessRules { static GenRandInitFen(randomness) { if (!randomness) randomness = 2; - if (randomness == 0) - return "rnccwkqbbnr/ppppppppppp/92/92/92/92/92/92/PPPPPPPPPPP/RNBBQKWCCNR w 0 akak -"; + if (randomness == 0) { + return ( + "rnccwkqbbnr/ppppppppppp/92/92/92/92/92/92/PPPPPPPPPPP/RNBBQKWCCNR " + + "w 0 akak -" + ); + } let pieces = { w: new Array(11), b: new Array(11) }; let flags = ""; diff --git a/client/src/variants/Zen.js b/client/src/variants/Zen.js index 56e7108b..ff562d0a 100644 --- a/client/src/variants/Zen.js +++ b/client/src/variants/Zen.js @@ -145,7 +145,7 @@ export class ZenRules extends ChessRules { return "0-0"; } - // Translate initial square (because pieces may fly unusually in this variant!) + // Translate initial square (because pieces may fly unusually!) const initialSquare = V.CoordsToSquare(move.start); // Translate final square diff --git a/client/src/views/Analyse.vue b/client/src/views/Analyse.vue index 557a2df7..1605b584 100644 --- a/client/src/views/Analyse.vue +++ b/client/src/views/Analyse.vue @@ -50,7 +50,8 @@ export default { alertAndQuit: function(text, wrongVname) { // Soon after component creation, st.tr might be uninitialized. // Set a timeout to let a chance for the message to show translated. - const newUrl = "/variants" + (wrongVname ? "" : "/" + this.gameRef.vname); + const newUrl = + "/variants" + (wrongVname ? "" : "/" + this.gameRef.vname); setTimeout(() => { alert(this.st.tr[text] || text); this.$router.replace(newUrl); diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index ec4f2c98..fe55f743 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -332,7 +332,8 @@ export default { this.socketCloseListener = setInterval( () => { if (this.conn.readyState == 3) { - this.conn.removeEventListener("message", this.socketMessageListener); + this.conn.removeEventListener( + "message", this.socketMessageListener); this.conn = new WebSocket(this.connexionString); this.conn.addEventListener("message", this.socketMessageListener); } @@ -354,7 +355,7 @@ export default { this.loadVariantThenGame(game, () => socketInit(this.roomInit)); else // Live game stored remotely: need socket to retrieve it - // NOTE: the callback "roomInit" will be lost, so we don't provide it. + // NOTE: the callback "roomInit" will be lost, so it's not provided. // --> It will be given when receiving "fullgame" socket event. socketInit(() => { this.send("askfullgame"); }); }); @@ -666,7 +667,7 @@ export default { case "asklastate": // Sending informative last state if I played a move or score != "*" // If the game or moves aren't loaded yet, delay the sending: - // TODO: since socket init after game load, the game is supposedly ready + // TODO: socket init after game load, so the game is supposedly ready if (!this.game || !this.game.moves) this.lastateAsked = true; else this.sendLastate(data.from); break; @@ -703,7 +704,10 @@ export default { const moveColIdx = ["w", "b"].indexOf(movePlus.color); if (!receiveMyMove && !!this.game.mycolor) { // Notify opponent that I got the move: - this.send("gotmove", {data: movePlus.index, target: data.from}); + this.send( + "gotmove", + { data: movePlus.index, target: data.from } + ); // And myself if I'm elsewhere: if (!this.focus) { notify( @@ -728,7 +732,8 @@ export default { GameStorage.update(this.gameRef, { drawOffer: "" }); } } - this.$refs["basegame"].play(movePlus.move, "received", null, true); + this.$refs["basegame"].play( + movePlus.move, "received", null, true); this.game.clocks[moveColIdx] = movePlus.clock; this.processMove( movePlus.move, @@ -982,7 +987,8 @@ export default { } }, abortGame: function() { - if (!this.game.mycolor || !confirm(this.st.tr["Terminate game?"])) return; + if (!this.game.mycolor || !confirm(this.st.tr["Terminate game?"])) + return; this.gameOver("?", "Stop"); this.send("abort"); }, @@ -1001,9 +1007,10 @@ export default { const myIdx = game.players.findIndex(p => { return p.sid == this.st.user.sid || p.id == this.st.user.id; }); - const mycolor = [undefined, "w", "b"][myIdx + 1]; //undefined for observers - // Live games before 26/03/2020 don't have chat history. TODO: remove next line - if (!game.chats) game.chats = []; + // "mycolor" is undefined for observers + const mycolor = [undefined, "w", "b"][myIdx + 1]; + // Live games before 26/03/2020 don't have chat history: + if (!game.chats) game.chats = []; //TODO: remove line // Sort chat messages from newest to oldest game.chats.sort((c1, c2) => c2.added - c1.added); if (gtype == "corr") { @@ -1337,7 +1344,8 @@ export default { let sendMove = { move: filtered_move, index: origMovescount, - // color is required to check if this is my move (if several tabs opened) + // color is required to check if this is my move + // (if several tabs opened) color: moveCol, cancelDrawOffer: this.drawOffer == "" }; @@ -1468,7 +1476,8 @@ export default { if (!!callback) callback(); } else this.updateCorrGame(scoreObj, callback); - // Notify the score to main Hall. TODO: only one player (currently double send) + // Notify the score to main Hall. + // TODO: only one player (currently double send) this.send("result", { gid: this.game.id, score: score }); // Also to MyGames page (TODO: doubled as well...) this.notifyMyGames( diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 48fd68e6..57557d49 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -481,7 +481,8 @@ export default { }, removePresetChall: function(e, pchall) { e.stopPropagation(); - const pchallIdx = this.presetChalls.findIndex(pc => pc.index == pchall.index); + const pchallIdx = + this.presetChalls.findIndex(pc => pc.index == pchall.index); this.presetChalls.splice(pchallIdx, 1); localStorage.setItem("presetChalls", JSON.stringify(this.presetChalls)); }, @@ -544,7 +545,8 @@ export default { // This is meant to challenge people, thus the next 2 conditions: this.st.user.id > 0 && sid != this.st.user.sid && - Object.values(this.people[sid].tmpIds).some(v => v.focus && v.page == "/") + Object.values(this.people[sid].tmpIds) + .some(v => v.focus && v.page == "/") ); }, challenge: function(sid) { @@ -663,8 +665,9 @@ export default { } case "disconnect": case "gdisconnect": { - // If the user reloads the page twice very quickly (experienced with Firefox), - // the first reload won't have time to connect but will trigger a "close" event anyway. + // If the user reloads the page twice very quickly + // (experienced with Firefox), the first reload won't have time to + // connect but will trigger a "close" event anyway. // ==> Next check is required. if (!this.people[data.from[0]]) return; delete this.people[data.from[0]].tmpIds[data.from[1]]; @@ -683,7 +686,7 @@ export default { const gid = data.page.match(/[a-zA-Z0-9]+$/)[0]; // Corr games are always reachable: if (!gid.match(/^[0-9]+$/)) { - // Live games are reachable as long as someone is on the game page + // Live games are reachable if someone is on the game page if (Object.values(this.people).every(p => Object.values(p.tmpIds).every(v => v.page != data.page)) ) { @@ -759,9 +762,9 @@ export default { c.from.sid == this.st.user.sid && c.type == "live" ) .map(c => { - // NOTE: in principle, should only send targeted challenge to the target. - // But we may not know yet the identity of the target (just name), - // so cannot decide if data.from is the target or not. + // NOTE: in principle, should only send targeted challenge to the + // target. But we may not know yet the identity of the target + // (just name), so can't decide if data.from is the target. return { id: c.id, from: this.st.user.sid, @@ -792,7 +795,8 @@ export default { case "deletechallenge_s": { // NOTE: the challenge(s) may be already removed const cref = data.data; - if (!!cref.cid) ArrayFun.remove(this.challenges, c => c.id == cref.cid); + if (!!cref.cid) + ArrayFun.remove(this.challenges, c => c.id == cref.cid); else if (!!cref.sids) { cref.sids.forEach(s => { ArrayFun.remove( @@ -1050,7 +1054,7 @@ export default { name: this.st.user.name }; chall.added = Date.now(); - // NOTE: vname and type are redundant (can be deduced from cadence + vid) + // NOTE: vname and type are redundant (deduced from cadence + vid) chall.type = ctype; chall.vname = this.newchallenge.vname; this.challenges.push(chall); @@ -1099,9 +1103,13 @@ export default { name: this.st.user.name }; this.launchGame(c); - if (c.type == "live") + if (c.type == "live") { // Remove all live challenges of both players - this.send("deletechallenge_s", { data: { sids: [c.from.sid, c.seat.sid] } }); + this.send( + "deletechallenge_s", + { data: { sids: [c.from.sid, c.seat.sid] } } + ); + } else // Corr challenge: just remove the challenge this.send("deletechallenge_s", { data: { cid: c.id } }); diff --git a/client/src/views/MyGames.vue b/client/src/views/MyGames.vue index d1079ee4..3c3b9b5a 100644 --- a/client/src/views/MyGames.vue +++ b/client/src/views/MyGames.vue @@ -319,7 +319,7 @@ export default { GameStorage.getNext(this.cursor["live"], localGames => { const L = localGames.length; if (L > 0) { - // Add "-1" because IDBKeyRange.upperBound seems to include boundary + // Add "-1" because IDBKeyRange.upperBound includes boundary this.cursor["live"] = localGames[L - 1].created - 1; localGames.forEach(g => g.type = "live"); this.decorate(localGames); diff --git a/client/src/views/News.vue b/client/src/views/News.vue index dd3c84ef..97f0eb84 100644 --- a/client/src/views/News.vue +++ b/client/src/views/News.vue @@ -101,7 +101,7 @@ export default { }, adjustHeight: function() { const newsContent = document.getElementById("newsContent"); - // https://stackoverflow.com/questions/995168/textarea-to-resize-based-on-content-length + // https://stackoverflow.com/a/995374 newsContent.style.height = "1px"; newsContent.style.height = 10 + newsContent.scrollHeight + "px"; }, diff --git a/client/src/views/Problems.vue b/client/src/views/Problems.vue index 1884852a..270707d3 100644 --- a/client/src/views/Problems.vue +++ b/client/src/views/Problems.vue @@ -47,7 +47,7 @@ main .row(v-if="showOne") .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 #topPage - .button-group(v-if="st.user.id == curproblem.uid") + .button-group(v-if="canIedit(curproblem.uid)") button(@click="editProblem(curproblem)") {{ st.tr["Edit"] }} button(@click="deleteProblem(curproblem)") {{ st.tr["Delete"] }} span.vname {{ curproblem.vname }} @@ -81,6 +81,7 @@ main select#selectVariant(v-model="selectedVar") option( v-for="v in [emptyVar].concat(st.variants)" + v-if="!v.noProblems" :value="v.id" ) | {{ v.name }} @@ -152,6 +153,7 @@ export default { onlyMine: false, showOne: false, infoMsg: "", + admins: [1], //hard-coded for now. TODO game: { players: [{ name: "Problem" }, { name: "Problem" }], mode: "analyze" @@ -373,7 +375,12 @@ export default { data: { prob: this.curproblem }, success: (ret) => { if (edit) { - let editedP = this.problems["mine"].find(p => p.id == this.curproblem.id); + let editedP = this.problems["mine"] + .find(p => p.id == this.curproblem.id); + if (!editedP) + // I'm an admin and edit another user' problem + editedP = this.problems["others"] + .find(p => p.id == this.curproblem.id); this.copyProblem(this.curproblem, editedP); this.showProblem(editedP); } @@ -382,7 +389,8 @@ export default { newProblem.id = ret.id; newProblem.uid = this.st.user.id; newProblem.uname = this.st.user.name; - this.problems["mine"] = [newProblem].concat(this.problems["mine"]); + this.problems["mine"] = + [newProblem].concat(this.problems["mine"]); } document.getElementById("modalNewprob").checked = false; this.infoMsg = ""; @@ -390,6 +398,9 @@ export default { } ); }, + canIedit: function(puid) { + return this.admins.concat([puid]).includes(this.st.user.id); + }, editProblem: function(prob) { // prob.diag might correspond to some other problem or be empty: this.setDiagram(prob); //V is loaded at this stage diff --git a/server/db/create.sql b/server/db/create.sql index 533e0f24..7c361b47 100644 --- a/server/db/create.sql +++ b/server/db/create.sql @@ -3,7 +3,8 @@ create table Variants ( id integer primary key, name varchar unique, - description text + description text, + noProblems boolean ); create table Users ( diff --git a/server/db/populate.sql b/server/db/populate.sql index 0575a986..b00e874d 100644 --- a/server/db/populate.sql +++ b/server/db/populate.sql @@ -7,7 +7,7 @@ insert or ignore into Variants (name,description) values ('Antiking1', 'Keep antiking in check (v1)'), ('Antiking2', 'Keep antiking in check (v2)'), ('Antimatter', 'Dangerous collisions'), - ('Apocalypse', 'The end of the world'), + ('Apocalypse', 'The end of the world', true), ('Arena', 'Middle battle'), ('Atomic', 'Explosive captures'), ('Ball', 'Score a goal'), @@ -23,7 +23,7 @@ insert or ignore into Variants (name,description) values ('Coregal', 'Two royal pieces'), ('Crazyhouse', 'Captures reborn'), ('Cylinder', 'Neverending rows'), - ('Dark', 'In the shadow'), + ('Dark', 'In the shadow', true), ('Doublearmy', '64 pieces on the board'), ('Dynamo', 'Push and pull'), ('Eightpieces', 'Each piece is unique'), @@ -31,8 +31,8 @@ insert or ignore into Variants (name,description) values ('Extinction', 'Capture all of a kind'), ('Grand', 'Big board'), ('Grasshopper', 'Long jumps over pieces'), - ('Hidden', 'Unidentified pieces'), - ('Hiddenqueen', 'Queen disguised as a pawn'), + ('Hidden', 'Unidentified pieces', true), + ('Hiddenqueen', 'Queen disguised as a pawn', true), ('Knightmate', 'Mate the knight'), ('Knightrelay1', 'Move like a knight (v1)'), ('Knightrelay2', 'Move like a knight (v2)'), @@ -51,7 +51,7 @@ insert or ignore into Variants (name,description) values ('Shatranj', 'Ancient rules'), ('Suicide', 'Lose all pieces'), ('Suction', 'Attract opposite king'), - ('Synchrone', 'Play at the same time'), + ('Synchrone', 'Play at the same time', true), ('Threechecks', 'Give three checks'), ('Twokings', 'Two kings'), ('Upsidedown', 'Board upside down'), diff --git a/server/models/User.js b/server/models/User.js index ab826d91..edb3c06e 100644 --- a/server/models/User.js +++ b/server/models/User.js @@ -83,20 +83,22 @@ const UserModel = { // Set session token only if empty (first login) // NOTE: weaker security (but avoid to re-login everywhere after each logout) - // TODO: option would be to reset all tokens periodically, e.g. every 3 months + // TODO: option would be to reset all tokens periodically (every 3 months?) trySetSessionToken: function(id, cb) { db.serialize(function() { let query = "SELECT sessionToken " + "FROM Users " + "WHERE id = " + id; - db.get(query, (err,ret) => { + db.get(query, (err, ret) => { const token = ret.sessionToken || genToken(params.token.length); + const setSessionToken = + (!ret.sessionToken ? (", sessionToken = '" + token + "'") : ""); query = "UPDATE Users " + // Also empty the login token to invalidate future attempts "SET loginToken = NULL" + - (!ret.sessionToken ? (", sessionToken = '" + token + "'") : "") + " " + + setSessionToken + " " + "WHERE id = " + id; db.run(query); cb(token); diff --git a/server/sockets.js b/server/sockets.js index d00b3c89..e791293e 100644 --- a/server/sockets.js +++ b/server/sockets.js @@ -240,7 +240,8 @@ module.exports = function(wss) { case "rematchoffer": case "draw": // "newgame" message can provide a page (corr Game --> Hall) - notifyRoom(obj.page || page, obj.code, {data: obj.data}, obj.excluded); + notifyRoom( + obj.page || page, obj.code, {data: obj.data}, obj.excluded); break; case "rnewgame": @@ -336,8 +337,8 @@ module.exports = function(wss) { case "lastate": { const pg = obj.target[2] || page; //required for identity and game - // NOTE: if in game we ask identity to opponent still in Hall, - // but leaving Hall, clients[pg] or clients[pg][target] could be undefined + // NOTE: if in game we ask identity to opponent still in Hall, but + // leaving Hall, clients[pg] or clients[pg][target] could be undef. if (!!clients[pg] && !!clients[pg][obj.target[0]]) { send( clients[pg][obj.target[0]][obj.target[1]].socket, diff --git a/server/utils/access.js b/server/utils/access.js index 732353f2..6b8eac8d 100644 --- a/server/utils/access.js +++ b/server/utils/access.js @@ -6,7 +6,7 @@ module.exports = logged: function(req, res, next) { const callback = () => { if (!loggedIn) - res.json({errmsg: "Error: try to delete cookies"}); + res.json({ errmsg: "Error: try to delete cookies" }); else next(); }; let loggedIn = undefined; @@ -14,7 +14,7 @@ module.exports = loggedIn = false; callback(); } else { - UserModel.getOne("sessionToken", req.cookies.token, function(err, user) { + UserModel.getOne("sessionToken", req.cookies.token, (err, user) => { if (!!user) { req.userId = user.id; req.userName = user.name; @@ -33,25 +33,25 @@ module.exports = unlogged: function(req, res, next) { // Just a quick heuristic, which should be enough const loggedIn = !!req.cookies.token; - if (loggedIn) res.json({errmsg: "Error: try to delete cookies"}); + if (loggedIn) res.json({ errmsg: "Error: try to delete cookies" }); else next(); }, // Prevent direct access to AJAX results ajax: function(req, res, next) { - if (!req.xhr) res.json({errmsg: "Unauthorized access"}); + if (!req.xhr) res.json({ errmsg: "Unauthorized access" }); else next(); }, - // Check for errors before callback (continue page loading). TODO: better name. + // Check for errors before callback (continue page loading). (TODO: name?) checkRequest: function(res, err, out, msg, cb) { - if (!!err) res.json({errmsg: err.errmsg || err.toString()}); + if (!!err) res.json({ errmsg: err.errmsg || err.toString() }); else if ( !out || (Array.isArray(out) && out.length == 0) || (typeof out === "object" && Object.keys(out).length == 0) ) { - res.json({errmsg: msg}); + res.json({ errmsg: msg }); } else cb(); } } -- 2.44.0