;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\301%\207" [require chess chess-common chess-polyglot custom-declare-group chess-uci nil "Customisations for Chess engines based on the UCI protocol" :group] 6) #@57 A regular expression matching a UCI log algebraic move. (defvar chess-uci-long-algebraic-regexp "\\([a-h][1-8]\\)\\([a-h][1-8]\\)\\([nbrq]\\)?" (#$ . 319)) #@85 Convert the long algebraic notation MOVE for POSITION to a ply. (fn POSITION MOVE) (defalias 'chess-uci-long-algebraic-to-ply #[514 "\302\303 \"\205 \211\304!\205\211G\305U\262\204\"\306\307\310\311E\"\210\211\312H\262\313\314\"\211;\2048\306\307\315\316E\"\210\211G\317U\204C\320\321!\210\211\314H\322!\204T\306\307\323\323E\"\210\324\325ZZ\262\326H\322!\204l\306\307\323\323E\"\210\211\327Z\262\250\203\202\326Y\203\202\324X\204\212\306\307\330\331E\"\210\211\250\203\233\211\326Y\203\233\211\324X\204\243\306\307\332\333E\"\210\334_\\\266\203\313\317\"\211;\204\273\306\307\315\316E\"\210\211G\317U\204\306\320\321!\210\211\314H\322!\204\327\306\307\323\323E\"\210\324\325ZZ\262\326H\322!\204\357\306\307\323\323E\"\210\211\327Z\262\250\203\326Y\203\324X\204 \306\307\330\331E\"\210\211\250\203\211\326Y\203\211\324X\204&\306\307\332\333E\"\210\334_\\\266\203\313\335\"\336\337\302\n \304!\205G\211G\305U\262\204T\306\307\310\311E\"\210\211\340>\204b\306\307\341\342E\"\210\203k\343\202l\344H\206\203{\305\202|\345\304!\205\207\211G\305U\262\204\224\306\307\310\311E\"\210\211\346>\204\242\306\307\347\350E\"\210\302\351\326\211W\203\303\211\352#\203\273\211B\262\210\211T\262\202\245\266\266\202\304!\205\322\211G\305U\262\204\337\306\307\310\311E\"\210\353>\204\355\306\307\354\342E\"\210\211\250\203\376\211\326Y\203\376\211\355X\204\306\307\356\357E\"\210\203\343\202\344I\266\203\266\202U\203\364\211\250\203-\211\326Y\203-\211\355X\2045\306\307\360\357E\"\210\211\334\245\262\211\250\203M\211\326Y\203M\211\355X\204U\306\307\360\357E\"\210\211\334\245\262U\203\364\361\211\250\203r\211\326Y\203r\211\355X\204z\306\307\362\357E\"\210\363\334\"\262\211\250\203\223\211\326Y\203\223\211\355X\204\233\306\307\362\357E\"\210\363\334\"\262Z!\314V\203\364\364\n\211\250\203\276\211\326Y\203\276\211\355X\204\306\306\307\362\357E\"\210\363\334\"\262 \211\250\203\337\211\326Y\203\337\211\355X\204\347\306\307\362\357E\"\210\363\334\"\262Z\326W\"\202\205\365\326H\226DBB$\266\204)\207" [case-fold-search chess-uci-long-algebraic-regexp nil string-match vectorp 75 signal wrong-type-argument chess-pos position 70 match-string 1 string coord 2 cl--assertion-failed (= (length coord) 2) natnump character 7 49 0 97 (integer 0 7) rank (integer 0 7) file 8 3 apply chess-ply-create #1=(nil t) (member . #1#) color 72 73 107 #2=(t nil 32 75 81 78 66 82 80 107 113 110 98 114 112) (member . #2#) piece-or-color 64 #[771 "\300!\205 \211G\301U\262\204\302\303\304\305E\"\210\250\203)\306Y\203)\307X\2041\302\303\310\311E\"\210\211\312>\204?\302\303\313\314E\"\210\300!\205L\211G\301U\262\204Y\302\303\304\305E\"\210\211\250\203j\211\306Y\203j\211\307X\204r\302\303\315\311E\"\210H\266\202\211\316U\203\206\247\205\227\211U\207\317\267\202\224\211\320W\207\211\320V\207\211U\207" [vectorp 75 signal wrong-type-argument chess-pos position 0 63 (integer 0 63) index #3=(t nil 32 75 81 78 66 82 80 107 113 110 98 114 112) (member . #3#) piece-or-color (integer 0 63) 32 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (t 140 nil 144)) 97] 10 "Return non-nil if at POSITION/INDEX there is the given PIECE-OR-COLOR.\nIf PIECE-OR-COLOR is t for white or nil for black, any piece of that\ncolor will do.\n\n(fn POSITION INDEX PIECE-OR-COLOR)"] #4=(nil t) (member . #4#) 63 (integer 0 63) index (integer 0 63) abs (integer 0 63) mod chess-ply-castling-changes :promote] 25 (#$ . 481)]) #@146 Convert long algebraic MOVE to a ply in reference to the engine position. If conversion fails, this function fired an 'illegal event. (fn MOVE) (defalias 'chess-uci-convert-long-algebraic #[257 "\300\301\302!\"\206 \303\302\304\"\207" [chess-uci-long-algebraic-to-ply chess-engine-position nil chess-engine-command illegal] 4 (#$ . 4131)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put chess-uci-convert-long-algebraic speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@61 Patterns matching responses of a standard UCI chess engine. (defvar chess-uci-regexp-alist (byte-code "\301\302B\303\304Q\305BD\207" [chess-uci-long-algebraic-regexp "^id\\s-+name\\s-+\\(.+\\)$" #[0 "\301\300!\210\302\303!\304\207" [chess-engine-opponent-name make-local-variable match-string 1 once] 2] "^bestmove\\s-+\\(" "\\)" #[0 "\301\302\303!\304\305\306!\"\206\307\306\310\"\262\"\207" [chess-engine-response-handler move match-string 1 chess-uci-long-algebraic-to-ply chess-engine-position nil chess-engine-command illegal] 6]] 4) (#$ . 4638)) #@80 Convert the current GAME position to a UCI position command string. (fn GAME) (defalias 'chess-uci-position #[257 "\300\301\302\204\f\303\304!\210\305\"\211\211:\205$\211@\306!\205\"\211G\307U\262\262\2041\310\311\312\313E\"\210\211@\266\203\314\"\315\316\317\211\204C\303\304!\210\3208\262\321#\322\260\207" ["position fen " chess-pos-to-fen 0 cl--assertion-failed game chess-game-ply vectorp 75 signal wrong-type-argument chess-ply ply t " moves " mapconcat #[257 "\211\211\211:\205\211@\300!\205\211G\301U\262\262\204\"\302\303\304\305E\"\210\211\211\211:\2057\211@\300!\2055\211G\301U\262\262\204D\302\303\304\305E\"\210\211A\262\211<\205V\211@9?\205V\211@\266\202\211\211:\205m\211@\300!\205k\211G\301U\262\262\204z\302\303\304\305E\"\210\211\211\211:\205\217\211@\300!\205\215\211G\301U\262\262\204\234\302\303\304\305E\"\210\211A\262\211<\205\257\211@9?\205\257\211A@\266\202\203\211\203\211\250\203\313\211\306Y\203\313\211\307X\204\323\302\303\310\311E\"\210\312\211\250\203\346\211\306Y\203\346\211\307X\204\356\302\303\313\311E\"\210\314\315\"\262\211\250\203\211\306Y\203\211\316X\204 \302\303\317\320E\"\210\211\321\\\262\211\250\203$\211\306Y\203$\211\307X\204,\302\303\322\311E\"\210\211\315\245\262\211\250\203B\211\306Y\203B\211\316X\204J\302\303\323\324E\"\210\316Z\325\\\262\"\262\211\250\203f\211\306Y\203f\211\307X\204n\302\303\310\311E\"\210\312\211\250\203\201\211\306Y\203\201\211\307X\204\211\302\303\313\311E\"\210\314\315\"\262\211\250\203\240\211\306Y\203\240\211\316X\204\250\302\303\317\320E\"\210\211\321\\\262\211\250\203\277\211\306Y\203\277\211\307X\204\307\302\303\322\311E\"\210\211\315\245\262\211\250\203\335\211\306Y\203\335\211\316X\204\345\302\303\323\324E\"\210\316Z\325\\\262\"\262\326\327\"\203\312\326\327\"\227!\202\330Q\207\330\207" [vectorp 75 signal wrong-type-argument chess-ply ply 0 63 (integer 0 63) index string (integer 0 63) mod 8 7 (integer 0 7) file 97 (integer 0 63) (integer 0 7) rank 49 chess-ply-keyword :promote ""] 13 "\n\n(fn PLY)"] 3 " " "\n"] 11 (#$ . 5203)]) #@68 Default handler for UCI based engines. (fn GAME EVENT &rest ARGS) (defalias 'chess-uci-handler #[642 "?\205?\306\267\2029 \203\307 !\203\n\204\310 !\311\312$\207\313\314\315\"\210\316\314!\207\317\320\314#\207\211\204<\321\322!\210\211\211\204E\321\322!\210\3238\262GS\262\324U\203_\325\326 #\210\325\327\f#\210\211\204h\321\322!\210\330\3238\331\"@\211\205\321\211\332\333\334\335\336\337\340&\206\317\211\211\211:\205\226\211@\341!\205\224\211G\342U\262\262\204\243\343\344\345\346E\"\210\211@\262\211\341!\205\262\211G\342U\262\204\277\343\344\347\350E\"\210\211\351H\262\211\205\315\332\352\353#\262\262\266\202\205?\317\320\314#\207\n\205\"\354\n!\205\"\355\n!\205\"\356\n\314\204\370\321\322!\210\357\"\211\211:\205\211@\341!\205\211G\342U\262\262\204\343\344\345\346E\"\210\211@\266\203\"\211\203/\3143\360\")\207\313\314\361!\362P\"\207\311\312$\207" [chess-engine-handling-event chess-polyglot-book-file chess-polyglot-book chess-full-name chess-engine-opponent-name chess-display-handling-event #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (initialize 11 new 36 resign 45 move 51 post-move 220)) file-exists-p chess-polyglot-book-open apply chess-common-handler chess-engine-send nil "ucinewgame\n" chess-engine-set-position chess-game-set-data active cl--assertion-failed game 3 1 chess-game-set-tag "White" "Black" last 2 chess-ply-any-keyword :drawn :perpetual :repetition :flag-fell :resign :aborted vectorp 75 signal wrong-type-argument chess-ply ply chess-pos position 74 :stalemate :checkmate bufferp buffer-live-p chess-polyglot-book-ply chess-game-ply move chess-uci-position "go\n" chess-engine-response-handler] 14 (#$ . 7365)]) (provide 'chess-uci)