;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307\310\311\312\313%\210\314\315\316\317\320DD\321\322\323%\207" [require chess-algebraic chess-fen chess-game chess-ply chess-pos custom-declare-group chess-eco nil "Chess opening classification module." :group chess custom-declare-variable chess-eco-max-index funcall function #[0 "\300\207" [36] 1] "Index at which to stop chess opening announcements." :type integer] 6) #@45 List of well known chess opening positions. (defvar chess-eco-hash-table (byte-code "\301\302\303\304!\"!\205:\305\306\307\"r\211q\210\310\311\"\216\312\313!\210\314\303!\210\315p!\316\317\320\321\322$\323\310\324\"\"\210\262\312\325!\210*\262\207" [load-file-name file-exists-p expand-file-name "chess-eco.fen" file-name-directory generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] message "Emacs Chess: Loading ECO openings database..." insert-file-contents read make-hash-table :size 10541 :test equal mapc #[257 "\301@A\300#\207" [V0 puthash] 5 "\n\n(fn ENTRY)"] "Emacs Chess: Loading ECO openings database...done"] 7) (#$ . 543)) #@61 Generate chess-eco.fen from the ply lists in chess-eco.pos. (defalias 'chess-generate-fen-table #[0 "\301\302!\210\301\303!\210\301\304!\210\301\305!\210\306\307\310\"r\211q\210\311\312\"\216\313@!\210\314\315!\316p!rq\210\317\320\321\"p\"\210\322A@!)\266\202*\207" [command-line-args-left require chess-pos chess-ply chess-fen chess-algebraic generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents get-buffer-create "chess-eco.fen" read print mapcar #[257 "\301\302@A@#\210\303\211\203\304\305\306\307\"\310\"\262\202\204\211\311!\205&\211G\312U\262\2043\313\314\315\316E\"\210\304!\211\317\211\311!\205D\211G\312U\262\204Q\313\314\315\316E\"\210\211\320H\262!\311!\205b\211G\312U\262\204o\313\314\315\316E\"\210\211<\204|\313\314\321\322E\"\210\320I\266\266\202\323\324\325\"\326AA@\327\330#\"\210\331!A@@E\207" [chess-starting-position message "Preparing opening %s (%s)" nil vconcat make-vector 64 32 [nil nil nil nil nil nil t nil nil nil nil] vectorp 75 signal wrong-type-argument chess-pos position copy-alist 71 list annotations mapc make-closure #[257 "\301\302\300\303\300\"\211\211:\205\211@\304!\205\211G\305U\262\262\204(\306\307\310\311E\"\210\211A\262#\207" [V0 apply chess-pos-move chess-algebraic-to-ply vectorp 75 signal wrong-type-argument chess-ply ply] 10 "\n\n(fn MOVE)"] split-string " " t chess-pos-to-fen] 12 "\n\n(fn ENTRY)"] write-file] 7 (#$ . 1254)]) (defvar chess-eco-last-opening nil) (make-variable-buffer-local 'chess-eco-last-opening) #@13 (fn GAME) (defalias 'chess-eco-classify #[257 "\205V\211\211\204 \301\302!\210\3038\262\304\203T\305@\211\211:\205.\211@\306!\205,\211G\307U\262\262\204;\310\311\312\313E\"\210\211@\262!\314\"\211\203K\211\262A\262\266\202\262\207" [chess-eco-hash-table cl--assertion-failed game 3 nil chess-pos-to-fen vectorp 75 signal wrong-type-argument chess-ply ply gethash] 10 (#$ . 2859)]) (chess-message-catalog 'english '((announce-opening . "%s (ECO code %s)"))) #@233 Handle for the `chess-eco' module. If you add `chess-eco' to `chess-default-modules', this handler will try to figure out if the current position of a game does match a well known chess opening position. (fn GAME EVENT &rest ARGS) (defalias 'chess-eco-handler #[642 "\302=\206p\303=\205p\211\204\304\305!\210\211\211\204\304\305!\210\3068\262GS\262\307U\203.\310\211\2047\304\305!\210\211\211\204@\304\305!\210\3068\262GS\262 W\205p\311!\211\205n\211=?\205n\211\312@A@D\313\314\315#!\266\202\262\207" [chess-eco-last-opening chess-eco-max-index initialize post-move cl--assertion-failed game 3 1 nil chess-eco-classify announce-opening message apply chess-string] 11 (#$ . 3351)]) (defalias 'chess-eco-parse-scid-eco #[0 "\300C\301\302\303\300#\203\"\211\304\305!\304\306!\307\310\311\304\312!\313\"\314#EC\244\210\202\211A\207" [t re-search-forward "\\([A-E][0-9][0-9]\\([a-z][0-9]?\\)?\\) \"\\([^\"]+\\)\"[\n ]+\\([^*]*\\|\n\\) +\\*" nil match-string 1 3 mapconcat #[257 "\301\302\303Q\"\203\304\305\"\207\207" [chess-algebraic-regexp string-match "\\(" "\\)" match-string 1] 5 "\n\n(fn MOVE)"] split-string 4 "[\n ]+" " "] 9]) (provide 'chess-eco)