;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'seq) (defvar arbitools-verbose nil) #@31 Rating floor for calculations (defvar arbitools-elo-floor 1000 (#$ . 133)) #@44 Cut the worst result for ARPO calculations (defvar arbitools-arpo-cutworst t (#$ . 214)) #@44 Cut the best results for ARPO calculations (defvar arbitools-arpo-cutbest t (#$ . 309)) #@59 Table of expected results according to FIDE ratings rules (defvar arbitools-performancetable (byte-code "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\201@\201A\201B\201C\201D\201E\201F\201G\201H\201I\201J\201K\201L\201M\201N\201O\201P\201Q\201R\201S\201T\201U\201V\201W\201X\201Y\201Z\201[\201\\\201]\201^\201_\201`\201a\201b\201c\201d\257e\207" [-800 -677 -589 -538 -501 -470 -444 -422 -401 -383 -366 -351 -336 -322 -309 -296 -284 -273 -262 -251 -240 -230 -220 -211 -202 -193 -184 -175 -166 -158 -149 -141 -133 -125 -117 -110 -102 -95 -87 -80 -72 -65 -57 -50 -43 -36 -29 -21 -14 -7 0 7 14 21 29 36 43 50 57 65 72 80 87 95 102 110 117 125 133 141 149 158 166 175 184 193 202 211 220 230 240 251 262 273 284 296 309 322 336 351 366 383 401 422 444 470 501 538 589 677 800] 101) (#$ . 403)) #@66 Table to store rank numbers, names, ratings and expected results (defvar arbitools-players-info nil (#$ . 1447)) #@73 Fill `arbitools-players-info' with the information from the main buffer (defalias 'arbitools-fill-players-info #[nil "\212eb\210\306\307\310\306\311#\205M\312\313!\314 \315\316#\314 \317\320#\314 \321\322#\306\n B B\f B\323 B\324 !\211\235\204H\325C\".\202)\207" [arbitools-players-info linestring rankstring namestring elostring playerinfo nil re-search-forward "^001" t thing-at-point line substring-no-properties 5 8 14 47 48 52 0 reverse append #1=#:x] 5 (#$ . 1566)]) #@525 Use bbpPairings to do the pairings for the next round. You need a XXR section followed by the number of rounds. If you have any players that are not going to be paired, insert 0000 - H in the column, for a half point bye and 0000 - F for full point bye. You can do that with arbitools-insert-bye. For the first round you will need a XXC section followed by white1 or black1, which will force the corresponding colour. If the program throws an error you will find it in the Pairings-output buffer. (defalias 'arbitools-do-pairings #[(round) "r\306q\210\307 \210)\310\311\312\306\312\313\314&\210\315\211\315\211\316\317 !S\320_\\\"\315#r\306q\210eb\210\317\321\322!!)\n X\205'r\306q\210\312y\210\nT\321\322!\312v\210\312v\210\321\322!)\212eb\210\323\324\312\325#\203#\326u\210 \321\322!\230\203\302\312\210i#\327 \210\"u\210\"#U\204\211\330#\"Z!\210\331c\210\fG\332U\203\231\333u\210\202\243\fG\334U\203\243\335u\210\336\337\f\"c\210\fG\332U\203\267\330\340!\210\202\302\fG\334U\203\302\330\332!\210\f\321\322!\230\203Y\312\210i#\327 \210\"u\210\"#U\204\347\330#\"Z!\210\331c\210 G\332U\203\367\333u\210\202 G\334U\203\335u\210\336\341 \"c\210 G\332U\203\330\340!\210\202Y G\334U\203Y\330\332!\210\202Y)\2026.\207" [buffer-file-name numberoftables actualtable white black round "Pairings-output" erase-buffer call-process "bbpPairings.exe" nil "--dutch" "-p" 0 89 string-to-number 10 thing-at-point word re-search-forward "^001" t 4 beginning-of-line delete-char " " 2 -1 3 -2 format "%s w " 1 "%s b " positiontowrite endoflinecolumn] 9 (#$ . 2069) "sWhich round do you need to generate the pairings for?: "]) #@183 Prepare file for DOS: add carriage return at the end of lines. For some administrators, like the ones in FEDA, the files need to be in this format or they will not allow them. (defalias 'arbitools-prepare-file-DOS #[nil "\212eb\210\300\301\302\303#\205\304\305!\210\202)\207" [search-forward "\n" nil t replace-match " \n"] 4 (#$ . 3768) nil]) #@73 Update the players ratings in a database file based on a elo list file. (defalias 'arbitools-update #[(elolist) "\302\303\304\305\304\306\307 &\207" [buffer-file-name elolist call-process "arbitools-run.py" nil "Arbitools-output" "update" "-l"] 9 (#$ . 4128) "selolist:"]) #@43 Add players to an existing database file. (defalias 'arbitools-add #[(addfile) "\302\303\304\305\304\306\307 &\207" [addfile buffer-file-name call-process "arbitools-add.py" nil "Arbitools-output" "-a" "-i"] 9 (#$ . 4409) "faddfile: "]) #@42 Remove whitespace at the beginning of S. (defalias 'arbitools-trim-left #[(s) "\301\302\"\203\303\304\305\211$\207\207" [s string-match "\\`[ \n ]+" replace-match "" t] 5 (#$ . 4654)]) #@36 Remove whitespace at the end of S. (defalias 'arbitools-trim-right #[(s) "\301\302\"\203\303\304\305\211$\207\207" [s string-match "[ \n ]+\\'" replace-match "" t] 5 (#$ . 4851)]) #@160 Create userTB.txt file for file generated with ARPO app. Use in crosstable.txt generated in Vega. You need to open the ARPO1.txt file in another buffer. (defalias 'arbitools-arpo-vega #[nil "\212eb\210\306y\210\307\310\311\312\313\314\315!\204\316\315!\210r\315q\210\317 \210\320c\210)\307eb\210\306y\210\321\322\313\307#\203=\323\324!\210\202.eb\210\306y\210)\205\267\325 \210\313v\210\326\327!\203\260\330 !\210\331\326\332!\333\334#\335 \336\"\337\340\f\341#\342 !r\343q\210eb\210\321 !\203\241\313\210\344v\210\326\327!\344v\210\326\327!r\315q\210 c\210\345c\210\nc\210\346c\210)\202\251r\315q\210\347c\210))\313y\210\202D\313\211\204H\313.\207" [continue arpodata arpopoint name namesplit case-fold-search 7 t "data" "point" " " nil get-buffer "userTB.txt" generate-new-buffer erase-buffer " User Tie-Break ;" search-forward "(W)" replace-match " " beginning-of-line thing-at-point word clear-string substring-no-properties line 4 24 split-string "," mapconcat identity "" arbitools-trim-right "ARPO1.txt" -1 "." ";" "0.0;"] 5 (#$ . 5044) nil]) #@270 Get the pairings and/or results of the given round. It will only work with the current round. Some player's names will be missing if you try a finished round, and the order of the tables will be wrong. You will find the pairings in the Pairing List buffer. (defalias 'arbitools-list-pairing #[(round) "\306 \210\212\307\211\310\307\211\307\211:\307\211;<\307\211=>\307\211?@\307Aeb\210\311\312\307\313#\210\314\315\316!\317\307#eb\210\311\320\307\313#\210\321\314\315\316!\317\307#!r\322q\210\323 \210\324\325\"c\210\324\326B\"c\210)r\327q\210eb\210\317y\210`:) \310Y\203\277r\327q\210:b\210\310y\210\330\314\315\316!\331\332#!>`:)eb\210\333>!\210\330\314\315\316!\317\334#!=\314\315\316!\335\336#;\330\314\315\316!\337\321B!S\340_\\\341\321B!S\340_\\#!?\314\315\316!\342\321B!S\340_\\\343\321B!S\340_\\#@\314\315\316!\344\321B!S\340_\\\345\321B!S\340_\\#A`eb\210\311\346\307\313#\203-\317u\210\330?!\315\347!\230\203\377\314\315\316!\335\336#?>?W\203\202\321>T!\211G=\3066\3078 \306@\211A\203\243A@@\322@!S8787\\876B6AA\211A\204~*8=\2458\3074eb\210\310B\306C\310\211DE\323\324\325>T\"!\210\306\210Bi\\\211B\326Z\327\245\211C\310F?F?W\203)\330F\327_\\E\331 \210Eu\210\332\333!\211D \235\204 \334u\210\332\335!\336\235\2034\337\\4\202 \332\335!\340\235\203 4\341\\4FT\211F\202\336.\342>T!\21134Z3 G\310V\203F3=\2451\343>T!282\\8\316\317\3442#\210\316\317\345>T\f34= 1862&\f\2108 B>T\211>\202^*\311 !\3069<\310>?>?W\203\263>8> 8Z\211:9B9>T\211>\202\223*\3469!\3479!Z\350W\203\304\313\fT \204\321\f\351U\203?\306\211;\204D\316\317\3529A@9@Z9 %\210r\353q\210eb\210ed|\210\354c\210)r\355q\210eb\210ed|\210\356c\210) G\310G?G?W\205JGH8A@IG 8Jr\353q\210\324\357GTIJ$c\210)r\355q\210\324\360J\"c\210+GT\211G\202.\207" [iterand iterand_1 sumiterand converges iterations opponents nil 0.0 0 reverse arbitools-calculate-players-performance t apply + arbitools--verbose-output "Arbitools-output" "Starting run %d; iterand: %s sum_iterand: %d\n" arbitools-get-player-opponents string-to-number re-search-forward format "^001[[:space:]]\\{1,4\\}%d" 89 10 94 beginning-of-line thing-at-point word 4 symbol ("1" "+" "F") 1.0 ("H" "=") 0.5 arbitools-get-player-played-points arbitools-get-player-ci " c %d----\n" "Success! player %d run %d points %f discard %f opponents %d: %s percentage %f ARPO averageperformanceofopponents %f performances %s diff %d\n" seq-max seq-min 1e-10 300 "difference: %f differences: %s converges: %s" "ARPO" "rank Name ARPO\n" "userTB.txt" " User Tie-Break ;" "%d %s %s\n" "%s;" percentage diff points discard performances performancesopponents opponentsperformance averageperformanceofopponents differences difference continue numberofplayers numberofopponents number --dotimes-limit-- opponent --dolist-tail-- maxlength numberofrounds opp offset roundcount-1 iter arbitools-players-info name arpo] 14 (#$ . 25629) nil]) #@104 Get the IT3 tournament report. You will get a .tex file, and a pdf if you have pdflatex installed. (defalias 'arbitools-it3 #[nil "\301\302\303\304\303\305&\207" [buffer-file-name call-process "arbitools-run.py" nil "Arbitools-output" "it3"] 7 (#$ . 28069) nil]) #@33 Get the FEDA rating admin file. (defalias 'arbitools-fedarating #[nil "\301\302\303\304\303\305&\207" [buffer-file-name call-process "arbitools-run.py" nil "Arbitools-output" "fedarating"] 7 (#$ . 28344) nil]) #@34 Keymap for Arbitools major mode. (defvar arbitools-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210)\207" [map make-sparse-keymap define-key "i" arbitools-insert-player "r" arbitools-insert-result "p" arbitools-do-pairing "b" arbitools-insert-bye] 4) (#$ . 28562)) #@25 Menu for Arbitools mode (defvar arbitools-mode-menu nil (#$ . 28889)) (easy-menu-do-define 'arbitools-mode-menu arbitools-mode-map "Menu for Arbitools mode" '("Arbitools" ["New Tournament header" arbitools-new-trf] "---" ["Insert Player" arbitools-insert-player] ["Delete Player" arbitools-delete-player] "---" ["Do Pairings" arbitools-do-pairings] ["Insert Result" arbitools-insert-result] ["Insert Bye" arbitools-insert-bye] ["Delete Round" arbitools-delete-round] "---" ["List Players" arbitools-list-players] ["List Pairings" arbitools-list-pairing] ["Recalculate Standings" arbitools-calculate-standings] ["Recalculate points" arbitools-calculate-points] ["Calculate ARPO" arbitools-calculate-arpo] "---" ["Print Standings to file" arbitools-standings] "---" ["Update Elo" arbitools-update] ["Get It3 form Report" arbitools-it3] ["Get FEDA Rating file" arbitools-fedarating] ["Prepare file for DOS" arbitools-prepare-file-DOS])) (defvar arbitools-highlights '(("^001" . font-lock-function-name-face) ("^012.*" . font-lock-comment-face) ("\\(^022\\|^032\\|^042\\|^052\\|^062\\|^072\\|^082\\|^092\\|^102\\|^112\\|^122\\).*" . font-lock-constant-face) ("^132.*" . font-lock-warning-face) ("^013" . font-lock-warning-face) ("\\(^013.\\{1\\}\\)\\(.\\{31\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{11\\}\\)\\(.\\{32\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{55\\}\\)\\(.\\{10\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{88\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{93\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{95\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{98\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{103\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{105\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{108\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{113\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{115\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{118\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{123\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{125\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{128\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{133\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{135\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{138\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{143\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{145\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{148\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{153\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{155\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{158\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{163\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{165\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{168\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{173\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{175\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{178\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{183\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{185\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{188\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{193\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{195\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ("\\(^001.\\{198\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ("\\(^001.\\{203\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ("\\(^001.\\{205\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face))) (defvar arbitools-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [arbitools-mode-hook variable-documentation put "Hook run after entering Arbitools mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp arbitools-mode-map definition-name arbitools-mode] 4) (defvar arbitools-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\317#\207" [arbitools-mode-abbrev-table arbitools-mode-map variable-documentation put purecopy "Keymap for `arbitools-mode'." boundp arbitools-mode-syntax-table definition-name arbitools-mode (lambda (#1=#:def-tmp-var) (defvar arbitools-mode-syntax-table #1#)) make-syntax-table "Syntax table for `arbitools-mode'." (lambda (#1#) (defvar arbitools-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `arbitools-mode'." derived-mode-parent] 5) #@172 Major mode for Chess Tournament Management. This mode runs the hook `arbitools-mode-hook', as the final or penultimate step during initialization. \{arbitools-mode-map} (defalias 'arbitools-mode #[nil "\306\300!\210\307\310 \210\311\312\313 !\210\314\f!\210 \315\316!\210\315\317!\210\315\320!\210\315\321!\210\315\322!\210\315\323!\210\315\324!\210\315\325!\210\326 \210\327 \210\306\330!\210\331)\332\333!\207" [delay-mode-hooks major-mode mode-name arbitools-mode-map arbitools-mode-syntax-table arbitools-mode-abbrev-table make-local-variable t kill-all-local-variables arbitools-mode "Arbitools" use-local-map set-syntax-table get-buffer-create "Arbitools-output" "List of players" "Pairings List" "Standings" "Pairings-output" "Players performance" "ARPO" "userTB.txt" column-number-mode arbitools-fill-players-info font-lock-defaults (arbitools-highlights) run-mode-hooks arbitools-mode-hook local-abbrev-table] 2 (#$ . 33851) nil]) (byte-code "\300\301\302\"\210\303\304!\207" [add-to-list auto-mode-alist ("\\.trf?\\'" . arbitools-mode) provide arbitools] 3)