403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.5
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/share/emacs/28.2/lisp/play/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/emacs/28.2/lisp/play/mpuz.elc
;ELC
;;; Compiled
;;; in Emacs version 28.2
;;; with all optimizations.



(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314DD\315\316\317%\210\310\320\312\313\321DD\322\316\323%\210\310\324\312\313\325DD\326\316\323%\210\327\330\331\332#\210\327\333\334\335#\210\327\336\337\340#\210\327\341\342\343#\210\310\344\312\313\345DD\346\316\347%\207" [custom-declare-group mpuz nil "Multiplication puzzle." :prefix "mpuz-" :group games custom-declare-variable mpuz-silent funcall function #[0 "\300\207" [error] 1 #1=""] "Set this to nil if you want dings on inputs.\nThe value t means never ding, and `error' means only ding on wrong input." :type (choice (const :tag "No" nil) (const :tag "Yes" t) (const :tag "If correct" error)) mpuz-solve-when-trivial #[0 "\300\207" [t] 1 #1#] "Solve any row that can be trivially calculated from what you've found." boolean mpuz-allow-double-multiplicator #[0 "\300\207" [nil] 1 #1#] "Allow 2nd factors like 33 or 77." custom-declare-face mpuz-unsolved ((default :weight bold) (((class color)) :foreground "red1")) "Face for letters to be solved." mpuz-solved ((default :weight bold) (((class color)) :foreground "green1")) "Face for solved digits." mpuz-trivial ((default :weight bold) (((class color)) :foreground "blue")) "Face for trivial digits solved for you." mpuz-text ((t :inherit variable-pitch)) "Face for text on right." mpuz-mode-hook #[0 "\300\207" [nil] 1 #1#] "Hook to run upon entry to mpuz." hook] 8)
#@37 Local keymap to use in Mult Puzzle.
(defvar mpuz-mode-map (byte-code "\300 \301\302\303\"\304\"\210\305\306\307#\210\305\310\311#\210\207" [make-sparse-keymap mapc make-closure #[257 "\301\300\302!\303#\207" [V0 define-key char-to-string mpuz-try-letter] 5 "\n\n(fn CH)"] "abcdefghijABCDEFGHIJ" define-key "" mpuz-offer-abort "?" describe-mode] 5) (#$ . 1484))
(defvar mpuz-mode-hook nil)
(byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [mpuz-mode-hook variable-documentation put "Hook run after entering Mult Puzzle mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it.  (This is true for all hook variables.)" boundp mpuz-mode-map definition-name mpuz-mode] 4)
(defvar mpuz-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" [mpuz-mode-abbrev-table mpuz-mode-map variable-documentation put purecopy "Keymap for `mpuz-mode'." boundp mpuz-mode-syntax-table definition-name mpuz-mode (lambda (#1=#:def-tmp-var) (defvar mpuz-mode-syntax-table #1#)) make-syntax-table "Syntax table for `mpuz-mode'." (lambda (#1#) (defvar mpuz-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `mpuz-mode'." derived-mode-parent] 5)
#@240 Major-mode.
Uses keymap `mpuz-mode-map', abbrev table `mpuz-mode-abbrev-table' and
syntax-table `mpuz-mode-syntax-table'.

This mode runs the hook `mpuz-mode-hook', as the final or penultimate
step during initialization.

\{mpuz-mode-map}
(defalias 'mpuz-mode #[0 "\306\300!\210\307\310 \210\311\312\313!\210\314\f!\210
\315)\316\317!\207" [delay-mode-hooks major-mode mode-name mpuz-mode-map mpuz-mode-syntax-table mpuz-mode-abbrev-table make-local-variable t kill-all-local-variables mpuz-mode "Mult Puzzle" use-local-map set-syntax-table 30 run-mode-hooks mpuz-mode-hook local-abbrev-table tab-width] 2 (#$ . 2962)])
#@40 Number of errors made in current game.
(defvar mpuz-nb-errors 0 (#$ . 3596))
#@28 Number of games completed.
(defvar mpuz-nb-completed-games 0 (#$ . 3679))
#@42 Number of errors made in previous games.
(defvar mpuz-nb-cumulated-errors 0 (#$ . 3759))
#@45 Non-nil if a game is currently in progress.
(defvar mpuz-in-progress nil (#$ . 3854))
#@54 A vector recording which digits have been decrypted.
(defvar mpuz-found-digits (make-bool-vector 10 nil) (#$ . 3946))
#@59 A vector recording which digits have been solved for you.
(defvar mpuz-trivial-digits (make-bool-vector 10 nil) (#$ . 4070))
#@14 

(fn DIGIT)
(defalias 'mpuz-digit-solved-p '(macro . #[257 "\300\301\302E\301\303EE\207" [or aref mpuz-found-digits mpuz-trivial-digits] 6 (#$ . 4201)]))
#@38 A permutation from [0..9] to [0..9].
(defvar mpuz-digit-to-letter (make-vector 10 0) (#$ . 4364))
#@40 The inverse of `mpuz-digit-to-letter'.
(defvar mpuz-letter-to-digit (make-vector 10 0) (#$ . 4468))
#@15 

(fn LETTER)
(defalias 'mpuz-to-digit '(macro . #[257 "\300\301E\207" [aref mpuz-letter-to-digit] 4 (#$ . 4574)]))
#@14 

(fn DIGIT)
(defalias 'mpuz-to-letter '(macro . #[257 "\300\301E\207" [aref mpuz-digit-to-letter] 4 (#$ . 4697)]))
#@53 Initialize puzzle coding with a random permutation.
(defalias 'mpuz-build-random-perm #[0 "\302\303\304\305\306\307\310\311\312\313\257\n\314\315\205.\316!\262\317\"\262S\262I\210	I\210\202\207" [mpuz-digit-to-letter mpuz-letter-to-digit 0 1 2 3 4 5 6 7 8 9 10 nil seq-random-elt delq] 10 (#$ . 4820)])
#@73 The board associates to any digit the list of squares where it appears.
(defvar mpuz-board (make-vector 10 nil) (#$ . 5145))
#@99 Put (last digit of) NUMBER on ROW and COLUMNS of the puzzle board.

(fn NUMBER ROW &rest COLUMNS)
(defalias 'mpuz-put-number-on-board #[642 "\301\211\205&\211@\302\246\262\302\245\262BHBI\210A\266\202\202\207" [mpuz-board nil 10] 11 (#$ . 5276)])
#@86 Check whether all digits have been solved.  Return t if yes.

(fn &optional ROW COL)
(defalias 'mpuz-check-all-solved #[512 "\3012\302\211\211\211\211\211\211C\203\371\204\371\206\303\304\305\"\262\206'\303\304\306\"\262\2060\303\307!\262\206:\303\310!\211\262\203H\203H\204Y\203f\204Y\203f\203f\311 \210\312 \210\313\301\314\"\202\366\206m\303\315!\262\206v\303\316!\211\262\203\212\203\212\204\212\311\307!\202\366\203\242=\204\242\311\203\235\316\202\236\315!\202\366\203\300=\204\300\311\203\266\304\202\267\316\205\274\306\"\202\366\203\336=\204\336\311\203\324\304\202\325\315\205\332\305\"\202\366\204\371\203\353\204\363\203\371\203\371\311\310!\204\312 \210\317\320\321$\322\"\266\3140\207" [mpuz-solve-when-trivial solved nil mpuz-check-all-solved 4 7 9 10 2 mpuz-solve mpuz-paint-board throw t 8 6 mapc make-closure #[257 "H\206	\fH?\2056\302
H\240\2056\300\203-\301\203&\300\301B\302\242\235\202/\300\302\242\236\202/\302\242\2056\306\307\310\"\207" [V0 V1 V2 mpuz-found-digits mpuz-trivial-digits mpuz-board throw solved nil] 4 "\n\n(fn DIGIT)"] [0 1 2 3 4 5 6 7 8 9]] 15 (#$ . 5546)])
#@50 Draw random values to be multiplied in a puzzle.
(defalias 'mpuz-random-puzzle #[0 "\302 \210\303\304\"\210	\203\305\306\307!\\\202\310\306\311!\\\312\245T\211\306\313Z!\\\304\211\211\211\306\313	Z!\\\211\262U\203=	\203(_\262_\262\313_\\\262\314\315\316\317\320%\210\314\313_\\\321\316\317$\210\314\322\316\317\320\323&\210\314\324\317\320\323\325&\210\314\313\316\317\320\323\325&\207" [mpuz-board mpuz-allow-double-multiplicator mpuz-build-random-perm fillarray nil 112 random 888 125 875 999 10 mpuz-put-number-on-board 2 9 7 5 4 6 3 8 1] 15 (#$ . 6763)])
#@56 The general picture of the puzzle screen, as a string.
(defconst mpuz-framework "\n     . . .\n	Number of errors (this game):	0\n    x  . .\n   -------\n   . . . .\n	Number of completed games:	0\n . . . .\n ---------	Average number of errors:	0.00\n . . . . ." (#$ . 7363))
#@53 Create (or recreate) the puzzle buffer.  Return it.
(defalias 'mpuz-create-buffer #[0 "\302\303!\304\305rq\210\306 \210	c\210\307\310\311#\210\307\312\313#\210\307\314\315#\210\316 \210\317 \210\320 \210))\207" [buffer-read-only mpuz-framework get-buffer-create "*Mult Puzzle*" (face mpuz-text) nil erase-buffer set-text-properties 13 42 79 105 128 153 mpuz-paint-board mpuz-paint-errors mpuz-paint-statistics] 6 (#$ . 7643)])
#@30 

(fn N &optional EOL WORDS)
(defalias 'mpuz-paint-number #[769 "\210\301`\206\302[v\210`|\210c)\207" [buffer-read-only nil 1] 5 (#$ . 8082)])
#@41 Paint error count on the puzzle screen.
(defalias 'mpuz-paint-errors #[0 "\301 \210eb\210\302y\210\303\304!!\207" [mpuz-nb-errors mpuz-switch-to-window 2 mpuz-paint-number prin1-to-string] 3 (#$ . 8238)])
#@61 Paint statistics about previous games on the puzzle screen.
(defalias 'mpuz-paint-statistics #[0 "eb\210\302y\210\303\304!!\210\303\305\306\307U\203\307\202\310	\\\245\"\311\312#\207" [mpuz-nb-completed-games mpuz-nb-cumulated-errors 6 mpuz-paint-number prin1-to-string format "%.2f" 0 0.0 3 2] 5 (#$ . 8450)])
#@45 Paint board situation on the puzzle screen.
(defalias 'mpuz-paint-board #[0 "\300 \210\301\302\303\"\210eb\207" [mpuz-switch-to-window mapc mpuz-paint-digit [0 1 2 3 4 5 6 7 8 9]] 3 (#$ . 8774)])
#@65 Paint all occurrences of DIGIT on the puzzle board.

(fn DIGIT)
(defalias 'mpuz-paint-digit #[257 "H\204\f	H\203\211\305\\\202\nH\306\\\307	H\203\"\310\202-H\203,\311\202-\312D\313\314\315\316#\fH\")\207" [mpuz-found-digits mpuz-trivial-digits mpuz-digit-to-letter buffer-read-only mpuz-board 48 65 face mpuz-trivial mpuz-solved mpuz-unsolved nil mapc make-closure #[257 "eb\210\211@Sy\210\302A!\210\300c\210\303`S`\301#\210\304\305!\207" [V0 V1 move-to-column set-text-properties delete-char 1] 5 "\n\n(fn SQUARE)"]] 8 (#$ . 8976)])
#@37 Get the puzzle buffer if it exists.
(defalias 'mpuz-get-buffer #[0 "\300\301!\207" [get-buffer "*Mult Puzzle*"] 2 (#$ . 9537)])
#@56 Find or create the Mult-Puzzle buffer, and display it.
(defalias 'mpuz-switch-to-window #[0 "\301 \206\302 \303!\210\304\305 \207" [buffer-read-only mpuz-get-buffer mpuz-create-buffer switch-to-buffer t mpuz-mode] 3 (#$ . 9671)])
#@21 Start a new puzzle.
(defalias 'mpuz-start-new-game #[0 "\304\305!\210\306\307\310\n\311\"\210\310\311\"\210\312 \210\313 \210\314 \210\315 \210\316 \207" [mpuz-nb-errors mpuz-in-progress mpuz-found-digits mpuz-trivial-digits message "Here we go..." 0 t fillarray nil mpuz-random-puzzle mpuz-switch-to-window mpuz-paint-board mpuz-paint-errors mpuz-ask-for-try] 3 (#$ . 9911)])
#@39 Multiplication puzzle with GNU Emacs.
(defalias 'mpuz #[0 "\301 \210\203\n\302 \207\303 \207" [mpuz-in-progress mpuz-switch-to-window mpuz-offer-abort mpuz-start-new-game] 1 (#$ . 10297) nil])
#@44 Ask if user wants to abort current puzzle.
(defalias 'mpuz-offer-abort #[0 "\303\304!\203\305 \306\307!\210\310\311\312\n\310\"\210\211\205\313!\207\314 \207" [mpuz-in-progress mpuz-nb-errors mpuz-board y-or-n-p "Abort game? " mpuz-get-buffer message "Mult Puzzle aborted." nil 0 fillarray kill-buffer mpuz-ask-for-try] 4 (#$ . 10498) [nil (mpuz-mode)]])
#@34 Ask for user proposal in puzzle.
(defalias 'mpuz-ask-for-try #[0 "\300\301!\207" [message "Your try?"] 2 (#$ . 10866)])
#@69 Dings, unless global variable `mpuz-silent' forbids it.

(fn ERROR)
(defalias 'mpuz-ding #[257 "\301=\206\204\302\301!\207\211\205\302\301!\207" [mpuz-silent t ding] 3 (#$ . 10992)])
#@41 Propose a digit for a letter in puzzle.
(defalias 'mpuz-try-letter #[0 "\203d\306\211\211	\226\262\n\307ZH\262H\204\fH\203'\310\311\"\210\312\313!\207
H\2046\310\314\"\210\312\313!\207\310\315\"\210\316 \262\211\317=\203I\316 \262\211\320V\204U\211\321W\203_\310\322#\210\312\313!\207\323\"\207\324\325!\203m\326 \207\310\327!\207" [mpuz-in-progress last-command-event mpuz-letter-to-digit mpuz-found-digits mpuz-trivial-digits mpuz-board nil 65 message "%c already solved." mpuz-ding t "%c does not appear." "%c = " read-char 61 57 48 "%c = %c" mpuz-try-proposal y-or-n-p "Start a new game? " mpuz-start-new-game "OK. I won't."] 7 (#$ . 11189) [nil (mpuz-mode)]])
#@74 Propose LETTER-CHAR as code for DIGIT-CHAR.

(fn LETTER-CHAR DIGIT-CHAR)
(defalias 'mpuz-try-proposal #[514 "\304Z\305ZH	H\204\nH\203\306\307\305\\\"\207	H\204(\nH\203-\306\310\"\207U\203L\306\311#\210\312\313!\210	\314I\210\315 \205]\316 \207\306\317#\210\312\314!\210T\320 \207" [mpuz-letter-to-digit mpuz-found-digits mpuz-trivial-digits mpuz-nb-errors 65 48 message "%c has already been found." "%c has already been placed." "%c = %c correct!" mpuz-ding nil t mpuz-check-all-solved mpuz-close-game "%c = %c incorrect!" mpuz-paint-errors] 9 (#$ . 11886)])
#@44 Housecleaning when puzzle has been solved.
(defalias 'mpuz-close-game #[0 "\304	\n\\T\305 \210\306\307\n\211\310U\203\311\202\312\n\313U\203$\314\202a\n\310U\203.\315\202a\n\316U\2038\317\202a\n\320U\203B\321\202a\n\322U\203L\323\202a\n\324W\203V\325\202a\n\326W\203`\327\202a\330$\331\332\"\210\333\322!\210\334\335P!\203v\336 \207\331\337!\207" [mpuz-in-progress mpuz-nb-cumulated-errors mpuz-nb-errors mpuz-nb-completed-games nil mpuz-paint-statistics format "Puzzle solved with %d error%s. That's %s" 1 "" "s" 0 "perfect!" "very good!" 2 "good." 3 "not bad." 4 "not too bad..." 10 "bad!" 15 "awful." "not serious." message "%s" sit-for y-or-n-p "  Start a new game? " mpuz-start-new-game "Good Bye!"] 6 (#$ . 12482)])
#@56 Find solution for autosolving.

(fn &optional ROW COL)
(defalias 'mpuz-solve #[512 "\300\301\302#\303\"\210\304\207" [mapc make-closure #[257 "\nH\206+H\206+\300\203'\301\203\300\301B\fH\235\202#\300\fH\236?\206+\305I\207" [V0 V1 mpuz-found-digits mpuz-trivial-digits mpuz-board t] 4 "\n\n(fn DIGIT)"] [0 1 2 3 4 5 6 7 8 9] t] 7 (#$ . 13235)])
#@52 Display solution for debugging purposes.

(fn ROW)
(defalias 'mpuz-show-solution #[257 "\300 \210\301\205
\302\303!_!\210\304 \210\305 \205\306 \207" [mpuz-switch-to-window mpuz-solve 2 prefix-numeric-value mpuz-paint-board mpuz-check-all-solved mpuz-close-game] 5 (#$ . 13601) ["P" (mpuz-mode)]])
(provide 'mpuz)

Youez - 2016 - github.com/yon3zu
LinuXploit