Add Hamilton Chess
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 17 Apr 2020 17:16:30 +0000 (19:16 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 17 Apr 2020 17:16:30 +0000 (19:16 +0200)
TODO
client/public/images/pieces/Hamilton/hole.svg [new file with mode: 0644]
client/src/translations/en.js
client/src/translations/es.js
client/src/translations/fr.js
client/src/translations/rules/Hamilton/en.pug [new file with mode: 0644]
client/src/translations/rules/Hamilton/es.pug [new file with mode: 0644]
client/src/translations/rules/Hamilton/fr.pug [new file with mode: 0644]
client/src/variants/Hamilton.js [new file with mode: 0644]
server/db/populate.sql

diff --git a/TODO b/TODO
index 293d78a..cfc62fc 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,8 +1,7 @@
 Chakart :)
+https://www.chessvariants.com/d.betza/chessvar/trapdoor.html
 https://www.chessvariants.com/crossover.dir/koopachess.html
---> Can a stunned piece capture? Maybe not.
-Donkey pose une banane soit en début de coup soit à la fin, en diagonale, et explosion orthogonale.
-Wario pareil mais pose orthogonale et explosion diagonale.
+--> Can a stunned piece capture? Maybe not. ...recover? After 5 moves? Never?
 
 Diamond Chess [Rynd] (J. A.
 Porterfield Rynd, 1886)  --> Berolina2 ?
@@ -28,15 +27,6 @@ the NOST combination games. (Nost-algia
 150, also Nost-algia 112 ‘not seen’) 
 --> pourquoi pas, mais faudra pouvoir tracer des lignes sur plateau (Ball, Koth, Sittuyin, celle-là, Rococo)
 
-Contact (quoted by David Silverman, 1971).
-White puts a knight on any square of an empty
-chessboard. Black moves the knight and
-places a marker on the square vacated. Play
-alternates. The knight may only be moved to
-vacant squares. The object is to make the last
-move. The game can also be played with any
-of the other pieces. (Your Move)
-
 https://www.chessvariants.com/diffmove.dir/checkers.html --> move forward (Multhopp)
 in 1974 by Hans Multhopp
 https://www.chessvariants.com/diffmove.dir/checkers.html
diff --git a/client/public/images/pieces/Hamilton/hole.svg b/client/public/images/pieces/Hamilton/hole.svg
new file mode 100644 (file)
index 0000000..7c96145
--- /dev/null
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   id="Capa_1"
+   x="0px"
+   y="0px"
+   viewBox="0 0 198 198"
+   style="enable-background:new 0 0 198 198;"
+   xml:space="preserve"
+   sodipodi:docname="hole.svg"
+   inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
+   id="metadata39"><rdf:RDF><cc:Work
+       rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+         rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+   id="defs37" /><sodipodi:namedview
+   pagecolor="#ffffff"
+   bordercolor="#666666"
+   borderopacity="1"
+   objecttolerance="10"
+   gridtolerance="10"
+   guidetolerance="10"
+   inkscape:pageopacity="0"
+   inkscape:pageshadow="2"
+   inkscape:window-width="960"
+   inkscape:window-height="1060"
+   id="namedview35"
+   showgrid="false"
+   inkscape:zoom="1.1919192"
+   inkscape:cx="100.67797"
+   inkscape:cy="99"
+   inkscape:window-x="0"
+   inkscape:window-y="20"
+   inkscape:window-maximized="0"
+   inkscape:current-layer="Capa_1" />
+<path
+   d="m 183.0456,99.74245 c -8.4249,-19.9179 -25.902,-34.7193 -46.1268,-41.4675 4.8717,-0.6174 9.8019,-0.8343 14.7411,-0.6192 8.1585,0.3555 15.7176,2.1555 23.1705,4.5405 5.0418,1.6137 8.7804,-4.608 5.0292,-8.3439 -5.9256,-5.9004 -13.0572,-10.575 -20.9052,-13.7574 -20.0412,-8.1261 -42.8661,-6.2343 -61.938,3.294 3.0078,-3.8817 6.3414,-7.5204 9.9855,-10.8603 6.0201,-5.517 12.6387,-9.5904 19.5948,-13.1733 4.7061,-2.4246 2.9502,-9.4671 -2.3436,-9.4563 -8.3628,0.018 -16.7112,1.755 -24.5106,5.0544 -19.917,8.4258 -34.7193,25.9029 -41.4675,46.1277 -0.6174,-4.8717 -0.8343,-9.8019 -0.6183,-14.7411 0.3555,-8.1585 2.1555,-15.7176 4.5405,-23.1705 1.6137,-5.0418 -4.608,-8.7804 -8.3439,-5.0292 -5.9004,5.9256 -10.575,13.0572 -13.7574,20.9052 -8.1261,20.0412 -6.2343,42.8661 3.294,61.938 -3.8817,-3.0078 -7.5204,-6.3414 -10.8603,-9.9855 -5.517,-6.0201 -9.5904,-12.6378 -13.1733,-19.5948 -2.4246,-4.707 -9.4671,-2.9502 -9.4563,2.3436 0.018,8.3628 1.755,16.7112 5.0544,24.5106 8.4249,19.9179 25.902,34.7193 46.1259,41.4675 -4.8717,0.6174 -9.8019,0.8343 -14.7402,0.6183 -8.1585,-0.3555 -15.7176,-2.1555 -23.1705,-4.5405 -5.0418,-1.6137 -8.7804,4.608 -5.0292,8.3439 5.9256,5.9004 13.0572,10.575 20.9052,13.7574 20.0412,8.1261 42.8661,6.2343 61.938,-3.294 -3.0078,3.8817 -6.3414,7.5204 -9.9855,10.8603 -6.0201,5.517 -12.6378,9.5904 -19.5948,13.1733 -4.7061,2.4246 -2.9502,9.4671 2.3436,9.4563 8.3628,-0.018 16.7112,-1.755 24.5106,-5.0544 19.9179,-8.4249 34.7193,-25.9029 41.4675,-46.1268 0.6174,4.8717 0.8343,9.8019 0.6183,14.7411 -0.3555,8.1585 -2.1555,15.7176 -4.5405,23.1705 -1.6137,5.0418 4.608,8.7804 8.3439,5.0292 5.9004,-5.9256 10.575,-13.0581 13.7574,-20.9052 8.1261,-20.0412 6.2343,-42.8661 -3.294,-61.938 3.8817,3.0078 7.5204,6.3414 10.8603,9.9855 5.517,6.0201 9.5904,12.6378 13.1733,19.5948 2.4246,4.7061 9.4671,2.9502 9.4563,-2.3436 -0.018,-8.3628 -1.755,-16.7112 -5.0544,-24.5106 z M 99,120.52525 c -11.8881,0 -21.5253,-9.6372 -21.5253,-21.5253 0,-11.8881 9.6372,-21.5253 21.5253,-21.5253 11.8881,0 21.5253,9.6372 21.5253,21.5253 0,11.8881 -9.6372,21.5253 -21.5253,21.5253 z"
+   id="path2"
+   inkscape:connector-curvature="0"
+   style="stroke-width:0.89999998" />
+<g
+   id="g4">
+</g>
+<g
+   id="g6">
+</g>
+<g
+   id="g8">
+</g>
+<g
+   id="g10">
+</g>
+<g
+   id="g12">
+</g>
+<g
+   id="g14">
+</g>
+<g
+   id="g16">
+</g>
+<g
+   id="g18">
+</g>
+<g
+   id="g20">
+</g>
+<g
+   id="g22">
+</g>
+<g
+   id="g24">
+</g>
+<g
+   id="g26">
+</g>
+<g
+   id="g28">
+</g>
+<g
+   id="g30">
+</g>
+<g
+   id="g32">
+</g>
+<path
+   style="fill:#999999;fill-opacity:1;stroke-width:0.83898306"
+   d="m 70.895041,186.55484 c -0.784984,-0.78498 -1.427244,-2.48985 -1.427244,-3.78861 0,-2.09401 0.877565,-2.87091 7.750743,-6.86168 5.432389,-3.15421 10.254005,-6.93538 16.119667,-12.64124 4.602904,-4.47751 8.157093,-8.35275 7.898193,-8.61165 -0.25889,-0.25889 -2.544156,0.47853 -5.078371,1.63873 -9.305218,4.26007 -16.875192,5.71884 -30.046165,5.79002 -10.226677,0.0553 -13.20613,-0.23362 -18.697119,-1.81293 -8.501639,-2.4452 -18.230637,-7.42138 -24.430027,-12.49543 -6.043395,-4.94638 -6.930247,-6.89478 -4.52822,-9.94846 1.921429,-2.4427 1.401459,-2.45881 11.998587,0.37165 7.326475,1.95689 22.584749,3.17906 27.702534,2.21896 l 3.221454,-0.60435 -7.658666,-3.63945 C 40.699294,129.98266 31.972256,123.21491 24.678911,113.64894 16.16961,102.48811 11.033183,89.300005 10.597267,77.493418 c -0.227213,-6.153955 0.812914,-8.025621 4.460015,-8.025621 2.009558,0 2.834283,0.680745 4.721424,3.897162 5.758815,9.815246 9.389825,14.639623 15.918224,21.149905 3.86564,3.854909 7.215585,6.821766 7.444323,6.593036 0.228737,-0.22874 -0.560026,-2.734553 -1.752807,-5.56847 -7.458211,-17.719925 -7.66575,-40.725145 -0.517587,-57.373386 3.187811,-7.424487 11.325005,-18.675585 14.841842,-20.521449 1.948257,-1.022571 5.195616,0.0659 5.933516,1.988837 0.292082,0.761152 -0.293809,4.640031 -1.30198,8.619732 -2.562186,10.114096 -3.614212,19.604367 -2.968635,26.7799 0.302853,3.366194 0.754908,5.916086 1.004567,5.666428 0.249658,-0.249658 1.45813,-2.834168 2.685493,-5.743355 10.563486,-25.03836 35.501061,-43.515056 59.882188,-44.36778 4.83042,-0.168943 5.94289,0.05503 6.92161,1.393494 2.64593,3.618537 1.66958,5.065063 -6.78611,10.054045 -3.68157,2.172181 -9.05042,5.861485 -11.93078,8.198453 -5.14314,4.172849 -12.510331,12.153651 -11.838968,12.825014 0.187815,0.187818 2.685778,-0.605416 5.551028,-1.762742 10.42342,-4.210202 17.42509,-5.548961 29.1074,-5.565499 12.91029,-0.01827 20.61218,1.681064 31.04238,6.84917 7.64993,3.7905 15.99475,10.065865 17.35486,13.050989 0.73021,1.602633 0.63158,2.464177 -0.47553,4.153842 -1.71738,2.621057 -2.37284,2.627523 -12.28416,0.12118 -9.44938,-2.389525 -20.44298,-3.327507 -26.82822,-2.289003 -3.7916,0.61667 -4.26345,0.863725 -2.64617,1.385505 4.67477,1.508223 15.23304,7.197888 20.26481,10.920341 17.13713,12.677895 27.19927,29.867931 29.03317,49.599944 0.49726,5.35034 0.37525,6.11256 -1.2365,7.7243 -2.17086,2.17087 -4.46465,2.29102 -6.10873,0.31998 -0.67357,-0.80752 -3.09172,-4.65125 -5.37368,-8.54162 -3.97676,-6.77975 -17.37702,-21.871513 -19.42012,-21.871513 -0.50104,0 0.0414,2.304888 1.23419,5.243643 10.70874,26.38513 6.58712,56.00406 -10.34261,74.32464 -3.68478,3.98749 -4.53829,4.51873 -6.47791,4.03191 -3.91652,-0.98298 -4.20904,-2.93301 -1.80548,-12.03633 2.34498,-8.88148 3.68845,-26.69674 2.28654,-30.32093 -0.68277,-1.76508 -0.99774,-1.35868 -3.10016,4.00003 -9.62322,24.52798 -33.61184,42.90097 -58.852567,45.07543 -4.905288,0.42257 -6.157264,0.26605 -7.341102,-0.91779 z M 107.64153,119.0791 c 10.4781,-4.77649 15.39057,-15.86277 12.01757,-27.120816 -1.24792,-4.165198 -6.61017,-10.306063 -10.91866,-12.504091 -4.83585,-2.467069 -10.425428,-2.892061 -16.149859,-1.227925 -12.631799,3.672164 -19.12978,18.766155 -13.136388,30.514172 2.062975,4.04377 8.270694,9.6535 12.007599,10.85091 4.508833,1.44477 12.437288,1.19375 16.179738,-0.51225 z"
+   id="path3744"
+   inkscape:connector-curvature="0" /><path
+   style="fill:#000000;fill-opacity:1;stroke-width:0.83898306"
+   d="m 89.549849,117.49958 c -12.833757,-6.50866 -15.5203,-23.173196 -5.371883,-33.321614 13.244281,-13.244281 35.678404,-3.785372 35.610384,15.014425 -0.0224,6.197719 -1.92768,10.647809 -6.38368,14.910289 -6.5671,6.2819 -15.623346,7.5715 -23.854821,3.3969 z"
+   id="path3746"
+   inkscape:connector-curvature="0" /><path
+   style="fill:#666666;fill-opacity:1;stroke-width:0.83898306"
+   d="m 70.26798,184.72591 c -1.095088,-2.88029 -0.369958,-3.69637 8.194063,-9.22174 6.612494,-4.26627 23.659917,-19.96695 22.710507,-20.91637 -0.4536,-0.4536 -11.602022,3.67222 -12.408143,4.59203 -0.230721,0.26325 -1.174576,0.53333 -2.097458,0.60017 -0.922881,0.0669 -4.84863,0.5833 -8.723887,1.1477 -3.989425,0.58103 -11.26838,0.85915 -16.779661,0.64112 -11.345188,-0.4488 -19.261065,-2.72948 -29.360221,-8.45909 -6.229944,-3.53448 -14.352333,-10.36434 -14.352333,-12.06844 0,-0.50217 0.705814,-1.78467 1.568476,-2.85001 l 1.568475,-1.93698 8.289576,1.95122 c 9.147929,2.15326 29.97973,3.45433 31.46866,1.96539 0.551555,-0.55155 -1.309346,-1.85063 -5.505722,-3.84347 -25.443489,-12.08306 -40.73621,-31.99548 -43.70751,-56.910861 -0.656735,-5.506946 -0.07847,-7.931541 2.17995,-9.140208 2.4998,-1.337853 4.366636,0.163755 8.176657,6.576968 1.885692,3.17409 4.530328,6.95055 5.87697,8.392135 1.346641,1.441585 2.320678,2.748824 2.164526,2.904978 -0.156154,0.156152 2.713753,3.264 6.37757,6.906328 3.663816,3.642327 6.886703,6.3972 7.161972,6.12192 0.275267,-0.27527 -0.826696,-4.408104 -2.44881,-9.184082 C 34.04983,72.645277 34.673693,52.315901 42.336353,36.118366 44.810196,30.889092 52.404927,20.4923 55.161328,18.561641 c 1.511232,-1.058507 2.283983,-1.123949 4.006166,-0.33927 2.04462,0.931591 2.107445,1.172384 1.503731,5.763478 -0.346521,2.635198 -0.679919,5.546354 -0.740885,6.469236 -0.06097,0.922881 -0.411426,1.899785 -0.778799,2.170898 -0.367373,0.271112 -0.804942,2.347595 -0.972377,4.614407 -0.167434,2.266811 -0.54384,4.719346 -0.836456,5.450079 -0.292616,0.730733 -0.42136,4.501981 -0.286098,8.380552 0.199212,5.712257 0.504447,7.101312 1.60672,7.311799 0.929754,0.177544 1.813082,-0.88252 2.788694,-3.346653 2.421802,-6.116815 8.884645,-15.771992 14.643496,-21.876678 11.70863,-12.411763 26.96569,-20.373449 42.16005,-22.000626 6.3692,-0.682083 8.73294,-0.160291 10.00015,2.207519 1.23642,2.310272 0.26403,3.300483 -9.62186,9.798235 -10.77913,7.084859 -22.839354,18.375655 -21.286522,19.92848 0.180968,0.180975 4.081362,-0.964633 8.667552,-2.545796 19.45596,-6.70778 39.80138,-5.93113 55.96907,2.13652 11.41177,5.694451 18.59213,11.680479 18.08897,15.080169 -0.53053,3.584583 -2.4282,3.848482 -12.63126,1.756565 -5.20364,-1.066893 -9.8387,-1.84808 -10.30014,-1.735968 -0.46145,0.112111 -1.47164,-0.0745 -2.24488,-0.414692 -1.18897,-0.523097 -13.11,-0.211716 -16.4225,0.428963 -2.03616,0.393819 -0.88319,1.222916 7.28907,5.24156 23.63276,11.621211 39.31388,32.916607 40.9118,55.559352 0.54595,7.73624 -0.15543,9.59684 -3.61768,9.59684 -1.58791,0 -3.09509,-1.68946 -7.53942,-8.45119 -3.05512,-4.64816 -6.07999,-8.65275 -6.72193,-8.89909 -0.64195,-0.24634 -1.16718,-0.88955 -1.16718,-1.42936 0,-1.41804 -11.58293,-12.705221 -12.30112,-11.987034 -0.33163,0.331624 0.5904,4.275074 2.04894,8.763204 3.7364,11.49744 4.66195,18.10493 4.18712,29.8917 -0.34281,8.50941 -0.84124,11.43077 -3.08385,18.07476 -6.98372,20.69021 -22.34362,34.82298 -21.6554,19.92531 0.0998,-2.16011 0.50862,-3.9301 0.90852,-3.93331 0.3999,-0.003 0.52963,-0.76092 0.28829,-1.6838 -0.24134,-0.92288 -0.0526,-1.67797 0.41949,-1.67797 0.47207,0 0.66093,-0.75471 0.41971,-1.67713 -0.24121,-0.92242 -0.0924,-1.8911 0.33077,-2.15261 0.83859,-0.51828 0.83335,-0.44223 1.03315,-14.97599 0.0831,-6.04433 -0.19426,-10.10636 -0.70155,-10.27455 -0.46144,-0.15298 -1.89764,2.30331 -3.19154,5.45842 -9.90869,24.16165 -36.727818,43.75745 -59.887159,43.75745 -4.990039,0 -5.394746,-0.14413 -6.176201,-2.19951 z m 38.41283,-65.89423 c 4.42187,-2.0919 9.68588,-7.95901 10.93628,-12.18923 1.49606,-5.06136 0.87521,-14.465172 -1.18169,-17.898271 -0.96096,-1.603918 -2.17815,-2.821827 -2.70486,-2.706467 -0.52672,0.11536 -0.95766,-0.368734 -0.95766,-1.075764 0,-0.707031 -0.73256,-1.556502 -1.6279,-1.887712 -0.89536,-0.331211 -1.55606,-0.958583 -1.46822,-1.394159 0.30685,-1.521821 -5.34258,-3.985965 -10.12259,-4.415224 -5.473663,-0.491554 -12.328585,0.980687 -11.418973,2.452471 0.388705,0.628937 0.08292,0.75072 -0.919313,0.366128 -2.137619,-0.820282 -9.952714,6.994813 -9.132432,9.132432 0.37152,0.968166 0.256557,1.304154 -0.323557,0.945624 -1.335344,-0.825288 -2.741251,4.024978 -2.741251,9.457099 0,5.117373 2.927543,12.392073 4.832388,12.008083 0.572271,-0.11536 1.050981,0.26219 1.063799,0.83899 0.03092,1.39138 3.963346,5.11863 7.10805,6.73719 3.794914,1.95323 14.181339,1.74659 18.657929,-0.37119 z M 58.980508,60.238983 C 59.265695,59.777542 59.099204,59.4 58.610531,59.4 c -0.488673,0 -0.888497,0.377542 -0.888497,0.838983 0,0.461441 0.166489,0.838983 0.369977,0.838983 0.203488,0 0.603311,-0.377542 0.888497,-0.838983 z"
+   id="path3748"
+   inkscape:connector-curvature="0" /><path
+   style="fill:#666666;fill-opacity:1;stroke-width:0.83898306"
+   d="m 74.847952,186.97343 c -5.687254,-1.35962 -6.009892,-3.48815 -1.18524,-7.81933 1.845763,-1.65697 3.355932,-2.76509 3.355932,-2.46247 0,0.30261 0.84947,-0.29176 1.887712,-1.32082 1.038241,-1.02906 3.964195,-3.43408 6.502119,-5.34448 5.873496,-4.42123 9.533381,-7.83532 12.845417,-11.98274 2.596298,-3.25116 2.603328,-3.28523 0.555223,-2.69076 -1.1409,0.33116 -3.010188,0.79774 -4.153957,1.03686 -1.143777,0.23911 -2.365005,0.88363 -2.713848,1.43228 -0.348843,0.54863 -0.640041,0.70566 -0.647107,0.34895 -0.007,-0.35672 -0.879347,-0.0808 -1.938402,0.61309 -1.059055,0.69392 -3.985009,1.43897 -6.502119,1.65566 -8.907799,0.76686 -30.165963,0.88648 -30.165756,0.16972 1.15e-4,-0.39986 -0.943646,-0.54661 -2.097248,-0.32608 -1.153602,0.22052 -2.097458,0.11778 -2.097458,-0.22832 0,-0.6113 -5.658394,-2.0797 -6.92161,-1.79621 -0.34608,0.0777 -0.629237,-0.1954 -0.629237,-0.60681 0,-0.7297 -3.990537,-2.18062 -5.243644,-1.90655 -0.346081,0.0757 -0.629237,-0.26219 -0.629237,-0.75087 0,-0.48867 -0.345297,-0.67509 -0.767326,-0.41426 -0.422029,0.26083 -0.893957,0.18165 -1.048729,-0.17595 -0.154771,-0.3576 -2.735429,-2.398 -5.734793,-4.53424 -2.999364,-2.13623 -6.474561,-4.96357 -7.72266,-6.28298 l -2.269271,-2.3989 1.736681,-2.7429 c 1.3727,-2.16804 1.977941,-2.54267 2.887823,-1.78754 0.633129,0.52545 1.722265,0.73621 2.420302,0.46834 0.698037,-0.26786 1.269159,-0.0804 1.269159,0.41659 0,0.5449 0.832621,0.69463 2.097458,0.37718 1.153601,-0.28954 2.097457,-0.18163 2.097457,0.23978 0,0.42142 0.849471,0.74836 1.887712,0.72655 1.038242,-0.0218 5.100349,0.39499 9.026905,0.92624 6.531724,0.88372 19.288773,1.04472 19.288773,0.24344 0,-0.18491 -0.812852,-1.04118 -1.806339,-1.90283 -1.69744,-1.47218 -2.795172,-1.89984 -4.276288,-1.66598 -0.346081,0.0546 -0.629237,-0.30048 -0.629237,-0.78915 0,-0.48867 -0.377543,-0.65516 -0.838983,-0.36997 -0.461441,0.28518 -0.838983,0.0964 -0.838983,-0.4195 0,-0.5159 -0.377543,-0.70467 -0.838984,-0.41949 -0.46144,0.28519 -0.838983,0.0964 -0.838983,-0.41949 0,-0.51591 -0.345296,-0.7246 -0.767325,-0.46378 -0.422029,0.26083 -0.893957,0.16254 -1.048729,-0.21842 -0.154771,-0.38097 -2.61394,-2.26669 -5.464818,-4.1905 -5.175428,-3.49246 -18.426704,-15.23796 -17.251088,-15.2908 0.341519,-0.0154 -0.212472,-0.72357 -1.231091,-1.57382 -1.018619,-0.85024 -1.625281,-1.77265 -1.348138,-2.04979 0.277143,-0.27715 -0.114286,-0.74112 -0.869842,-1.03106 -0.755556,-0.28992 -1.200191,-0.80795 -0.988078,-1.15116 0.212114,-0.34321 -0.333634,-1.39608 -1.212771,-2.33973 -0.879138,-0.94363 -1.369472,-1.94467 -1.089632,-2.22451 0.27984,-0.27984 0.04605,-0.5088 -0.519527,-0.5088 -0.56558,0 -0.794994,-0.37754 -0.509808,-0.83898 0.285186,-0.46145 0.09642,-0.83899 -0.419492,-0.83899 -0.515906,0 -0.704677,-0.37754 -0.419491,-0.83898 0.285186,-0.46144 0.199039,-0.838984 -0.191438,-0.838984 -0.390477,0 -0.771388,-0.815499 -0.846469,-1.81222 -0.07508,-0.996728 -0.43858,-2.03497 -0.807776,-2.307203 -0.369197,-0.272242 -0.776777,-1.438839 -0.905734,-2.592441 -0.128958,-1.153602 -0.560807,-2.209945 -0.959664,-2.34743 -0.398858,-0.137485 -0.532471,-0.986955 -0.296918,-1.887712 0.235553,-0.900756 0.01855,-1.637739 -0.482225,-1.637739 -0.500777,0 -0.700126,-0.548235 -0.442998,-1.218299 0.257127,-0.670063 0.182564,-1.679341 -0.165696,-2.242838 -0.980394,-1.586311 -0.57179,-10.787284 0.538459,-12.125052 0.544771,-0.65641 1.545415,-1.193472 2.223652,-1.193472 1.383531,0 4.826883,2.487316 5.226562,3.775423 0.72724,2.343794 1.126695,2.886507 1.812565,2.462616 0.413088,-0.255302 0.75107,0.272787 0.75107,1.173532 0,0.900746 0.590243,1.864216 1.311651,2.141046 0.721408,0.276831 1.101119,0.843976 0.843802,1.260324 -0.257318,0.416348 0.150332,0.994215 0.905889,1.284149 0.755555,0.289934 1.162391,0.738499 0.904078,0.996811 -0.258312,0.258312 0.07539,1.098896 0.741568,1.867963 4.849691,5.598747 7.155987,7.974924 10.96306,11.295234 2.389077,2.083623 4.088018,4.073232 3.775424,4.421352 -0.312595,0.34812 -0.09541,0.36073 0.482644,0.028 0.702977,-0.40461 0.799827,-1.074235 0.29248,-2.022227 -0.417185,-0.779516 -0.795748,-1.700459 -0.841252,-2.04654 -0.04551,-0.34608 -0.11378,-0.723623 -0.151724,-0.838983 -0.03795,-0.11536 -0.237288,-1.230486 -0.442984,-2.478053 -0.205698,-1.247569 -0.929737,-3.843448 -1.608977,-5.768618 -0.67924,-1.925163 -1.234981,-4.20792 -1.234981,-5.072786 0,-0.864866 -0.342197,-1.572484 -0.760438,-1.572484 -0.418241,0 -0.564454,-0.749442 -0.324919,-1.665428 0.239536,-0.915986 0.177814,-2.33177 -0.137158,-3.146186 -0.867034,-2.241866 -0.585752,-20.287239 0.379328,-24.335472 0.46653,-1.956958 0.786134,-3.84467 0.710231,-4.194916 -0.0759,-0.350247 0.289913,-1.671774 0.812923,-2.936729 0.52301,-1.264955 0.712594,-2.963895 0.421297,-3.775424 -0.295255,-0.822555 -0.204905,-1.178995 0.204169,-0.805466 0.609587,0.556621 4.905588,-7.529069 4.540872,-8.546578 -0.06421,-0.179129 0.254994,-0.556672 0.709335,-0.838983 0.932382,-0.579346 8.414333,-10.314366 10.001907,-13.013816 0.569998,-0.969203 1.041926,-1.29026 1.048729,-0.713459 0.0068,0.576801 0.591964,1.048729 1.30036,1.048729 1.569264,0 5.423872,2.434837 5.423872,3.426092 0,0.393888 -0.541741,0.508275 -1.203869,0.254192 -0.960485,-0.368573 -1.185327,0.453162 -1.112152,4.064608 0.05045,2.489616 -0.246668,5.06899 -0.66025,5.731943 -0.85763,1.37474 -1.157591,2.522322 -1.740503,6.658758 -0.664755,4.717208 -0.762097,19.131298 -0.133444,19.759951 1.328398,1.328398 5.789042,-5.764919 5.039736,-8.014189 -0.230582,-0.692161 -0.124977,-0.984437 0.234678,-0.649502 0.359654,0.334933 2.653142,-2.300013 5.09664,-5.855439 10.552537,-15.354527 26.911959,-27.419951 41.366022,-30.50832 2.59083,-0.553578 4.97435,-1.229918 5.29671,-1.502978 0.32237,-0.27306 3.11514,-0.307701 6.20615,-0.07698 4.15999,0.31051 5.8604,0.805869 6.54525,1.906739 0.77752,1.249841 0.28906,2.072349 -3.05997,5.152675 -2.19184,2.015986 -3.99664,3.423208 -4.01068,3.12716 -0.014,-0.296048 -0.41478,0.130371 -0.89055,0.947597 -0.47577,0.817227 -1.21937,1.266874 -1.65245,0.999215 -0.43308,-0.267659 -0.78742,-0.08683 -0.78742,0.401846 0,0.488673 -0.56631,0.888497 -1.25847,0.888497 -0.69217,0 -1.25848,0.313541 -1.25848,0.696759 0,0.383217 -1.60455,1.868083 -3.56568,3.299701 -4.65758,3.40003 -13.540008,11.977804 -13.727739,13.256896 -0.160162,1.091231 2.761539,0.640584 3.490139,-0.538324 0.23831,-0.385589 0.94932,-0.50305 1.58003,-0.261024 0.63071,0.242025 1.3858,0.05325 1.67796,-0.419492 0.29218,-0.472746 1.08546,-0.646862 1.76284,-0.386926 0.67738,0.259936 1.2316,0.06652 1.2316,-0.429802 0,-0.496328 0.56632,-0.685099 1.25848,-0.419491 0.69216,0.265607 1.25847,0.0427 1.25847,-0.495338 0,-0.538042 0.29569,-0.795517 0.65708,-0.572164 0.64625,0.399406 7.78699,-0.803673 10.2497,-1.726883 1.56145,-0.585347 21.34974,-0.633849 22.3462,-0.05477 0.66897,0.388761 8.02004,1.756788 9.95465,1.852551 0.46144,0.02284 1.02775,0.230301 1.25847,0.461021 0.23073,0.23072 3.31932,1.819259 6.86357,3.530086 4.45937,2.152569 6.57074,2.79856 6.85537,2.097458 0.24371,-0.600324 0.43829,-0.454211 0.47754,0.358592 0.063,1.305197 4.26115,4.774276 4.26115,3.521155 0,-0.329552 0.53588,0.133672 1.19085,1.029388 0.65496,0.895717 1.59881,1.675768 2.09745,1.733448 0.49864,0.05768 1.27231,0.152066 1.71927,0.209746 0.44695,0.05768 0.62647,0.590057 0.39891,1.183059 -0.22755,0.593003 0.28141,1.824334 1.13102,2.736292 1.40343,1.50641 1.42451,1.781147 0.23033,3.002991 -1.48385,1.518218 -9.28478,2.677288 -9.28478,1.379538 0,-0.454127 -0.61417,-0.590009 -1.36481,-0.301958 -0.75065,0.28805 -1.78889,0.191133 -2.30721,-0.215371 -0.51831,-0.406504 -1.5087,-0.786534 -2.20086,-0.844511 -0.69216,-0.05798 -2.57987,-0.297975 -4.19491,-0.533327 -5.47831,-0.798329 -14.61171,-1.042254 -18.85049,-0.503439 l -4.22155,0.536622 2.09746,1.389652 c 1.1536,0.764308 2.65479,1.509796 3.33596,1.656639 0.68117,0.146843 1.74985,0.742386 2.37484,1.323428 0.62499,0.581041 1.48345,0.841917 1.90769,0.579723 0.42424,-0.262194 0.77134,-0.08659 0.77134,0.390235 0,0.476823 1.13263,1.452656 2.51695,2.168517 1.38432,0.71586 2.51695,1.030939 2.51695,0.700174 0,-0.330766 0.47193,-0.03676 1.04873,0.653344 0.5768,0.690104 3.17764,2.852291 5.77964,4.804859 4.40969,3.309067 9.14582,8.054746 15.54909,15.58044 1.46376,1.720329 2.65445,3.309405 2.64597,3.531283 -0.0294,0.770519 4.7645,9.970147 5.46136,10.480477 0.3855,0.28232 0.59993,0.65986 0.47654,0.83898 -0.1234,0.17914 0.0676,1.26955 0.4245,2.42315 0.90858,2.93703 1.0869,3.91855 1.79096,9.85806 0.34186,2.884 0.90518,5.24364 1.25183,5.24364 0.89972,0 -0.97274,6.92731 -2.20733,8.16617 -0.81706,0.8199 -1.52577,0.54198 -3.41228,-1.33812 -2.777,-2.76757 -6.38575,-7.06221 -6.44254,-7.66703 -0.0216,-0.23072 -0.72124,-1.15138 -1.55462,-2.04591 -0.83338,-0.89454 -1.51524,-2.03901 -1.51524,-2.54328 0,-1.34431 -14.48919,-16.391531 -15.78045,-16.388209 -0.60403,0.0017 -0.85772,0.39199 -0.56375,0.867643 0.29397,0.475653 0.66407,2.259066 0.82245,3.963156 0.15838,1.70407 0.67401,3.22701 1.14586,3.3843 0.47184,0.15727 0.64994,0.82788 0.39577,1.49023 -0.25416,0.66235 -0.13856,1.20596 0.25688,1.20803 0.39546,0.002 0.79265,1.41094 0.88265,3.13082 0.09,1.71988 0.54073,3.25276 1.0016,3.40638 0.46087,0.15362 0.63693,0.80315 0.39124,1.44341 -0.24569,0.64025 -0.15337,1.63871 0.20514,2.2188 0.35852,0.58009 0.55223,2.67465 0.43047,4.65458 -0.12176,1.97994 0.13246,3.59988 0.56494,3.59988 0.43247,0 0.75653,2.06047 0.72013,4.57882 -0.0377,2.60698 -0.35635,4.14252 -0.73999,3.56568 -0.37347,-0.56158 -0.64163,1.23049 -0.60163,4.02075 0.0897,6.25549 -1.74048,13.05615 -5.92675,22.02331 -1.77721,3.80688 -3.11049,6.92161 -2.96283,6.92161 0.14766,0 -1.00946,1.39518 -2.57137,3.10039 -1.56192,1.70522 -2.84276,3.49854 -2.84631,3.98517 -0.009,1.26955 -6.14154,4.59448 -7.97691,4.32511 -1.32839,-0.19496 -1.53954,-1.00349 -1.49763,-5.73439 0.0268,-3.02909 0.35984,-6.01071 0.74001,-6.62584 2.60636,-4.21717 3.24844,-31.31022 0.69174,-29.18835 -1.12046,0.9299 -3.33862,6.56414 -3.02952,7.69511 0.0946,0.34608 -0.22784,0.62924 -0.71651,0.62924 -0.48868,0 -0.65516,0.37754 -0.36998,0.83898 0.28519,0.46144 0.1793,0.83898 -0.23531,0.83898 -0.94966,0 -3.05385,4.25601 -2.80645,5.67641 0.10174,0.58411 -0.30487,0.96165 -0.90358,0.83898 -0.63123,-0.12932 -0.98371,0.39939 -0.83898,1.25848 0.13726,0.81483 -0.0564,1.38114 -0.43034,1.25847 -0.37395,-0.12266 -3.50495,2.75004 -6.95778,6.38378 -6.77617,7.1312 -13.65466,12.39832 -20.96739,16.05553 -2.537921,1.26926 -4.89178,2.73015 -5.230797,3.24644 -0.351819,0.53578 -0.633356,0.57858 -0.655917,0.0997 -0.02173,-0.46144 -0.59384,-0.10612 -1.271319,0.78959 -0.677487,0.89572 -1.231795,1.15659 -1.231795,0.57972 0,-0.63043 -0.418372,-0.78654 -1.048729,-0.39134 -0.576801,0.36163 -1.992585,0.77303 -3.146186,0.91423 -1.153602,0.14119 -2.663771,0.4881 -3.355932,0.77088 -0.692161,0.28279 -2.259277,0.43545 -3.482479,0.33925 -1.223202,-0.0962 -2.472496,0.22718 -2.776209,0.71859 -0.608738,0.98496 -0.610403,0.98499 -4.301835,0.10251 z M 105.3823,119.67759 c 2.96405,-0.72886 5.11236,-2.12439 8.69175,-5.6461 2.61501,-2.57287 4.57482,-4.96876 4.35514,-5.32421 -0.21967,-0.35545 -0.0625,-0.64626 0.34926,-0.64626 0.41177,0 0.777,-0.47193 0.81165,-1.04873 0.0346,-0.5768 0.33923,-2.85363 0.67688,-5.05962 0.85213,-5.567226 -1.49826,-14.240217 -4.25959,-15.718041 -1.09631,-0.586725 -1.92308,-1.295789 -1.83726,-1.5757 0.2239,-0.73035 -3.99907,-4.651767 -5.36389,-4.980859 -0.63186,-0.152357 -1.38837,-0.664593 -1.68114,-1.1383 -0.3476,-0.562435 -0.75064,-0.508014 -1.16154,0.15684 -0.49258,0.797016 -0.76567,0.797367 -1.25748,0.0016 -0.76615,-1.239633 -10.068028,-1.722106 -11.537012,-0.598381 -0.576801,0.441235 -1.048729,0.572796 -1.048729,0.292356 0,-0.864226 -4.613501,2.241922 -8.056421,5.424176 -3.735891,3.453044 -6.716763,8.296496 -5.118541,8.316831 0.688452,0.0088 0.646587,0.242917 -0.131579,0.735955 -1.318482,0.835378 -2.034231,7.394243 -0.884455,8.104843 0.459986,0.28429 0.420003,1.13435 -0.09897,2.10406 -0.620447,1.15931 -0.601,1.62704 0.06765,1.62704 0.516129,0 0.782231,0.46856 0.591337,1.04124 -0.190894,0.57268 0.158657,1.54698 0.776779,2.1651 0.618123,0.61812 0.944503,1.41406 0.72529,1.76876 -0.219213,0.35469 0.519516,1.13623 1.641621,1.73677 1.122104,0.60053 1.874807,1.35947 1.672674,1.68653 -0.43943,0.71101 4.24069,5.02533 5.451418,5.02533 0.465436,0 0.846247,0.39983 0.846247,0.8885 0,0.48868 0.342675,0.67671 0.7615,0.41787 0.418825,-0.25885 1.645838,-0.11629 2.726698,0.31679 2.739942,1.09787 7.644303,1.06819 12.290713,-0.0744 z"
+   id="path3750"
+   inkscape:connector-curvature="0" /></svg>
\ No newline at end of file
index e9bd52c..520c482 100644 (file)
@@ -233,5 +233,6 @@ export const translations = {
   "Two kings": "Two kings",
   "Two royal pieces": "Two royal pieces",
   "Unidentified pieces": "Unidentified pieces",
+  "Walk on a graph": "Walk on a graph",
   "White move twice": "White move twice"
 };
index 27ad31c..f803df2 100644 (file)
@@ -233,5 +233,6 @@ export const translations = {
   "Two kings": "Dos reyes",
   "Two royal pieces": "Dos piezas reales",
   "Unidentified pieces": "Piezas no identificadas",
+  "Walk on a graph": "Camino en un gráfico",
   "White move twice": "Las blancas juegan dos veces"
 };
index 5d2ef3b..e73e2e5 100644 (file)
@@ -233,5 +233,6 @@ export const translations = {
   "Two kings": "Deux rois",
   "Two royal pieces": "Deux pièces royales",
   "Unidentified pieces": "Pièces non identifiées",
+  "Walk on a graph": "Marche sur un graphe",
   "White move twice": "Les blancs jouent deux fois"
 };
diff --git a/client/src/translations/rules/Hamilton/en.pug b/client/src/translations/rules/Hamilton/en.pug
new file mode 100644 (file)
index 0000000..813c420
--- /dev/null
@@ -0,0 +1,27 @@
+p.boxed
+  | Click on an empty square to start the game.
+  | The first player unable to move the knight loses.
+
+p.
+  White puts a knight on any square of an empty chessboard.
+  Black moves the knight, and its initial square vanish:
+  the knight will no longer be able to land on that square.
+  Play alternates, always with the vanishing initial square condition.
+  The first player unable to make a move loses.
+
+figure.diagram-container
+  .diagram
+    | fen:3xx2x/1x1xNxx1/2xxxxxx/xxxxxx2/2xxxxx1/x1xxxx2/1xxxxx2/1x2xx2 g8,c8:
+  figcaption Ng8 wins, but Nc8 loses because it allows Na7.
+
+p
+  | Note about the name: when the game ends, the knight has walked on an 
+  a(href="https://en.wikipedia.org/wiki/Hamiltonian_path") Hamiltonian path
+  | &nbsp;considering the subgraph formed by all the removed squares
+  | plus the final square.
+
+p
+  | Inventor: David Silverman (1971) according to 
+  a(href="https://www.jsbeasley.co.uk/encyc.htm")
+    | The Classified Encyclopedia of Chess Variants
+  | . The game idea is probably quite older.
diff --git a/client/src/translations/rules/Hamilton/es.pug b/client/src/translations/rules/Hamilton/es.pug
new file mode 100644 (file)
index 0000000..8acf042
--- /dev/null
@@ -0,0 +1,29 @@
+p.boxed
+  | Haz clic en una casilla vacía para comenzar el juego.
+  | El primer jugador que no puede mover al caballo ha perdido.
+
+p.
+  White pone el caballo en cualquier casilla de un tablero vacío.
+  Las negras mueven a este caballo, y su casilla inicial desaparece:
+  el caballo ya no puede llegar a este espacio.
+  El juego continúa, siempre con la condición de desaparezca de la casilla
+  inicial. El primer jugador que no puede ejecutar un movimiento ha perdido.
+
+figure.diagram-container
+  .diagram
+    | fen:3xx2x/1x1xNxx1/2xxxxxx/xxxxxx2/2xxxxx1/x1xxxx2/1xxxxx2/1x2xx2 g8,c8:
+  figcaption Ng8 gana, pero Nc8 pierde porque permite Na7.
+
+p
+  | Nota sobre el nombre: cuando termina el juego, el caballo ha caminado
+  | sobre un 
+  a(href="https://es.wikipedia.org/wiki/Camino_hamiltoniano")
+    | camino hamiltoniano
+  | &nbsp;considerando el sub-gráfico que consiste en los cuadros eliminados y
+  | la casilla final.
+
+p
+  | Inventor: David Silverman (1971) después 
+  a(href="https://www.jsbeasley.co.uk/encyc.htm")
+    | The Classified Encyclopedia of Chess Variants
+  | . La idea del juego es probablemente más antigua.
diff --git a/client/src/translations/rules/Hamilton/fr.pug b/client/src/translations/rules/Hamilton/fr.pug
new file mode 100644 (file)
index 0000000..a369618
--- /dev/null
@@ -0,0 +1,28 @@
+p.boxed
+  | Cliquez sur une case vide pour démarrer la partie.
+  | Le premier joueur incapable de déplacer le cavalier a perdu.
+
+p.
+  Les blancs posent le cavalier sur n'importe quelle case d'un échiquier vide.
+  Les noirs déplacent ce cavalier, et sa case de départ disparaît :
+  le cavalier ne pourra plus arriver sur cette case.
+  Le jeu continue, toujours avec la condition de disparition de la case
+  initiale. Le premier joueur ne pouvant effectuer un coup a perdu.
+
+figure.diagram-container
+  .diagram
+    | fen:3xx2x/1x1xNxx1/2xxxxxx/xxxxxx2/2xxxxx1/x1xxxx2/1xxxxx2/1x2xx2 g8,c8:
+  figcaption Ng8 gagne, mais Nc8 perd car cela permet Na7.
+
+p
+  | Note au sujet du nom : quand la partie s'achève, le cavalier s'est promené
+  | sur un 
+  a(href="https://fr.wikipedia.org/wiki/Graphe_hamiltonien") chemin hamiltonien
+  | &nbsp;considérant le sous-graphe constitué des cases supprimées et de la
+  | case finale.
+
+p
+  | Inventeur : David Silverman (1971) d'après 
+  a(href="https://www.jsbeasley.co.uk/encyc.htm")
+    | The Classified Encyclopedia of Chess Variants
+  | . L'idée du jeu est probablement plus ancienne.
diff --git a/client/src/variants/Hamilton.js b/client/src/variants/Hamilton.js
new file mode 100644 (file)
index 0000000..8c3a1bd
--- /dev/null
@@ -0,0 +1,153 @@
+import { ChessRules, Move, PiPo } from "@/base_rules";
+import { randInt } from "@/utils/alea";
+
+export class HamiltonRules extends ChessRules {
+  static get HasFlags() {
+    return false;
+  }
+
+  static get HasEnpassant() {
+    return false;
+  }
+
+  static get HOLE() {
+    return "xx";
+  }
+
+  static board2fen(b) {
+    if (b[0] == 'x') return 'x';
+    return ChessRules.board2fen(b);
+  }
+
+  static fen2board(f) {
+    if (f == 'x') return V.HOLE;
+    return ChessRules.fen2board(f);
+  }
+
+  getPpath(b) {
+    if (b[0] == 'x') return "Hamilton/hole";
+    return b;
+  }
+
+  static get PIECES() {
+    return [ChessRules.KNIGHT];
+  }
+
+  static IsGoodPosition(position) {
+    if (position.length == 0) return false;
+    const rows = position.split("/");
+    if (rows.length != V.size.x) return false;
+    for (let row of rows) {
+      let sumElts = 0;
+      for (let i = 0; i < row.length; i++) {
+        if (['x'].concat(V.PIECES).includes(row[i].toLowerCase())) sumElts++;
+        else {
+          const num = parseInt(row[i]);
+          if (isNaN(num)) return false;
+          sumElts += num;
+        }
+      }
+      if (sumElts != V.size.y) return false;
+    }
+    return true;
+  }
+
+  static GenRandInitFen() {
+    return "8/8/8/8/8/8/8/8 w 0";
+  }
+
+  canIplay(side, [x, y]) {
+    return side == this.turn;
+  }
+
+  // Initiate the game by choosing a square for the knight:
+  doClick(square) {
+    if (this.movesCount > 0) return null;
+    return new Move({
+      appear: [
+        new PiPo({ x: square[0], y: square[1], c: 'w', p: V.KNIGHT })
+      ],
+      vanish: [],
+      start: { x: -1, y: -1 }
+    });
+  }
+
+  getAllPotentialMoves() {
+    if (this.movesCount == 0) {
+      return [...Array(64).keys()].map(k => {
+        const i = k % 8;
+        const j = (k - i) / 8;
+        return new Move({
+          appear: [
+            new PiPo({ x: i, y: j, c: 'w', p: V.KNIGHT })
+          ],
+          vanish: [],
+          start: { x: -1, y: -1 }
+        });
+      });
+    }
+    for (let i=0; i<8; i++) {
+      for (let j=0; j<8; j++) {
+        if (!([V.EMPTY, V.HOLE].includes(this.board[i][j])))
+          return this.getPotentialKnightMoves([i, j]);
+      }
+    }
+    return [];
+  }
+
+  getPotentialKnightMoves([x, y]) {
+    return (
+      V.steps[V.KNIGHT].filter(
+        s => {
+          const [i, j] = [x + s[0], y + s[1]];
+          return (V.OnBoard(i, j) && this.board[i][j] != V.HOLE);
+        }
+      ).map(s => {
+        return this.getBasicMove([x, y], [x + s[0], y + s[1]]);
+      })
+    );
+  }
+
+  atLeastOneMove() {
+    if (this.movesCount == 0) return true;
+    for (let i=0; i<8; i++) {
+      for (let j=0; j<8; j++) {
+        if (!([V.EMPTY, V.HOLE].includes(this.board[i][j])))
+          return this.getPotentialKnightMoves([i, j]).length > 0;
+      }
+    }
+    return false;
+  }
+
+  filterValid(moves) {
+    return moves;
+  }
+
+  static PlayOnBoard(board, move) {
+    if (move.vanish.length > 0)
+      board[move.vanish[0].x][move.vanish[0].y] = V.HOLE;
+    for (let psq of move.appear) board[psq.x][psq.y] = psq.c + psq.p;
+  }
+
+  getCheckSquares() {
+    return [];
+  }
+
+  getCurrentScore() {
+    if (this.atLeastOneMove()) return "*";
+    // No valid move: I lose
+    return this.turn == "w" ? "0-1" : "1-0";
+  }
+
+  getComputerMove() {
+    const moves = this.getAllValidMoves();
+    // Just a random mover for now...
+    return moves[randInt(moves.length)];
+  }
+
+  getNotation(move) {
+    if (move.vanish.length > 0) return super.getNotation(move);
+    // First game move:
+    return "N@" + V.CoordsToSquare(move.end);
+  }
+};
index a347920..48f97c0 100644 (file)
@@ -41,6 +41,7 @@ insert or ignore into Variants (name, description) values
   ('Extinction', 'Capture all of a kind'),
   ('Grand', 'Big board'),
   ('Grasshopper', 'Long jumps over pieces'),
+  ('Hamilton', 'Walk on a graph'),
   ('Horde', 'A pawns cloud'),
   ('Interweave', 'Interweaved colorbound teams'),
   ('Knightmate', 'Mate the knight'),