圌ãå€ããåã¯ã€ãšã¹ã ãšä¿¡ããŠããŸãïŒ
ãŠãŒãªã»ã·ã§ããã¥ã¯
ç§ã®èšäºãèªãã 人ãã¡ã¯ãç§ãZillions of Gamesã®ã¡ã¿ã²ãŒã ã·ã¹ãã ãããªãé·ãéç 究ããŠããããšãç¥ã£ãŠããã¯ãã§ãã ãã®éãã£ãšãç§ã¯50ãå°ãäžåãã²ãŒã ãéçºãããã®ãã©ãããã©ãŒã ããã£ãšèª¿ã¹ãŠããŸããã ç§ã®ç®æšã¯ãåæ§ã®ïŒã§ããã°ããæ©èœçãªïŒãªãŒãã³ãœãŒã¹ã·ã¹ãã ãéçºããããšã§ãã ãã®äœæ¥ã®é²æã«ã€ããŠãäŒãããããšæããŸãã
ç»åã§
ç§ãèšã£ãããã«ãZillions of Gamesã®ä»çµã¿ãããç解ããŠããŸãã ãã®è£œåã®ç§»æ€ã«å¯ŸåŠããã€ããã¯ãªãã®ã§ããœãŒã¹ã³ãŒãã®æ¬ åŠã«éªéãããŸããã ç§ãçŸåšç¥ã£ãŠãããã¹ãŠã®ã¡ã¿ã²ãŒãã³ã°ãã©ãããã©ãŒã ã®å©ç¹ïŒããã³ããã«å€§ããªæ¬ ç¹ïŒãèæ ®ããŠããŒãããæ°ããã·ã¹ãã ãéçºããããšã§ãã ãããããªã¹ãããŸãã
- Zillions of Gamesã¯ãç§ãããæžããæãæåãªã¡ã¿ã²ãŒã ã·ã¹ãã ã§ãã
- Axiom Development Kitã¯ããªãèå³æ·±ããããžã§ã¯ãã§ãããZillions of Gamesã®æ¡åŒµã¢ãžã¥ãŒã«ãšããŠå®è£ ãããŠããŸãããèªåŸçã«åäœããããšãã§ããŸãã
- LUDÃãããžã§ã¯ã -æ°ããããŒãã²ãŒã ã®èªåéçºçšã«èšèšããã楜ããã·ã¹ãã
- Jocly-ã¢ãã³ã§éåžžã«èå³æ·±ãéçºïŒæ®å¿µãªãããå®è£ ãããã²ãŒã ã®å質ã«ã¯å€ãã®èŠæãæ®ãããŠããŸãïŒ
ãããã®è£œåã¯ãã¹ãŠæ©èœããæå³ãããšããã«æ©èœããŸããå€å°ã®åŽåãè²»ãããŠãããŸããŸãªããŒãã²ãŒã ã®ã³ã³ãã¥ãŒã¿ãŒå®è£ ãäœæããã®ã«åœ¹ç«ã¡ãŸãã ãã§ãã«ãŒãšãã§ã¹ã ãã§ã¯ãããŸããïŒ æ¢ã«äœæãããã²ãŒã ã®æ°ãšïŒæãéèŠãªããšã§ããïŒå€æ§æ§ã¯ããã¹ãŠã®æåŸ ãè¶ ããŠããŸãã ããã¯ã¡ã¿ã²ãŒã ã·ã¹ãã ã®äž»ãªå©ç¹ã§ããæ°ãããããªãè€éãªããŒãã²ãŒã ã®ãããã¿ã€ãããããæ°æéã§äœæã§ããŸãã
è»èã§é£ã¶
ãã®äž»ãªæ¬ ç¹ãæããã§ãã åäžã®ãŠãããŒãµã«ã²ãŒã ããšã³ãžã³ãããå¯äžã®ããŒãã²ãŒã ã«çŠç¹ãåœãŠãç¹æ®ãªããã°ã©ã ãšïŒããã©ãŒãã³ã¹ã®èŠ³ç¹ããïŒæ¯èŒããããšã¯ã§ããŸããã ããã«çŽæ¥é¢ä¿ããã®ã¯ããããã®ãç¥æ§ãã§ãããããã¯ãäžäººã®äººéãã¬ã€ã€ãŒãšã®é¢ä¿ãä¿ã€ããã«èšèšãããŠããŸãã ãã¹ãŠã®ãŠãããŒãµã«ã²ãŒã ã·ã¹ãã ã¯éåžžã«åŒ±ããã¬ã€ããŸãããéåžžã¯ããªããšããŸããã¯ãªã²ãŒã ã«ã€ããŠè©±ããŠãããããããã¯ããã»ã©å€§ããªåé¡ã§ã¯ãããŸããã ããšãã°ãäžå°giã§ã°ã©ã³ããã¹ã¿ãŒã®ã¬ãã«ã§æŒå¥ããŠãã人ã«äŒãããšãã§ããã°ãããã°ã©ã ã¯å¹žéã§ã¯ãããŸããã
ãã®äžè¬çãªæ¬ é¥ïŒããã³ãœãŒã¹ã³ãŒãã®è¿ãã«é¢é£ããèŽåœçãªæ¬ é¥ïŒã«å ããŠããããã®ãããžã§ã¯ãã«ã¯ããããåå¥ã®ç¹æ§ããããŸãã ãã®ããã Zillions of Gamesã¯lispoã«äŒŒã DSLã䜿çšããŸããããã«ãããããŒãã²ãŒã ã®èšè¿°ããã»ã¹ãå€§å¹ ã«ç°¡çŽ åãããŸãããéçºè ãå©çšã§ããæ©èœãå€å°å¶éãããŸãã ãã®å©ããåããŠã æ¬åœã« å€ããå®è£ ããããšã¯å¯èœã§ããããã¹ãŠã§ã¯ãããŸããã Rhythm MachiahãKauriãªã©ã®äžéšã®ã²ãŒã ã¯ãçŽç²ãªZRFã§éçºããããšã¯æããã«äžå¯èœã§ã ã ã Ko Shogi ããã Gwangsanghui ããªã©ã®ä»ã®æ¹æ³ãå®è¡ã§ããŸããããã®ããã©ãŒãã³ã¹ïŒããã³AIã®ãã€ã³ããªãžã§ã³ã¹ãïŒãäœäžããã»ã©è€éãªæ¹æ³ã§ãã
Axiom Development Kitæ¡åŒµã¯ãZillions of Gamesãæ¹åããè©Šã¿ãšããŠç»å ŽããŸããã ãã®ã©ã€ãã©ãªãŒã¯ïŒZillions of Gamesã®ãããªããŒã«ãã©ã°ã ãã§ãªãïŒæ°åã§åäœãããããRhythm Machiaã®ãããªã²ãŒã ã¯å®çŸå¯èœã«ãªãã€ã€ãããŸãããäžéšã®å Žæã§ã®éçºããã»ã¹ã¯æªå€¢ã«äŒŒãŠããŸãïŒç§ã¯ããã«ã€ããŠå°ãæžããŸãã ïŒã DSLãšããŠãAxiomã¯Forthã¹ã¯ãªããïŒ Fortèšèªã®ãµãã»ããïŒã䜿çšããŸãããã®èšèªïŒããã³æãéèŠãªã®ã¯ããã®äžã§ããã°ã©ã ããããã°ããïŒã¯ããŠã©ãŒã ãã¥ãŒãZRFãããã¯ããã«è€éã§ãã ããã«ããã¹ãŠã§ã§ããããã§ã¯ãããŸããã ããã座ããåè¿°ã®ããã«ã«ãŠãªãªã©ã®ã²ãŒã ã®éçºã¯ãŸã äžå¯èœã§ãã
Joclyã«é¢ããŠã¯ããã®ã·ã¹ãã ã®æ¬ ç¹ã¯ïŒç§ã®æèŠã§ã¯ïŒã²ãŒã ãèšè¿°ããããã«DSLã䜿çšããããšãå®å šã«æåŠããŠããããšã§ãã å®éãããã¯JavaScriptã§ããŒãã²ãŒã ãéçºããããã®MVCãã¬ãŒã ã¯ãŒã¯ã§ãã ãã§ã«éçºãããã²ãŒã ã«éåžžã«äºçŽ°ãªå€æŽãå ããã ãã§ããéåžžã«æéã®ãããããã»ã¹ã«ãªããŸã ã èè èªèº«ãäœæããã²ãŒã ã«ãé倧ãªãšã©ãŒããªãããã§ã¯ãããŸããïŒããã¯éçºããã»ã¹ã®è€éãã«èµ·å ããŸãïŒã ããšãã°ãã Alcuirk ããšããç¶æ³ã§ã¯ãåãããŒã¹ã1ã¿ãŒã³ã«æ°åãåããããç¶æ³ãçºçããã Turkish Drafts ãã§ã¯ã Turkish Strike ãã«ãŒã«ã誀ã£ãŠé©çšãããŸã ã
ãã®äžè¬çãªæ¬ é¥ïŒããã³ãœãŒã¹ã³ãŒãã®è¿ãã«é¢é£ããèŽåœçãªæ¬ é¥ïŒã«å ããŠããããã®ãããžã§ã¯ãã«ã¯ããããåå¥ã®ç¹æ§ããããŸãã ãã®ããã Zillions of Gamesã¯lispoã«äŒŒã DSLã䜿çšããŸããããã«ãããããŒãã²ãŒã ã®èšè¿°ããã»ã¹ãå€§å¹ ã«ç°¡çŽ åãããŸãããéçºè ãå©çšã§ããæ©èœãå€å°å¶éãããŸãã ãã®å©ããåããŠã æ¬åœã« å€ããå®è£ ããããšã¯å¯èœã§ããããã¹ãŠã§ã¯ãããŸããã Rhythm MachiahãKauriãªã©ã®äžéšã®ã²ãŒã ã¯ãçŽç²ãªZRFã§éçºããããšã¯æããã«äžå¯èœã§ã ã ã Ko Shogi ããã Gwangsanghui ããªã©ã®ä»ã®æ¹æ³ãå®è¡ã§ããŸããããã®ããã©ãŒãã³ã¹ïŒããã³AIã®ãã€ã³ããªãžã§ã³ã¹ãïŒãäœäžããã»ã©è€éãªæ¹æ³ã§ãã
Axiom Development Kitæ¡åŒµã¯ãZillions of Gamesãæ¹åããè©Šã¿ãšããŠç»å ŽããŸããã ãã®ã©ã€ãã©ãªãŒã¯ïŒZillions of Gamesã®ãããªããŒã«ãã©ã°ã ãã§ãªãïŒæ°åã§åäœãããããRhythm Machiaã®ãããªã²ãŒã ã¯å®çŸå¯èœã«ãªãã€ã€ãããŸãããäžéšã®å Žæã§ã®éçºããã»ã¹ã¯æªå€¢ã«äŒŒãŠããŸãïŒç§ã¯ããã«ã€ããŠå°ãæžããŸãã ïŒã DSLãšããŠãAxiomã¯Forthã¹ã¯ãªããïŒ Fortèšèªã®ãµãã»ããïŒã䜿çšããŸãããã®èšèªïŒããã³æãéèŠãªã®ã¯ããã®äžã§ããã°ã©ã ããããã°ããïŒã¯ããŠã©ãŒã ãã¥ãŒãZRFãããã¯ããã«è€éã§ãã ããã«ããã¹ãŠã§ã§ããããã§ã¯ãããŸããã ããã座ããåè¿°ã®ããã«ã«ãŠãªãªã©ã®ã²ãŒã ã®éçºã¯ãŸã äžå¯èœã§ãã
Joclyã«é¢ããŠã¯ããã®ã·ã¹ãã ã®æ¬ ç¹ã¯ïŒç§ã®æèŠã§ã¯ïŒã²ãŒã ãèšè¿°ããããã«DSLã䜿çšããããšãå®å šã«æåŠããŠããããšã§ãã å®éãããã¯JavaScriptã§ããŒãã²ãŒã ãéçºããããã®MVCãã¬ãŒã ã¯ãŒã¯ã§ãã ãã§ã«éçºãããã²ãŒã ã«éåžžã«äºçŽ°ãªå€æŽãå ããã ãã§ããéåžžã«æéã®ãããããã»ã¹ã«ãªããŸã ã èè èªèº«ãäœæããã²ãŒã ã«ãé倧ãªãšã©ãŒããªãããã§ã¯ãããŸããïŒããã¯éçºããã»ã¹ã®è€éãã«èµ·å ããŸãïŒã ããšãã°ãã Alcuirk ããšããç¶æ³ã§ã¯ãåãããŒã¹ã1ã¿ãŒã³ã«æ°åãåããããç¶æ³ãçºçããã Turkish Drafts ãã§ã¯ã Turkish Strike ãã«ãŒã«ã誀ã£ãŠé©çšãããŸã ã
Joclyãšç¥ãåã£ããããããã€ãã®æ±ºå®ãåèããããã«ãªããŸããã ãããªãéçºã®ããã«ãJavaScriptã䜿çšããããšãåºã決ããŸãããããã¯æããã«ãææ°ã®ã€ã³ã¿ãŒãã§ãŒã¹ãåããæ¡åŒµå¯èœãªã¯ãã¹ãã©ãããã©ãŒã ã·ã¹ãã ãäœæããæãç°¡åãªæ¹æ³ã ããã§ãã ã·ã³ã°ã«ã¹ã¬ããã¯å°ãæãã§ãããå®éããã®ç¬éã¯AIã«ãšã£ãŠã®ã¿éèŠã§ãïŒãããŠããã®äžã§ããã«ãã¹ã¬ããã䜿çšããããšã¯æ¬åœã«ç°¡åã§ã¯ãããŸããïŒããããŠç§ãã¡ã¯ãã§ã«ïŒèªåèªèº«ã«ãšã£ãŠïŒAIãã¡ã¿ã²ãŒã ã·ã¹ãã ã®æ匷ã®åŽé¢ã§ã¯ãªãããšãçºèŠããŸããã
äžæ¹ãããŒãã²ãŒã ã®æãæ¥åžžçãªåŽé¢ãèšè¿°ããããã®DSLã®å¿ èŠæ§ã¯ãç§ã«ãšã£ãŠéåžžã«æçœã§ãã JavaScriptãçŽæ¥äœ¿çšããŠã²ãŒã ã¢ãã«å šäœãéçºãããšãããã»ã¹ã«åäŸã®ãªãæè»æ§ãäžããããŸãããå€åããšéäžåãå¿ èŠã§ãïŒãããŠãå®è·µã瀺ããŠããããã«ããããã®ååšã¯ããŸã圹ã«ç«ã¡ãŸããïŒã çæ³çã«ã¯ãæ°ããã·ã¹ãã ã§å®è¡ã§ããããã«ããããã«ãããŒã¹ZRFãšã®äºææ§ã確ä¿ããããšèããŠããŸãã Joclyéçºè ãããã«ã€ããŠæžããŠããã®ã¯æ¬¡ã®ãšããã§ãã
ZoGã§ã¯ãã²ãŒã ã¯ZRFãšåŒã°ããLispããŒã¹ã®èšèªã§èšè¿°ãããŸãã ããã«ãããã²ãŒã ã«ãŒã«ã«åªããæ£åŒãªãã¬ãŒã ã¯ãŒã¯ãæäŸãããŸãããZRFã«ç¹å®ã®æ©èœã«å¯Ÿããäºåå®çŸ©ãããæ瀺ããªãå Žåãããã€ãã®å¶éãå°å ¥ãããŸãã ã²ãŒã ã¯Javascriptã§éçºãããAPIã䜿çšããŠã«ãŒã«ãšãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãå®çŸ©ãããããJoclyã¢ãããŒãã¯ãŸã£ããç°ãªããŸãã Joclyã®è¯ãç¹ã¯ãéçºè ãæãããšã¯ã»ãšãã©äœã§ãã§ããããšã§ããæªãç¹ã¯ãããå€ãã®ã³ãŒããæžããªããã°ãªããªãããšã§ãã
çè«çã«ã¯ãJoclyãZoGã²ãŒã ãå®è¡ã§ããããã«ãJavascriptã§ZRFã€ã³ã¿ãŒããªã¿ãŒãäœæããããšãå¯èœã§ãã ãã®ãããªããŒã«ãéçºãããå Žåã¯ããç¥ãããã ããã
ãããã解éã§ã¯ãªããJoclyã®ã²ãŒã ã®èª¬æã«ZRFãã¡ã€ã«ãäžçš®ã®ãã³ã³ãã€ã«ãããããšã«çŠç¹ãåœãŠãŠããã®éãåãããšã«ããŸããã Lispãé£æ³ãããèšèªã§ãã²ãŒã ã®éåžžã«åçŽãªèª¬æãå«ãŸããŠããå Žåã§ããããã¹ããã¡ã€ã«ãåžžã«è§£æããŸããããã¯ãJavaScriptã§ããããããšã§ã¯ãããŸããã
詳现
ã²ãŒã ã®èª¬æãå«ããœãŒã¹zrfãã¡ã€ã«ãJoclyã¢ãã«ãžã®ã¢ããããŒãã«é©ãã圢åŒã«å€æããã¢ããªã±ãŒã·ã§ã³ãäœæããããšã«ããŸããã ããšãã°ã ãã®ãã¡ã€ã«ã®ä»£ããã«ïŒ Joclyã€ã³ã¹ãã¯ã¿ãŒã䜿çšããŠããã¹ãŠã®ãã¬ãŒã³ããã¹ãJoclyãã©ãããã©ãŒã ã衚瀺ã§ããŸãïŒã ãã¡ããããã®èª¬æãJoclyã¢ãã«ã«ãæ¥çãã§ããã¬ã€ã€ãŒãå¿
èŠã§ããã Z2J-translatorã¯ãJavaScriptã¢ããªã±ãŒã·ã§ã³ã§ã¯ãã€ãããããªãããšããã€ããã£ãŠããŸãã äŸïŒ
å®éãããã¯ã°ã©ãã®èšè¿°ã§ããããã®é ç¹ã¯ããŒãäžã®åã ã®äœçœ®ã§ãããå匧ïŒæ¹åä»ããããïŒã¯å³åœ¢ã移åã§ããæ¹åã§ãã ã°ã©ãã®é ç¹ã«é¢é£ä»ããããé åã«ç€ºãããæŽæ°ã¯ãã²ãŒã ã§äœ¿çšããããã¹ãŠã®äœçœ®ã®ç·åœ¢é åå ã®ãªãã»ãããè¡šããŸãïŒãªãã»ããå€ããŒãã®å Žåã¯ãã¢ãŒã¯ãçºçããŸããïŒã ãã®ã¢ãããŒãã䜿çšãããšãã©ã®æ¹åã®ããã²ãŒã·ã§ã³ã1ã€ã®ç®è¡å ç®ã«åæžãããŸãã
ããŠãåããè¡ããã¬ã€ã€ãŒã«å¿ããŠãåãã®æ¹åã«ãªãã·ã§ã³ã®å€æŽããããŸãïŒããããã察称æ§ãïŒãããã«ãããããšãã°ããã¹ãŠã®ããŒã³ïŒé»ãšçœã®äž¡æ¹ïŒã®åãããåããšããŠèšè¿°ããããšãã§ããŸãã 移åãé»ã§å®è¡ãããå Žåãæ¹åã¯èªåçã«ãåãã«å€æŽãããŸãã ããŒã察称æ§ãã«ãããåæ¹åã®ãå察ã®ãåããèšè¿°ããããšãã§ããŸãïŒå€ãã®ã²ãŒã ã§ããã¯äŸ¿å©ã§ãïŒã
ãããã¯ã¹ã¿ãã¯ãã·ã³ã³ãã³ãã§ãããããéåžžã«åçŽã§ãã ããšãã°ã PARAMã³ãã³ãã¯ãé²è¡ç¶æ³ãã³ãã¬ãŒãïŒäžé£ã®ã³ãã³ãïŒã«æ·»ä»ããããã©ã¡ãŒã¿ãŒã®é åããæ°å€ãååŸãããããã¹ã¿ãã¯ã«é 眮ããŸãã åãã®ãã¿ãŒã³ããã©ã¡ãŒã¿ãŒåããŠããã©ã¡ãŒã¿ãŒã§åãã®æ¹åãæž¡ãããšãã§ããŸãã
移åã®ãã¢ãŒããã¯3çªç®ã®ãã©ã¡ãŒã¿ãŒãšããŠæž¡ãããŸããããã¯ããã£ããã£ã®å®è¡ããããã§ãã«ãŒå ã®ãããµã€ã¬ã³ãã移åãåé¢ã§ããããã«ããæ°å€ã§ãã 3ã€ã®ãã¿ãŒã³å šäœïŒãã¿ãŒã³+ãã©ã¡ãŒã¿ãŒ+ã¹ãããŒã¯ã¢ãŒãïŒã¯ãããŒã¹ã«ãã£ãŠå®è¡ãããå¯èœæ§ã®ããåãã®1ã€ã®å®å šãªèª¬æãæ§æããŸãã
ã²ãŒã ããŒãã®ä»¥äžã®èª¬æ
(grid (start-rectangle 6 6 55 55) (dimensions ("a/b/c/d/e/f/g/h" (50 0)) ; files ("8/7/6/5/4/3/2/1" (0 50)) ; ranks ) (directions (n 0 -1) (s 0 1) (e 1 0) (w -1 0)) )
ã«ãªã£ãŠ...
design.addDirection("w"); design.addDirection("e"); design.addDirection("s"); design.addDirection("n"); design.addPosition("a8", [0, 1, 8, 0]); design.addPosition("b8", [-1, 1, 8, 0]); ...
å®éãããã¯ã°ã©ãã®èšè¿°ã§ããããã®é ç¹ã¯ããŒãäžã®åã ã®äœçœ®ã§ãããå匧ïŒæ¹åä»ããããïŒã¯å³åœ¢ã移åã§ããæ¹åã§ãã ã°ã©ãã®é ç¹ã«é¢é£ä»ããããé åã«ç€ºãããæŽæ°ã¯ãã²ãŒã ã§äœ¿çšããããã¹ãŠã®äœçœ®ã®ç·åœ¢é åå ã®ãªãã»ãããè¡šããŸãïŒãªãã»ããå€ããŒãã®å Žåã¯ãã¢ãŒã¯ãçºçããŸããïŒã ãã®ã¢ãããŒãã䜿çšãããšãã©ã®æ¹åã®ããã²ãŒã·ã§ã³ã1ã€ã®ç®è¡å ç®ã«åæžãããŸãã
ZrfDesign.navigate
ZrfDesign.prototype.navigate = function(aPlayer, aPos, aDir) { var dir = aDir; if (typeof this.players[aPlayer] !== "undefined") { dir = this.players[aPlayer][aDir]; } if (this.positions[aPos][dir] !== 0) { return aPos + this.positions[aPos][dir]; } else { return null; } }
ããŠãåããè¡ããã¬ã€ã€ãŒã«å¿ããŠãåãã®æ¹åã«ãªãã·ã§ã³ã®å€æŽããããŸãïŒããããã察称æ§ãïŒãããã«ãããããšãã°ããã¹ãŠã®ããŒã³ïŒé»ãšçœã®äž¡æ¹ïŒã®åãããåããšããŠèšè¿°ããããšãã§ããŸãã 移åãé»ã§å®è¡ãããå Žåãæ¹åã¯èªåçã«ãåãã«å€æŽãããŸãã ããŒã察称æ§ãã«ãããåæ¹åã®ãå察ã®ãåããèšè¿°ããããšãã§ããŸãïŒå€ãã®ã²ãŒã ã§ããã¯äŸ¿å©ã§ãïŒã
design.addPlayer("White", [1, 0, 3, 2]);
圢ç¶ã移åããããã®ã«ãŒã«ã¯ãããè€éã§ãã
ãã§ãã«ãŒã移åãã
(define checker-shift ( $1 (verify empty?) (if (in-zone? promotion) (add King) else add ) ))
ã«ãªã£ãŠ...
design.addCommand(1, ZRF.FUNCTION, 24); // from design.addCommand(1, ZRF.PARAM, 0); // $1 design.addCommand(1, ZRF.FUNCTION, 22); // navigate design.addCommand(1, ZRF.FUNCTION, 1); // empty? design.addCommand(1, ZRF.FUNCTION, 20); // verify design.addCommand(1, ZRF.IN_ZONE, 0); // promotion design.addCommand(1, ZRF.FUNCTION, 0); // not design.addCommand(1, ZRF.IF, 4); design.addCommand(1, ZRF.PROMOTE, 1); // King design.addCommand(1, ZRF.FUNCTION, 25); // to design.addCommand(1, ZRF.JUMP, 2); design.addCommand(1, ZRF.FUNCTION, 25); // to design.addCommand(1, ZRF.FUNCTION, 28); // end
ãããã¯ã¹ã¿ãã¯ãã·ã³ã³ãã³ãã§ãããããéåžžã«åçŽã§ãã ããšãã°ã PARAMã³ãã³ãã¯ãé²è¡ç¶æ³ãã³ãã¬ãŒãïŒäžé£ã®ã³ãã³ãïŒã«æ·»ä»ããããã©ã¡ãŒã¿ãŒã®é åããæ°å€ãååŸãããããã¹ã¿ãã¯ã«é 眮ããŸãã åãã®ãã¿ãŒã³ããã©ã¡ãŒã¿ãŒåããŠããã©ã¡ãŒã¿ãŒã§åãã®æ¹åãæž¡ãããšãã§ããŸãã
å³ã®èª¬æ
design.addPiece("Man", 0); design.addMove(0, 0, [3, 3], 0); design.addMove(0, 0, [0, 0], 0); design.addMove(0, 0, [1, 1], 0); design.addMove(0, 1, [3], 1); design.addMove(0, 1, [0], 1); design.addMove(0, 1, [1], 1);
移åã®ãã¢ãŒããã¯3çªç®ã®ãã©ã¡ãŒã¿ãŒãšããŠæž¡ãããŸããããã¯ããã£ããã£ã®å®è¡ããããã§ãã«ãŒå ã®ãããµã€ã¬ã³ãã移åãåé¢ã§ããããã«ããæ°å€ã§ãã 3ã€ã®ãã¿ãŒã³å šäœïŒãã¿ãŒã³+ãã©ã¡ãŒã¿ãŒ+ã¹ãããŒã¯ã¢ãŒãïŒã¯ãããŒã¹ã«ãã£ãŠå®è¡ãããå¯èœæ§ã®ããåãã®1ã€ã®å®å šãªèª¬æãæ§æããŸãã
Joclyã¯ãå€å žçãªMVCã¹ããŒã ã«åºã¥ããŠããŸãã æ°ããã²ãŒã ãéçºããã«ã¯ããã®ã¢ãã«ãšãã¬ãŒã³ããŒã·ã§ã³ãäœæããå¿ èŠããããŸãã ã¢ãã«ã¯ã²ãŒã ã®ã«ãŒã«ãå®çŸ©ãããã¬ãŒã³ããŒã·ã§ã³ã¯ã²ãŒã ããŠãŒã¶ãŒã«ã©ã®ããã«è¡šç€ºããããã§ãã éçºè ã«ãã£ãŠäœæãããã³ã³ãããŒã©ãŒããæ®ãã®éšåïŒã³ã³ãããŒã©ãŒã«æ¥ç¶ãããããããå«ãïŒãåŠçããŸãã
Z2Jã«ãã£ãŠå®è£ ããããŠãããŒãµã«ã¢ãã«ã®ã¢ãŒããã¯ãã£ãããã»ã©è€éã§ã¯ãããŸããã åºæ¬ã¯ãã²ãŒã ã®ã«ãŒã«ã®å€æŽãããŠããªã説æãå«ããã¶ã€ã³ã³ã³ããŒãã³ãã§ãã ã²ãŒã ã®ç¶æ ïŒããŒãäžã®ããŒã¹ã®é 眮ïŒã¯ã Boardã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ã«ä¿åãããŸãã ãããã®ã³ã³ããŒãã³ãã®ããŒã¿ãå€æŽãããŸããã 移åãå®è¡ããïŒ Moveãªããžã§ã¯ããBoardã«é©çšããïŒããšã«ãããæ°ããç¶æ ãäœæããŸãã å€ããã®ã¯å€ãããŸããïŒ
移åãçæããïŒ Moveãªããžã§ã¯ããäœæããïŒã«ã¯ã ããŒãã®çŸåšã®ç¶æ ã䜿çšãããŸãããZRFã®ãã¹ãŠã®æ©èœãå®çŸããã«ã¯äžååã§ãã åããçæããããã»ã¹ã§ãZRFã¯ã²ãŒã ç¶æ ã®äžéšã§ã¯ãªãå€æ°ïŒãã©ã°ãšäœçœ®ãã©ã°ïŒã䜿çšã§ããŸãã ãã®ãã¹ãŠãšã¹ã¿ãã¯ãã·ã³ã®ã³ãã³ããå®è¡ããããžãã¯ã¯ã Move Generatorã«ãã£ãŠåŠçãããŸãã èŠããã«ãããã¯zrf-model.jsã¢ãžã¥ãŒã«ã®ã¢ãŒããã¯ãã£ã§ã ã
æªéã®è©³çŽ°
ããã§ãJocly ã¢ãã«ã®ä»£ããã«ã ãã«ã³ã®ãã©ããã ã³ã³ãã€ã«ããŠæ§æãããã¢ãã«ïŒzrf-model.jsïŒãJoclyã«åã蟌ã¿ãã²ãŒã ã®ãã¬ãŒã³ããŒã·ã§ã³ãå€æŽããã«ããããã¹ãŠãå®è¡ããããšããŸããã æ¯ãè¿ã£ãŠã¿ããšããã®ã¢ã€ãã¢ã¯åéºçãªãã®ã ã£ãããšãããããŸãïŒçç±-以äžã§èª¬æããŸãïŒãããããç§ãå§ããçç±ã§ãã ã¢ãã«ã«ã¯å°ãå¿ èŠã§ããïŒ
- ã²ãŒã ã®çŸåšã®ç¶æ ã®ä¿å
- ã²ãŒã ã®çŸåšã®ç¶æ ã«æå¹ãªãã¹ãŠã®åãã®çæ
- çæãããåãã®1ã€ãé©çšããŠã²ãŒã ã®ç¶æ ãå€æŽãã
é£ããã£ãã®ã¯ãåžžã«ãã®åããããŒãäžã®ããŒã¹ã®1ã€ãåçŽã«åããããšã«ãªããšããããšã§ã¯ãããŸããã§ããã æãäžè¬çãªåœ¢åŒã§ã¯ã移åã¯æ¬¡ã®åºæ¬ã¢ã¯ã·ã§ã³ã®ã·ãŒã±ã³ã¹ã§æ§æãããŸãã
- move-ã·ã§ã€ããããäœçœ®ããå¥ã®äœçœ®ã«ç§»åããŸã
- ãã£ãã㣠-ããŒãäžã®ããããã®äœçœ®ããããŒã¹ãåé€ããŸã
- ãããã -ããŒãã«æ°ããããŒã¹ãè¿œå ïŒãªã»ããïŒããŸã
ããšãã°ããã§ãã«ãŒã§é§ãåãããšã¯ãé§ã®1ã€ã®åããšçžæã®é§ãåãããšã§æ§æãããŸãïŒãã®å Žåããã£ããã£ã¯é§ã®åãã®æçµäœçœ®ãšäžèŽããªãããããã£ããã£ã¯ããã§ã¹ãã§ã¯ãããŸããïŒã é£ç 㯠ãããŒãäžã®æ°åã1åæšãŠãã 移åäžã«ç§»åã§ããã®ã¯1åã ãã ãšèããŠã¯ãããŸããïŒ ãã®ããããã§ã¹ã§ãã£ã¹ãªã³ã°ãããšããã«ãŒã¯ãšãã³ã°ã¯ã1ã€ã®äžå¯åãªåãã®äžã§åæã«åããŸãã
ä»çµã¿
移åã®çæã¯ãæ£ããé åºã§å®è¡ãããåºæ¬ã¢ã¯ã·ã§ã³ã®ãªã¹ãã®åœ¢æã«éå®ãããŸãã ããã¯ãã¹ã¿ãã¯ãã·ã³ã³ãã³ãã®äžè²«ãã解éã«ãããŸããã
å¿ èŠãªæ¡ä»¶ã®ãã§ãã¯ã«é¢é£ãã詳现ïŒãã§ãã¯ã®äžã®ãã£ãŒã«ããèŠã€ãããªãã移ååã«æ°åããŸã 移åããŠãããªã©ïŒãçç¥ãããšãZRFã§è¡šãããçããã£ã¹ãå®è¡ã³ãŒãã¯æ¬¡ã®ããã«ãªããŸãã
ãã©ã¡ãŒã¿ãŒåãããããã²ãŒã·ã§ã³ã«å ããŠã fromã³ãã³ãïŒã¿ãŒã³ã®éå§æããã³ã«ã¹ã±ãŒãã³ãã³ãã®å®è¡æã«æé»çã«å®è¡ãããïŒã«ãã£ãŠååŸãããæ°åãã toã³ãã³ãïŒæé»çã«åœ¢æãããïŒã«ãã£ãŠç€ºããããã£ãŒã«ãã«ç§»åããããšã«ãªããŸãã ã³ãã³ããã³ãã©ãŒèªäœã¯åºæ¬çã«èŠããŸãã
ZrfMoveGenerator.generate
ZrfMoveGenerator.prototype.generate = function() { this.cmd = 0; while (this.cmd < this.template.commands.length) { var r = (this.template.commands[this.cmd++])(this); if (r === null) break; this.cmd += r; if (this.cmd < 0) break; } }
å¿ èŠãªæ¡ä»¶ã®ãã§ãã¯ã«é¢é£ãã詳现ïŒãã§ãã¯ã®äžã®ãã£ãŒã«ããèŠã€ãããªãã移ååã«æ°åããŸã 移åããŠãããªã©ïŒãçç¥ãããšãZRFã§è¡šãããçããã£ã¹ãå®è¡ã³ãŒãã¯æ¬¡ã®ããã«ãªããŸãã
ãã£ã¹ãªã³ã°
(define OO ( ee to e cascade ww add ))
ã«ãªã£ãŠ...
design.addCommand(0, ZRF.FUNCTION, 24); // from design.addCommand(0, ZRF.PARAM, 0); // e design.addCommand(0, ZRF.FUNCTION, 22); // navigate design.addCommand(0, ZRF.PARAM, 1); // e design.addCommand(0, ZRF.FUNCTION, 22); // navigate design.addCommand(0, ZRF.FUNCTION, 25); // to design.addCommand(0, ZRF.PARAM, 2); // e design.addCommand(0, ZRF.FUNCTION, 22); // navigate design.addCommand(0, ZRF.FUNCTION, 24); // from design.addCommand(0, ZRF.PARAM, 3); // w design.addCommand(0, ZRF.FUNCTION, 22); // navigate design.addCommand(0, ZRF.PARAM, 4); // w design.addCommand(0, ZRF.FUNCTION, 22); // navigate design.addCommand(0, ZRF.FUNCTION, 25); // to design.addCommand(0, ZRF.FUNCTION, 28); // end
ãã©ã¡ãŒã¿ãŒåãããããã²ãŒã·ã§ã³ã«å ããŠã fromã³ãã³ãïŒã¿ãŒã³ã®éå§æããã³ã«ã¹ã±ãŒãã³ãã³ãã®å®è¡æã«æé»çã«å®è¡ãããïŒã«ãã£ãŠååŸãããæ°åãã toã³ãã³ãïŒæé»çã«åœ¢æãããïŒã«ãã£ãŠç€ºããããã£ãŒã«ãã«ç§»åããããšã«ãªããŸãã ã³ãã³ããã³ãã©ãŒèªäœã¯åºæ¬çã«èŠããŸãã
Model.Move.ZRF_TO
Model.Game.functions[Model.Move.ZRF_TO] = function(aGen) { if (aGen.pos === null) { return null; } if (typeof aGen.piece === "undefined") { return null; } aGen.movePiece(aGen.from, aGen.pos, aGen.piece); delete aGen.from; delete aGen.piece; return 0; } ZrfMoveGenerator.prototype.movePiece = function(aFrom, aTo, aPiece) { this.move.movePiece(aFrom, aTo, aPiece, this.level); if (aFrom !== aTo) { this.setPiece(aFrom, null); } this.setPiece(aTo, aPiece); } ZrfMove.prototype.movePiece = function(from, to, piece, part) { this.actions.push([ from, to, piece, part ]); }
ããããããã¯ãã¹ãŠåé¡ã®äžéšã«ãããŸããïŒ ãã§ãã«ãŒã§ã¯ãããŒã¹ã¯ããã§ãŒã³ã«æ²¿ã£ãŠãããã€ãã®ãã£ããã£ãå®è¡ã§ããŸãïŒããã«çŸ©åä»ããããŠããŸãïŒã ãã¹ãŠã®ãã£ããã£ãå®äºãããŸã§ã移åã¯å¥ã®ãã¬ã€ã€ãŒã«è»¢éãããŸããã ã¢ãã«ã®èŠ³ç¹ãããããã³AIã®å Žåãããã¯1ã€ã®åãã§ãã ã³ã³ãããŒã©ãŒãšãã¬ãŒã³ããŒã·ã§ã³ã§ã¯ãäºæ ã¯ããå°ãè€éã§ãã ã²ãŒã ã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã§ã¯ãåãã§ãã«ãŒãã£ããã£ïŒéšå移åïŒãåå¥ã«å®è¡ããå¿ èŠããããŸãã ãŠãŒã¶ãŒïŒãã¬ã€ã€ãŒïŒã¯ãé·ãè€å移åã®å段éã§1ã€ãŸãã¯å¥ã®éšå移åãéžæã§ããå¿ èŠããããŸãã
ãã¡ããããããå¯äžã®å¯èœãªã¢ãããŒãã§ã¯ãããŸããã
Zillions of Gamesã§ã¯ãåéšåçãªåãã¯å¥ã
ã®åããšèŠãªãããŸãã ããã«ããããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãç°¡çŽ åãããŸãããäžæ¹ã§ãAIã®ç掻ãè€éã«ãªãã ãã§ãªããããæ·±å»ãªåé¡ã«ã€ãªãããŸãã
ããã¯ã2005幎ã«Claude Leroyã«ãã£ãŠéçºãããã²ãŒã ã Mana ãã§è€å移åãå®è¡ãããšãã«çºçããäœçœ®ã®ã·ãŒã±ã³ã¹ã瀺ããŠããŸãã ã²ãŒã ã®ã«ãŒã«ã«ããã°ãçœã®ããã§ã¯é£æ¥ãã空ã®äœçœ®ãŸã§æ°Žå¹³ãŸãã¯åçŽã«3ã€ã®é£ç¶ããã¹ããããèžãå¿ èŠããããŸãã ãã®å Žåããã¹ãŠã®æé ãå®è¡ããå¿ èŠããããå³ã¯ä»¥åã«æž¡ãããäœçœ®ã«æ»ãããšãçŠæ¢ãããŠããŸãã éšåçãªåãã®ééã£ãã·ãŒã±ã³ã¹ãéžæããããšã§ãäœåããè¡ãæ¢ãŸããã«é¥ãããšã容æã«ããããŸãã Zillions of Gamesã§ã¯ããã®åé¡ã¯è§£æ±ºã§ããŸããïŒ
ãã§ãã«ãŒã§ã¯ããã¹ãŠãç°¡åã§ããããŸããã ã»ãšãã©ãã¹ãŠã®åŸæ¥ã®ãã§ãã«ãŒã²ãŒã ïŒ Fanoronaãé€ã ïŒã§ã¯ããã®ãããªæ©äŒãããéãããã¬ãŒã€ãŒã¯æçšãç¶ãã矩åããããŸãã ã€ãŸãããã€ã¯ãå«ãéšåçãªç§»åãå®è¡ããŠãã 蚱容ãããè€åçãªç§»åãå®äºãããã©ããã¯ããããŸããã
ããã«ã åœéãã©ãããªã©ã®ãã©ããã²ãŒã ã®å€ãã§ã¯ããå€æ°æ±ºãã«ãŒã«ãæå¹ã«ãªã£ãŠãããããã«å¿ããŠããã¬ãŒã€ãŒã¯å¯èœãªéãå€ãã®å¯ŸæŠçžæã®ããŒã¹ãååŸãã矩åããããŸãã äžéšã®ã²ãŒã ã§ã¯ã女æ§ã®æ°ãå¢ããããšãåªå äºé ãšèŠãªãããã«æå®ãããŠããŸãã åéšåçãªåããåå¥ã«èæ ®ãããšãZillions of Gamesã¯ããªãã·ã§ã³ã®éæ³ãã«é ŒããããåŸãŸããã
ããŠããã®ããŒãã³ãŒããš...
è€åã ãŒãå šäœãå®å šã«å©çšã§ããå Žåããããåããã€ã¯ã®æ°ãåçŽã«èšç®ããããšã劚ãããã®ã¯äœããããŸããã
ããã¯ã2005幎ã«Claude Leroyã«ãã£ãŠéçºãããã²ãŒã ã Mana ãã§è€å移åãå®è¡ãããšãã«çºçããäœçœ®ã®ã·ãŒã±ã³ã¹ã瀺ããŠããŸãã ã²ãŒã ã®ã«ãŒã«ã«ããã°ãçœã®ããã§ã¯é£æ¥ãã空ã®äœçœ®ãŸã§æ°Žå¹³ãŸãã¯åçŽã«3ã€ã®é£ç¶ããã¹ããããèžãå¿ èŠããããŸãã ãã®å Žåããã¹ãŠã®æé ãå®è¡ããå¿ èŠããããå³ã¯ä»¥åã«æž¡ãããäœçœ®ã«æ»ãããšãçŠæ¢ãããŠããŸãã éšåçãªåãã®ééã£ãã·ãŒã±ã³ã¹ãéžæããããšã§ãäœåããè¡ãæ¢ãŸããã«é¥ãããšã容æã«ããããŸãã Zillions of Gamesã§ã¯ããã®åé¡ã¯è§£æ±ºã§ããŸããïŒ
ãã§ãã«ãŒã§ã¯ããã¹ãŠãç°¡åã§ããããŸããã ã»ãšãã©ãã¹ãŠã®åŸæ¥ã®ãã§ãã«ãŒã²ãŒã ïŒ Fanoronaãé€ã ïŒã§ã¯ããã®ãããªæ©äŒãããéãããã¬ãŒã€ãŒã¯æçšãç¶ãã矩åããããŸãã ã€ãŸãããã€ã¯ãå«ãéšåçãªç§»åãå®è¡ããŠãã 蚱容ãããè€åçãªç§»åãå®äºãããã©ããã¯ããããŸããã
ãã¡ãããããã¯æŠãããšãã§ããŸã...
ããããããã¯ãã§ã«éåžžã«é£æ³ããã...
''倪éœã®å€çŒã ''
(define checker-captured-find mark (if (on-board? $1) $1 (if (and enemy? (on-board? $1) (empty? $1) (not captured?)) (set-flag more-captures true) ) ) back ) (define king-captured-find mark (while (and (on-board? $1) (empty? $1)) $1 ) (if (on-board? $1) $1 (if (and enemy? (empty? $1) (not captured?)) (set-flag more-captures true) ) ) back ) (define checker-jump ( (verify (not captured?)) $1 (verify enemy?) (verify (not captured?)) $1 (verify empty?) (set-flag more-captures false) (if (in-zone? promotion) (king-captured-find $1) (king-captured-find $2) (king-captured-find $3) else (checker-captured-find $1) (checker-captured-find $2) (checker-captured-find $3) ) (if (flag? more-captures) (opposite $1) (markit) $1 ) (if (not (flag? more-captures)) (opposite $1) (if enemy? capture ) $1 (capture-all) ) (if (in-zone? promotion) (if (flag? more-captures) (add-partial King jumptype) else (add-partial King notype) ) else (if (flag? more-captures) (add-partial jumptype) else (add-partial notype) ) ) ))
ããã«ã åœéãã©ãããªã©ã®ãã©ããã²ãŒã ã®å€ãã§ã¯ããå€æ°æ±ºãã«ãŒã«ãæå¹ã«ãªã£ãŠãããããã«å¿ããŠããã¬ãŒã€ãŒã¯å¯èœãªéãå€ãã®å¯ŸæŠçžæã®ããŒã¹ãååŸãã矩åããããŸãã äžéšã®ã²ãŒã ã§ã¯ã女æ§ã®æ°ãå¢ããããšãåªå äºé ãšèŠãªãããã«æå®ãããŠããŸãã åéšåçãªåããåå¥ã«èæ ®ãããšãZillions of Gamesã¯ããªãã·ã§ã³ã®éæ³ãã«é ŒããããåŸãŸããã
- ïŒãªãã·ã§ã³ãéšåçã«æž¡ããtrueïŒ -ãã£ããã£ã®ãã§ãŒã³ãäžæããããšãã§ããŸã
- ïŒãªãã·ã§ã³ "æ倧ãã£ããã£" trueïŒ -æ倧æ°ã®æ°åãååŸããŸã
- ïŒãªãã·ã§ã³ãæ倧ãã£ããã£ã2ïŒ -女æ§ã®æ倧æ°ãååŸããŸãïŒååŸãã女æ§ã®æ°ãåãå Žå-æ倧æ°ã®æ°åãååŸããŸãïŒ
ããŠããã®ããŒãã³ãŒããš...
åæ§ã®ãã§ãã¯ãã©ã®ããã«å®è¡ãããã
if(aGame.g.captureLongestLine) { var moves0=this.mMoves; var moves1=[]; var bestLength=0; for(var i in moves0) { var move=moves0[i]; if(move.pos.length==bestLength) moves1.push(move); else if(move.pos.length>bestLength) { moves1=[move]; bestLength=move.pos.length; } } this.mMoves=moves1; }
è€åã ãŒãå šäœãå®å šã«å©çšã§ããå Žåããããåããã€ã¯ã®æ°ãåçŽã«èšç®ããããšã劚ãããã®ã¯äœããããŸããã
è€åã¹ãããŒã¯ã®çæã¯ãZrfMoveGeneratorã®æãåçŽãªã¢ããªã±ãŒã·ã§ã³ã§ãã ãžã§ãã¬ãŒã¿ãŒã®åã€ã³ã¹ã¿ã³ã¹ã¯ç¬èªã®éšåã¹ãããŒã¯ã圢æããéšåã¹ãããŒã¯èªäœã¯è€åã¹ãããŒã¯ã®ããã§ãŒã³ãã«ãªã³ã¯ãããŸãã æ®å¿µãªãããããã¯ZRFã移åã決å®ããããã«äœ¿çšã§ããå¯äžã®æ¹æ³ã§ã¯ãããŸããã ãã§ã¹ã® 象 ã ã«ãŒã¯ ã ã¯ã€ãŒã³ãªã©ã空ã®ãã£ãŒã«ããäžæ¹åã«ç§»åããããŒã¹ã説æããéåžžã«åçŽãªã±ãŒã¹ãèããŠã¿ãŸãããã
ãã§ã¹ã©ã€ããŒ
(define slide ( $1 (while empty? add $1) (verify enemy?) add ))
移åã®åœ¢æãå®äºããaddã³ãã³ããã«ãŒãã®æ¬äœã§äœ¿çšãããŠããããšãããããŸãã ããã¯ãæµã®é§ãžã®ã«ãŒãã«æ²¿ã£ãŠãé§ã空ã®ãã£ãŒã«ãã§åæ¢ã§ããããšãæå³ããŸãïŒããã¯æ£ããåããšèŠãªãããŸãïŒã ãã¡ãããå®çŸ©ãæžãçŽãããšã§ãã®ãããªãµã€ã¯ã«ãåãé€ãããšãã§ããŸãïŒ
ZRFã®äžéšã®ã²ãŒã ã§ã¯ããã®æ¹æ³ã䜿çšããå¿
èŠããããŸã
(define slide-1 ( $1 (verify enemy?) add )) (define slide-2 ( $1 (verify empty?) $1 (verify enemy?) add )) (define slide-3 ( $1 (verify empty?) $1 (verify empty?) $1 (verify enemy?) add )) ...
ã«ãŒãã®æ¬äœã§å®è¡ãããaddã³ãã³ãã¯ãé決å®çãªåãã®åœ¢æã«ã€ãªãããŸãã å³ãåæ¢ããããå ã«é²ãå ŽåããããŸãã ZrfMoveGeneratorã®å Žåãããã¯ã¯ããŒãã³ã°ã®å¿ èŠæ§ãæå³ããŸãã ãžã§ãã¬ãŒã¿ãŒã¯ãã®ç¶æ ã®å®å šãªã³ããŒãäœæããåŸç¶ã®çæã®ããã«ã¹ã¿ãã¯ã«é 眮ããŸãããã®åŸãçŸåšã®ã³ããŒã移åã®åœ¢æãå®äºããŸãã ããã¯æ¬¡ã®ãããªãã®ã§ãã
åã女
(define king-shift ( $1 (while empty? add $1 ) ))
ã«ãªããŸã...
design.addCommand(3, ZRF.FUNCTION, 24); // from design.addCommand(3, ZRF.PARAM, 0); // $1 design.addCommand(3, ZRF.FUNCTION, 22); // navigate design.addCommand(3, ZRF.FUNCTION, 1); // empty? design.addCommand(3, ZRF.FUNCTION, 0); // not design.addCommand(3, ZRF.IF, 7); design.addCommand(3, ZRF.FORK, 3); design.addCommand(3, ZRF.FUNCTION, 25); // to design.addCommand(3, ZRF.FUNCTION, 28); // end design.addCommand(3, ZRF.PARAM, 1); // $2 design.addCommand(3, ZRF.FUNCTION, 22); // navigate design.addCommand(3, ZRF.JUMP, -8); design.addCommand(3, ZRF.FUNCTION, 28); // end
FORKã³ãã³ãã¯ããã¹ãŠã®çŸåšã®ç¶æ ãšãšãã«ç§»åãžã§ãã¬ãŒã¿ãŒãè€è£œããæ¡ä»¶ä»ããžã£ã³ããšããŠæ©èœããŸãã çæããããžã§ãã¬ãŒã¿ãŒã§ã¯ãå¶åŸ¡ã¯æ¬¡ã®ã³ãã³ãã«é²ã¿ã芪ã¯ãã©ã¡ãŒã¿ãŒã§æå®ãããã¹ãããæ°ã«å¶åŸ¡ã移ããŸãïŒã¯ããLinuxã§ã®ããã»ã¹ã®äœæã«éåžžã«äŒŒãŠããŸãïŒã
äºææ§ã®è² æ
ã²ãŒã ã®ZRFèšè¿°ãJavaScriptã«ãå€æãããåŸã«æ©èœããããã«ã¯ãåæ§ã®ã³ãã³ããåãé åºã§å®è¡ããã ãã§ã¯äžååã§ãã æäœã®ã»ãã³ãã£ã¯ã¹ïŒããŒãã®ç¶æ
ãšã®çžäºäœçšã«é¢ããŠïŒã¯ãZillions of Gamesã§äœ¿çšãããŠãããã®ãšå®å
šã«äžèŽããå¿
èŠããããŸãã åé¡ã®å®å
šãªè€éããæ³åã§ããããã«ãäž»ãªç¹ãç°¡åã«ãªã¹ãããŸãã
ããã¯å®å šãªãªã¹ãã§ã¯ãããŸããã é ã«æµ®ããã æåã®ããšã ããã«ã移åå¯èœãªãã¹ãŠã®ããŒã¹ãåæãããµã€ã¯ã«ãå®è£ ããå¿ èŠããããŸãïŒZillions of Gamesã§ã¯ããã¬ãŒã€ãŒã¯èªåã®ããŒã¹ã®ã¿ã移åã§ããŸãïŒããŸããããŒã¹ãããªã»ãããã§ãããã¹ãŠã®ç©ºã®ãã£ãŒã«ããåæããå¿ èŠããããŸãã
ã¢ã«ãŽãªãºã ã¯ã移åã®ç¶ç¶ãçãããã¬ãã£ãã¯ã¹ãããäžæžããããããã«èšèšãããŠããŸãïŒãã¡ãããã éšåãã¹ãæž¡ã ããªãã·ã§ã³ãæå¹ã«ãªã£ãŠããªãå ŽåïŒã
- 移åã®çæäžãããŒãã¯çæãéå§ãããæç¹ã®ç¶æ ã§å©çšå¯èœã§ãã 移åããå³ã¯ãœãŒã¹ãã£ãŒã«ãããåé€ãããããã¡ããçŸåšã®å³ã«èšå®ãããŸããã ãã®èŠä»¶ã¯ç解ã§ããŸããïŒç¹ã«ãåç· åœ¹äŒã®å 責ãæãåºãå ŽåïŒãå®éã®ç掻ã§ã¯éåžžã«äžäŸ¿ã§ãã
- ãã©ã°ïŒãããå€æ°ïŒãšäœçœ®ãã©ã°ïŒç¹å®ã®äœçœ®ã«é¢é£ä»ãããããããå€æ°ïŒã®ã¹ããŒã¿ã¹ã¯ã移åãçæããããã»ã¹ã§ã®ã¿äœ¿çšã§ããŸãã Zillions of Gamesã®å Žåãåéšåçãªåããå¥ã ã®åããšèŠãªããŸããããã«ããããããã®æçšæ§ãå€§å¹ ã«äœäžããŸããããã¹ãŠãæ©èœããããã«ã¯åæ§ã®ã»ãã³ãã£ã¯ã¹ãæäŸããå¿ èŠããããŸãã
- å±æ§ïŒã·ã§ã€ãã«ã¢ã¿ãããããããããã©ã°ïŒã®ã¹ãã¬ãŒãžã¯ãã¹ãããŒã¯ã®çæã«éå®ãããŸããã å±æ§ã¯ãããŒãã®ç¶æ ã®äžéšã§ãã ã¡ãªã¿ã«ããã£ã®ã¥ã¢èªäœãå ç«æ§ããããå±æ§ãå€æŽãããšãæ°ãããã£ã®ã¥ã¢ãäœæãããŸãã
- ããŒãã®ç¶æ ã¯ã ãŒãçæã®éå§æã«å©çšå¯èœã§ãããããããŒã¹ã®æåã®å Žæã®å Žæã§ã®ã¿å±æ§ãèªã¿åãããšãã§ããŸãããå±æ§ãå€æŽããå Žåã¯ãããŒã¹ã移åãå®äºããäœçœ®ã§ãããè¡ãå¿ èŠããããŸãïŒã€ãŸãã移åã®æåŸã«ãªããŸãïŒã å¥ã®ãã£ãŒã«ãïŒããšãã°ããœãŒã¹ïŒã®å±æ§ãå€æŽããŠããèŽåœçãªãšã©ãŒã¯çºçããŸããã å€ã¯åã«èšå®ãããŠããŸããã
- é£é移åã¯ã移åã®ã¯ããŒã³äœææã«éä¿¡ãããŸããã ãããããããã¯éä¿¡ãããŸãããã ã«ã¹ã±ãŒãã®ç Žæ£ ããªãã·ã§ã³ãç¡å¹ã«ãªã£ãŠããå Žåã®ã¿ã§ãã ããã䜿çšãããŠããã²ãŒã ãèŠãããšããããŸããïŒ
- äžéãã£ããã£ãšããŒã¹ã®ãã³ãããã¯ããŒã³ãããã ãŒãã«è»¢éãããŸããã ãã®çµæããã·ã¢ã®ãã©ããã§å¥³çãæãŸããããšã¯æ¬åœã®ããºã«ã«ãªããŸãïŒãµã€ã¯ã«ã§å®è¡ãããaddã³ãã³ãã§ç§»åãå®äºããå¯èœæ§ã®ãããã€ã³ããããåã«ãžã£ã³ãããæµã®ãã£ã®ã¥ã¢ã奪ãããã«æ»ãå¿ èŠããããŸãã
- åã移åã§ã¿ã€ããå±æ§å€ããŸãã¯ææè ãå€æŽãããããŒã¹ãååŸããããšã¯ã§ããŸããïŒ ãã°ã«äŒŒãŠããŸãããæ²ããåèªãæ¶å»ããããšã¯ãããŸããã
- ããŒã¹ãå«ãäœçœ®ã§ç§»åãçµäºãããšãããã§ã¹ãã£ããã£ããèªåçã«å®è¡ãããŸãã åããã£ãŒã«ãã§ãã£ããã£ã³ãã³ããæ瀺çã«åŒã³åºããšã移åãå®è¡ããããŒã¹ãåé€ãããŸãïŒãã®æ¹æ³ã§ç¥é¢šã®ããŒã¹ãäœæã§ããŸãïŒã åæ§ã«ïŒ createã³ãã³ãã䜿çšã㊠ïŒãFigureã®ã¿ã€ããšææè ãå€æŽã§ããŸãã
- æ®ã眮ããã£ããã£ã®ãªãã·ã§ã³ãæå¹ã«ãªã£ãŠããå Žåãã³ãŒã¹ãç¶ç¶ããŠããéãããŒã¹ã®ãã¹ãŠã®ãã£ããã£ãè€å移åã®æåŸã®éšå移åã«ç§»åããå¿ èŠããããŸãã æãããªçç±ã§ããã®ãªãã·ã§ã³ã¯ZRFã«ã¯å«ãŸããŠããŸããããå¿ èŠãªå Žåã¯éåžžã«äžè¶³ããŠããŸãã ZRFã§ã®ã ãã«ã³ã¹ãã©ã€ã ãã«ãŒã«ã®å®è£ ã¯ãèŠçã®äžåœ¢æ ã§ãã 幞ããªããšã«ãç§ãã¡ã¯å šäœã®åããæ€èšããŠããŸãã ãããªäŸ¿å©ãªãªãã·ã§ã³ãå®è£ ããŠã¿ãŸãããïŒ
ããã¯å®å šãªãªã¹ãã§ã¯ãããŸããã é ã«æµ®ããã æåã®ããšã ããã«ã移åå¯èœãªãã¹ãŠã®ããŒã¹ãåæãããµã€ã¯ã«ãå®è£ ããå¿ èŠããããŸãïŒZillions of Gamesã§ã¯ããã¬ãŒã€ãŒã¯èªåã®ããŒã¹ã®ã¿ã移åã§ããŸãïŒããŸããããŒã¹ãããªã»ãããã§ãããã¹ãŠã®ç©ºã®ãã£ãŒã«ããåæããå¿ èŠããããŸãã
ãã¹ãŠäžç·ã«ããã®ãããªãã®ã«ãªããŸã
var CompleteMove = function(board, gen) { var t = 1; if (Model.Game.passPartial === true) { t = 2; } for (var pos in board.pieces) { var piece = board.pieces[pos]; if ((piece.player === board.player) || (Model.Game.sharedPieces === true)) { for (var move in Model.Game.design.pieces[piece.type]) { if ((move.type === 0) && (move.mode === gen.mode)) { var g = f.copy(move.template, move.params); if (t > 0) { g.moveType = t; g.generate(); if (g.moveType === 0) { CompleteMove(board, g); } } else { board.addFork(g); } t = 0; } } } } } ZrfBoard.prototype.generateInternal = function(callback, cont) { this.forks = []; if ((this.moves.length === 0) && (Model.Game.design.failed !== true)) { var mx = null; for (var pos in this.pieces) { var piece = this.pieces[pos]; if ((piece.player === this.player) || (Model.Game.sharedPieces === true)) { for (var move in Model.Game.design.pieces[piece.type]) { if (move.type === 0) { var g = Model.Game.createGen(move.template, move.params); g.init(this, pos); this.addFork(g); if (Model.Game.design.modes.length > 0) { var ix = Model.find(Model.Game.design.modes, move.mode); if (ix >= 0) { if ((mx === null) || (ix < mx)) { mx = ix; } } } } } } } for (var tp in Model.Game.design.pieces) { for (var pos in Model.Game.design.positions) { for (var move in Model.Game.design.pieces[tp]) { if (move.type === 1) { var g = Model.Game.createGen(move.template, move.params); g.init(this, pos); g.piece = new ZrfPiece(tp, this.player); g.from = null; g.mode = move.mode; this.addFork(g); if (Model.Game.design.modes.length > 0) { var ix = Model.find(Model.Game.design.modes, move.mode); if (ix >= 0) { if ((mx === null) || (ix < mx)) { mx = ix; } } } } } } } while ((this.forks.length > 0) && (callback.checkContinue() === true)) { var f = this.forks.shift(); if ((mx === null) || (Model.Game.design.modes[mx] === f.mode)) { f.generate(); if ((cont === true) && (f.moveType === 0)) { CompleteMove(this, f); } } } if (cont === true) { Model.Game.CheckInvariants(this); Model.Game.PostActions(this); if (Model.Game.passTurn === 1) { this.moves.push(new ZrfMove()); } if (Model.Game.passTurn === 2) { if (this.moves.length === 0) { this.moves.push(new ZrfMove()); } } } } if (this.moves.length === 0) { this.player = 0; } return this.moves; }
ã¢ã«ãŽãªãºã ã¯ã移åã®ç¶ç¶ãçãããã¬ãã£ãã¯ã¹ãããäžæžããããããã«èšèšãããŠããŸãïŒãã¡ãããã éšåãã¹ãæž¡ã ããªãã·ã§ã³ãæå¹ã«ãªã£ãŠããªãå ŽåïŒã
ãããã®2ã€ã®æ¹æ³ïŒã ãŒããžã§ãã¬ãŒã¿ãŒããã§ãŒã³ã«é 眮ããŠã¯ããŒã³ãäœæããïŒã䜿çšãããšãZRFèšèªæ§é ãå®è£ ã§ããŸãã ãã¡ãããå®è£ ã¯ç°¡åã§ã¯ãªããZRFã»ãã³ãã£ã¯ã¹ãšã®äºææ§ã確ä¿ããå¿ èŠããããããããªãæ··ä¹±ããŸãã ã³ãŒããæ©èœããå Žåãããã¯å€§ããªåé¡ã§ã¯ãããŸããã åé¡ã¯ãZRFèªäœãå®ç§ãšã¯ã»ã©é ãããšã§ãïŒ
éããæ
ä»å¹Žã¯å€±æããå§ãŸããŸããã ãããããç§ãç¥ã£ãŠãããã¹ãŠã®ããŒãã²ãŒã ã®ç°¡åãªèª¬æã«é©ãããŠãããŒãµã«DSL ãäœæããããšã㊠ãç§ã¯ç«ã¡æ¢ãŸã£ãŠããŸãã æ®éçã«ãååãšããŠããç解ã§ãããããšãå€æããŸãã-ãããã Fanoronaãªã©ã®æ¯èŒçåçŽãªã²ãŒã ã§ãããäœããã®ææã§èªåèªèº«ãè¡šçŸããããšåªåããŸããã
ãã®ããã«
ïŒ*ïŒ[p] |ïŒïŒ\ 1 [ex]ïŒ*;ã1ïŒã1 [ex]ïŒ*ïŒ
ZRFã§ããããæ確ã«èŠããŸã
(define approach-capture ( $1 (verify empty?) to $1 (verify enemy?) capture (while (enemy? $1) $1 capture) (add-partial capturing) )) (define withdrawl-capture ( $1 (verify empty?) to back (opposite $1) (verify enemy?) capture (while (enemy? (opposite $1)) (opposite $1) capture) (add-partial capturing) ))
C Joclyãã©ãããããããå°ããªãã£ããç§ã¯ãã®ã¢ãŒããã¯ãã£ã奜ãã§ã¯ãããŸããã§ããããŸããå¯å€Model.Boardã·ã³ã°ã«ãã³ã䜿çšããŠãããŒãã®ç¶æ ãä¿åããŸãããã®AIãããã®äœ¿çšæ¹æ³-æ³åã§ããŸãããããããäž»ãªããšã¯ããã§ãããããŸããããã®äžã®1ã€ã®ã¢ãã«ã¯ãä»ã®ã¢ãã«ãšã¯ãŸã£ããç°ãªããŸãïŒåã«å ±éç¹ã¯ãããŸããïŒãåæã«ãmWhoãmMovesã®ããã«ãããžãã¯ãã¡ã³ããŒãç©æ¥µçã«äœ¿çšããããã¥ãŒã¯ã¢ãã«ãã³ã³ãããŒã©ãŒãšåçã«äœ¿çšããããããã¢ãã«ãã©ã®ããã«æ§æãããŠãããããç¥ã£ãŠãããå¿ èŠããããŸãã
ã¢ãã«ãã眮ãæããããšããç§ã®åžæã¯ãäºåã«å€±æããéåœã«ãããŸããïŒã€ãŸããç§ã«ã¯ããã¯ããªãå¯èœã§ãããšçœ®ãæããããšãã§ããã®ã¢ãã«ããã«ã³ãã§ãã«ãŒãã察å¿ããããã©ãŒãã³ã¹ã圌女ãšé£åããããã«ãªããŸããããä»ã®ã²ãŒã ïŒãè±èªãã©ãããã§ãïŒã§ã¯ãããã«ã³ãã©ãããã®ã¢ãã«ãéåžžã«ç°ãªããããæåããããçŽãå¿ èŠããããŸããæºåãã§ããŠããªãããšã«æ°ä»ããŸãããã¢ãã«ã«å ããŠããŸããŸãçºå±ãã¬ãŒã³ããŒã·ã§ã³ã«åŸäºããæ·±ãäžæ³ã«ãã£ãããããŠããã®åŸãä»äºãé¢äžãžã§ããã¯ãšå°å¹³ç·äžã«å°ãæããã
æã ã¯Joclyãšçµ±åããäžè¶³ããŠãããããã¯ãŒã¯ãšããŒã«ã«ã²ãŒã çšã³ã³ãããŒã©ïŒã ãã§ãªãããŠãŒãã£ãªãã£ã®èªååçã詳ãã説æããããšããŠãããããããšã«ããŸããïŒãpred tavleniyaïŒ2Dããã³3DïŒã ãã§ãªããèªåèªèº«ã«ïŒåšåº«ããïŒãããããããŠããã®ãã¹ãŠã®äœæ¥ãè¡ãããšã«åæãããžã§ããã¯ã¢ãã«ã«åãçµãããšã«éäžã§ããããã«ãç§ãæåã«ããããšã¯ãJoclyã®ç¶æ¿ãããæããªå¶éãåãé€ãããšã§ãããã¯ããçŸåšãã®ã¢ãã«ã¯3人以äžã®ãã¬ãŒã€ãŒã®ã²ãŒã ããµããŒãããŠããŸãïŒãããŠãç§ã¯å³ãåŸãŸãã...
ããã¯ç§ãèšç»ãããªãã·ã§ã³ã®ãªã¹ãã§ãã
- maximal-captures = true â ( « »)
- pass-partial = true â ( «»)
- pass-turn = true â
- pass-turn = forced â
- discard-cascades = true â
- include-off-pieces = true â
- recycle-captures = true â
- smart-moves = true â «» UI ( )
- smart-moves = from â
- smart-moves = to â
- zrf-advanced = true â zrf-advanced
- zrf-advanced = simple â
- zrf-advanced = fork â ZRF_FORK
- zrf-advanced = composite â
- zrf-advanced = mark â mark/back
- zrf-advanced = delayed â « » ( , )
- zrf-advanced = last â last-from last-to
- zrf-advanced = shared â ( « »)
- zrf-advanced = partial â ,
- zrf-advanced = numeric â ( «»)
- zrf-advanced = foreach â foreach
- zrf-advanced = repeat â ( )
- zrf-advanced = player â , ,
- zrf-advanced = global â ( Axiom)
- board-model = heap â ( )
- board-model = stack â ( « »)
- board-model = quantum â ( )
ç§ãZRFã®å¶éãæ°ã«å ¥ããªããšèšããŸãããïŒãããã®ãªãã·ã§ã³ã®ããäžéšã¯ãç¶æããå¿ èŠãããã¬ã¬ã·ãŒã®ç¡æ°ã®ã²ãŒã èšå®ã§ããæ®ãã¯ãZRFã§ã¯ãããŸã§èŠãããªãã£ãæ¡åŒµæ©èœã§ãããããã£ãŠããã¹ãŠã®zrf-advancedãªãã·ã§ã³ïŒ1ã€ã®ã³ãã³ãã§ãããããã¹ãŠæå¹ã«ããããšãã§ããŸãïŒ-ZRFã»ãã³ãã£ã¯ã¹ãæ¡åŒµããŠãã䟿å©ã«ãïŒZillions of Games ãŠãŒã¶ãŒã®åžæ ãèæ ®ããããšããŸããïŒãããŒãã¢ãã«ãªãã·ã§ã³ã¯æ°ããã¿ã€ãã®ããŒããå°å ¥ããŸãã
ããã«ã€ããŠè©³ãã説æãã䟡å€ããããŸãã
ãªãã·ã§ã³èªäœã¯ãããŒãå¯èœãªJavaScriptã¢ãžã¥ãŒã«ãšããŠå®è£ ãããŸããããšãã°ãã²ãŒã å ïŒãåœéãã©ããããªã©ïŒã§æ倧æ°ã®ããŒã¹ãååŸããå¿ èŠãããå Žåãzrf-modelãããŒãããåŸã察å¿ããã¢ãžã¥ãŒã«ãããŒãããå¿ èŠããããŸããã¢ãžã¥ãŒã«ã¯ãcheckVersioné¢æ°ã䜿çšããŠæ¥ç¶ãããŸãã
ZRFãã¡ã€ã«
... (option "maximal captures" true) ...
JavaScriptãã¡ã€ã«å
... design.checkVersion("z2j", "1"); design.checkVersion("zrf", "2.0"); design.checkVersion("maximal-captures", "true"); ...
ã¢ãã«ã¯ãèŠæ±ãããã¢ãžã¥ãŒã«ã®ããŒãžã§ã³ã®äºææ§ããã§ãã¯ããé©åãªãªãã·ã§ã³ãæ¥ç¶ããŸãããã®æ¡åŒµå¯èœãªã¡ã«ããºã ã¯ãç§ã«èå³æ·±ãèããäžããŸãããäžéšã®ã²ãŒã ã§ã¯ãZRFã䜿çšããŠå®è£ ããã®ãéåžžã«é£ããã«ãŒã«ããããŸããã»ãšãã©ã®å Žåããããã®ã«ãŒã«ã¯ã1ã€ãŸãã¯å¥ã®ç§»åãå®äºããæ©èœã«åœ±é¿ããè¿œå ã®ãã§ãã¯ã«ãªããŸããããŒãããããªãã·ã§ã³ã«ãã§ãã¯ãå ¥ãããšãå®è£ ã®ããã«ããŒã¹èšèªãæ¡åŒµããå¿ èŠããªããªããŸãïŒç°¡åã§ã¯ãããŸããïŒã
Zillions of Gamesã®éçºè
ãåãããã«é²ãã ããšã¯æ³šç®ã«å€ããŸãã
, ( ) ZRF ( ), AI, Zillions of Games, . «» , DLL-. API AI, .
Axiom Development Kit â , , , ForthScript. Zillions of Games, . JavaScript, . , !
Axiom Development Kit â , , , ForthScript. Zillions of Games, . JavaScript, . , !
äŸã§èª¬æããŸãããããããªããã«ã³ã®èæ¡ãããããæè¿åŠãã ããããŒã¬ãŒã³ãã§ãã«ãŒããšãã«ã³ã®ãã§ãã«ãŒã®å¯äžã®éãã¯ãæµã®æ»æãä»æããããšã«ãã察å¿ãçŠæ¢ãããŠããããšã§ããæ»æããŠãããã£ã®ã¥ã¢ãé£ã¹ãããææããéããããšã¯ã§ããŸãããããã«å¿ããŠå¥ã®ãã£ã®ã¥ã¢ãæ»æããããšã¯ã§ããŸããïŒãã®ã«ãŒã«ã¯å¥³æ§ã«ãé©çšãããããšãèæ ®ãããšãZRFã§ã®ãã®ã²ãŒã ã®å®è£ ã¯ããªãè€éã§ãããæãéèŠãªããšãšããŠãéåžžã«ãéæãã§ã¯ãããŸããã§ãããããããæ¡åŒµå¯èœãªãªãã·ã§ã³ã䜿çšããã°ãZRFã®ã³ãŒããè€éã«ããå¿ èŠã¯ãããŸããïŒ
ããŒã¬ãŒã³ã»ããã
(variant (title "Bahrain Dama") (option "bahrain dama extension" true) )
ããã«ã³ã®ãã§ãã«ãŒããåããå¿ èŠãªãã§ãã¯ãå®è¡ãããªãã·ã§ã³ãæ¥ç¶ã§ããŸããããŒãå¯èœãªã¢ãžã¥ãŒã«ã¯ãã¹ãããŒã¯ã®åŸåŠçã¡ãœããã眮ãæããå¿ èŠã«å¿ããŠã以åã«çæãããåããçŠæ¢ããå ŽåããããŸãïŒæ€èšŒããžãã¯èªäœã¯ä»»æã«è€éã«ãªãå¯èœæ§ããããŸãããZRFã§ã®åæ§ã®å®è£ ãããæ確ã§ãïŒåé¡ã¯ããã§ã«çæããã移åã®è¿œå æ€èšŒã«éå®ãããŸããããªãã·ã§ã³ã§åãããè±ãã«ãããããšãã§ããŸãïŒããšãã°ãGoã§ç§»åãå®è¡ãããšãã¯ã次ãå®è¡ããå¿ èŠããããŸãã
- é£æ¥ãã4ã€ã®ç³ã確èªããŸãïŒããŒãã®å¢çã«3ã€ããŸãã¯è§ã«2ã€ïŒã
- é£æ¥ããç³ãæµã®ãã®ã§ããå Žåããæ¥ç¶ããããç³ã®ã°ã«ãŒããæ§ç¯ãããã®äžã«ç³ãå ¥ããŠããã®æ°ãæ°ããŸãïŒã°ã«ãŒããæ¥ããèªç±ãã€ã³ãïŒã
- æµã°ã«ãŒããããªãŒãã€ã³ãã«æ¥ããŠããªãå Žåã¯ããã®ç³ããã¹ãŠåãé€ããŸãã
- æµã°ã«ãŒããã©ããåé€ãããŠããªãå Žåã¯ãè¿œå ããã°ããã®ç³ãå«ãã°ã«ãŒããäœæããŸã
- æ§ç¯ãããã°ã«ãŒãã«è²Žå©Šäººãããªãå Žåã移åãçŠæ¢ããŸãïŒå³å¯ã«èšãã°ãåžžã«ã§ã¯ãããŸãããã€ã³ã¬ã®ã«ãŒã«ã¯ãè€æ°ã®ç³ã§æ§æãããã°ã«ãŒãã®èªæ®ºãèš±å¯ããŸãïŒã
ãããã¯ãã¹ãŠJavaScriptæ¡åŒµæ©èœã§ãé衚瀺ãã«ã§ããŸããå¿ èŠãªãã§ãã¯ãå®è¡ããã ãã§ãªããæµã®ç³ãåãé€ãããšã§åããè£å®ããŸããã²ãŒã ã®ZRFèšè¿°ãåºæ¬ã«ãªããŸãïŒããã«ããã®æ¡åŒµæ©èœã¯ä»ã®ã²ãŒã ã«ãé©ããŠããŸãïŒããšãã°ããMulticolor Goãã®å Žå
è€æ°ã®åã...
æ¡åŒµå¯èœãªãªãã·ã§ã³ã«ããããããžã§ã¯ããæ°ããèŠç¹ããèŠãããšãã§ããŸãããã1ã€ã®å°ããªã¿ã¹ã¯ã«æ©ãŸãããŠããŸãããããã€ãã®ã²ãŒã ã§ã¯ãäžå®ã®æ¡ä»¶ã®äžã§ãããŒãã®ãã£ããã£èš±å¯ããããã®å¯ŸæŠçžæã®é§ããããšãã°ããå·¥å Žãã§ã¯ïŒ
- ãã¬ãŒã€ãŒã¯ããŒãã«çœ®ããŠèªåã®é§ãåããã3ã€ã®é§ããäžåã«ã䞊ã¹ãããšããŸãã
- ãããæåããå Žåããã¬ãŒã€ãŒã¯ããŒãããæµã®é§ãåãé€ãæš©å©ãç²åŸããŸãã
- åæã«ããåã«äžŠãã§ããªããæ°åãåªå ããå¿ èŠããããŸãïŒåãæ§æããæ°åã¯æåŸã«ååŸãããŸãïŒã
- ãã¬ã€ã€ãŒã«3ã€ã®ããŒã¹ãæ®ã£ãŠããå ŽåãããŒãäžã®ä»»æã®å ŽæïŒããŒã¯ãããã©ã€ã³ã«æ²¿ã£ãŠã ãã§ãªãïŒã移åããæ©äŒããããŸãã
- æ®ã3åæªæºã®ãã¬ã€ã€ãŒã¯è² ããŠããŸãã
ããã¯ããããZRFã§å®è¡å¯èœã§ã¯ãªããšããããšã§ã¯ãããŸããããã³ãŒãã¯éåžžã«çŽããããã§ãããŸããäžè¬çã«ãæ®åœ±ãããŠããæ°åãé€ããŠã»ãšãã©ãã¹ãŠã§åäžã§ããäžé£ã®åãã®çæã¯ãããªãéå±ãªæ±ºå®ã§ãã移åã®ã¢ã¯ã·ã§ã³ã§äœçœ®ã®é åã䜿çšã§ããã°ãã¯ããã«äŸ¿å©ã ãšæããŸããã
ZrfMove.prototype.capturePiece = function(pos, part) { - this.actions.push([ pos, null, null, part]); + this.actions.push([ [pos], null, null, part]); }
ããã¯ããªãã°ããŒãã«ãªã³ãŒãã®åèšèšã§ãããããŠããããã¹ããåã³åœ¹ç«ã¡ãŸããããããŸã§ã®ãšãããã²ãŒã ã®æãåçŽãªZRFèšè¿°ã«ãã£ãŠåœ¢æãããåãã®ã匷åãã®äžéšãšããŠãJavaScriptæ¡åŒµããã®ã¿ãã®ãããªé決å®çãªåãã圢æããããšãèšç»ãããŠããŸããããã«ãã«ã€ããŠè©±ãå Žåãæ°åãåãéçšãžã®åãè¿œå ã«ã€ããŠè©±ããŠãããåäžã®ãã€ã¯ã®ã»ããã®ä»£ããã«ã1ã€ã®é決å®çãªãã€ã¯ãè¿œå ãããŸãã
é決å®è«ã®éæ³
Model.Game.CheckInvariants = function(board) { var design = Model.Game.design; var cnt = getPieceCount(board); for (var i in board.moves) { var m = board.moves[i]; var b = board.apply(m); for (var j in m.actions) { fp = m.actions[j][0]; tp = m.actions[j][1]; pn = m.actions[j][3]; if ((fp !== null) && (tp !== null)) { if (checkLine(b, tp[0], board.player) === true) { var all = []; var captured = []; var len = design.positions.length; for (var p = 0; p < len; p++) { var piece = b.getPiece(p); if (piece.player !== board.player) { if ((checkLine)(b, p, b.player) === false) { captured.push(p); } all.push(p); } } if (captured.length === 0) { captured = all; } if (captured.length > 0) { captured.push(null); m.actions.push([captured, null, null, pn]); } } ... break; } } } CheckInvariants(board); }
ããããããã¯ããåºãæŠå¿µã§ãããã£ããã£ã¯é決å®çã§ããã ãã§ã¯ãããŸããïŒããã«ãã«ã¯ããã¬ã€ã€ãŒã®æ®ãã®3ã€ã®ããŒã¹ããã©ãã§ãããžã£ã³ãã§ãããšããã«ãŒã«ããããŸããå®éãããã¯èªç±ãªäœçœ®ãžã®é決å®è«çãªåãã§ãã
ããå°ãéæ³
... if (cnt === 3) { var len = design.positions.length; for (var p = 0; p < len; p++) { if (p !== tp[0]) { var piece = board.getPiece(p); if (piece === null) { tp.push(p); } } } } ...
å¯å圢ç¶ã¯é åã«ããããšãã§ããŸãïŒãã§ã¹ã®å€èº«ã®ã«ãŒã«ã«ããã°ãããŒã³ã¯æåŸã®æ°Žå¹³ã«å°éãããã¬ã€ã€ãŒã®éžæã§4ã€ã®é§ïŒéŠ¬ã象ãã«ãŒã¯ãã¯ã€ãŒã³ïŒã®ããããã«å€ããããšãã§ããŸããããã¯ããã£ã®ã¥ã¢ã移åãããšãã«å®è¡ãããé決å®çãªå€æã«ãããŸãããZRFã³ãŒãã§ã¯ãããŒã³ãäŸãã°ã¯ã€ãŒã³ã«ãJavaScriptæ¡åŒµã§å€æã§ããŸãïŒ
...ãã®å€æãå
å®ããã
var promote = function(arr, name, player) { var design = Model.Game.design; var t = design.getPieceType(name); if (t !== null) { arr.push(design.createPiece(t, player)); } } Model.Game.CheckInvariants = function(board) { var design = Model.Game.design; for (var i in board.moves) { var m = board.moves[i]; for (var j in m.actions) { fp = m.actions[j][0]; tp = m.actions[j][1]; if ((fp !== null) && (tp !== null)) { var piece = board.getPiece(fp[0]); if ((piece !== null) && (piece.getType() === "Pawn")) { var p = design.navigate(board.player, tp[0], design.getDirection("n")); if (p === null) { var promoted = []; promote(promoted, "Queen", board.player); promote(promoted, "Rook", board.player); promote(promoted, "Knight", board.player); promote(promoted, "Bishop", board.player); if (promoted.length > 0) { m.actions[j][2] = promoted; } } } break; } } } CheckInvariants(board); }
ã³ã³ãããŒã©ãŒã«ã€ããŠã¯ãã»ãšãã©å€æŽãããŸãããããŒãã®çŸåšã®ç¶æ ã§èš±å®¹ã§ããã¢ãã«ããã®ç§»åãåãåã£ãåŸã圌ã¯åã¢ã¯ã·ã§ã³ã§ã¢ã¬ã€ã®ãµã€ãºã確èªããå¿ èŠããããŸããè€æ°ã®èŠçŽ ãéä¿¡ãããå Žåãã³ã³ãããŒã©ãŒã¯ãã¹ãŠã®å¯èœãªãªãã·ã§ã³ãééãã決å®çãªåãã圢æããå¿ èŠããããŸãããã®ãããªé決å®è«ã§ã¯æ³šæãå¿ èŠã ãšèšã£ãŠã¯ãªããªããšæããŸããããã€ãã®ç¬ç«ããäœçœ®ã®ãã«ã«ãç©ã¯ãä¿¡ããããªãã»ã©ã®æ°ã®ç°ãªãåããçæã§ããŸãïŒ
å°èš
äžè¬çã«ãç§ã¯ãããžã§ã¯ãã®éçºã®æ¹åæ§ã奜ãã ãšèšããŸããç§ã¯é©åœçãªæ°ãããã®ãäœæãããšããèããæŸæ£ãïŒç°¡åã§ã¯ãããŸããã§ãããïŒãéæå¯èœãªç®æšã«çŠç¹ãåœãŠãŸããããããã§ããããããç®æšã§ã¯ãããŸããã§ãããæ¢ç¥ã®2矜ã®é³¥ã®ãã¡ããæã«é¶Žãã奜ããšèšããŸãããããžã§ã¯ãã«åãçµãããšã§ãç§ã¯æ°ããèšèªãåŠã¶ããšãã§ããŸãããŸãããããžã§ã¯ãã«çµéšè±å¯ãªæ°ããéçºè ãå ããããšã§ãäœæ¥ãåŒãç¶ãæåããããšãæåŸ ã§ããŸããç§ã¯ãé©åœããæŸæ£ããŸãããããããžã§ã¯ãã¯é²åãç¶ããŠããŸãïŒ