MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 3.128.31.200
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/play/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/play/solitaire.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:37 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/play/solitaire.el
;;; in Emacs version 24.3.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\302\312\313\314\306\301&\207" [custom-declare-group solitaire nil "Game of Solitaire." :prefix "solitaire-" :group games custom-declare-variable solitaire-mode-hook "Hook to run upon entry to Solitaire." :type hook] 8)
#@31 Keymap for playing Solitaire.
(defvar solitaire-mode-map (byte-code "\302 \303	\"\210\304\305\306#\210\304\307\310#\210\304\311\312#\210\304\313\314#\210\304\315\316#\210\304\317\320#\210\304\321\322#\210\304\323\306#\210\304\324\310#\210\304\325\312#\210\304\326\314#\210\304\327\330#\210\304\331\332#\210\304\333\334#\210\304\335\336#\210\304\337\306#\210\304\340\310#\210\304\341\312#\210\304\342\314#\210\304\343\344#\210\304\345\330#\210\304\346\332#\210\304\347\334#\210\304\350\336#\210\304\351\316#\210\304\352\320#\210\304\353\354#\210)\207" [map special-mode-map make-sparse-keymap set-keymap-parent define-key "" solitaire-right "" solitaire-left "" solitaire-up "" solitaire-down "
" solitaire-move [remap undo] solitaire-undo " " solitaire-do-check [right] [left] [up] [down] [S-right] solitaire-move-right [S-left] solitaire-move-left [S-up] solitaire-move-up [S-down] solitaire-move-down [kp-6] [kp-4] [kp-8] [kp-2] [kp-5] solitaire-center-point [S-kp-6] [S-kp-4] [S-kp-8] [S-kp-2] [kp-enter] [kp-0] [115] solitaire-solve] 4) (#$ . 836))
(byte-code "\300\301\302\303#\210\304\305N\204\300\304\305\306\307!#\210\310\311!\204 \300\311\312\301#\210\300\207" [put solitaire-mode mode-class special solitaire-mode-hook variable-documentation purecopy "Hook run when entering Solitaire mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it.  (This is true for all hook variables.)" boundp solitaire-mode-map definition-name] 5)
(defvar solitaire-mode-map (make-sparse-keymap))
(byte-code "\300\301N\204\302\300\301\303\304!#\210\305\306!\204\302\306\307\310#\210\300\207" [solitaire-mode-map variable-documentation put purecopy "Keymap for `solitaire-mode'." boundp solitaire-mode-syntax-table definition-name solitaire-mode] 5)
(defvar solitaire-mode-syntax-table (make-syntax-table))
(byte-code "\300\301N\204\302\300\301\303\304!#\210\302\305\306\307#\207" [solitaire-mode-syntax-table variable-documentation put purecopy "Syntax table for `solitaire-mode'." solitaire-mode-abbrev-table definition-name solitaire-mode] 5)
(defvar solitaire-mode-abbrev-table (progn (define-abbrev-table 'solitaire-mode-abbrev-table nil) solitaire-mode-abbrev-table))
(byte-code "\300\301N\204\302\300\301\303\304!#\210\302\305\306\307#\207" [solitaire-mode-abbrev-table variable-documentation put purecopy "Abbrev table for `solitaire-mode'." solitaire-mode derived-mode-parent special-mode] 5)
#@451 Major mode for playing Solitaire.
To learn how to play Solitaire, see the documentation for function
`solitaire'.
\<solitaire-mode-map>
The usual mnemonic keys move the cursor around the board; in addition,
\[solitaire-move] is a prefix character for actually moving a stone on the board.

In addition to any hooks its parent mode `special-mode' might have run,
this mode runs the hook `solitaire-mode-hook', as the final step
during initialization.
(defalias 'solitaire-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315!\204'\316\317 \"\210\320\f!\211\2036
\321 =\203<\322\f\323 \"\210)\324\325\"\204V=\204V\326\325C#\210\327!\210\330\f!\210\307\331)\332\333!\207" [delay-mode-hooks major-mode mode-name solitaire-mode-map solitaire-mode-syntax-table parent make-local-variable t special-mode solitaire-mode "Solitaire" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table nil run-mode-hooks solitaire-mode-hook solitaire-mode-abbrev-table local-abbrev-table truncate-lines show-trailing-whitespace] 6 (#$ . 3316) nil])
#@46 Counter for the stones that are still there.
(defvar solitaire-stones 0 (#$ . 4576))
#@22 Center of the board.
(defvar solitaire-center nil (#$ . 4667))
#@33 Upper left corner of the board.
(defvar solitaire-start nil (#$ . 4736))
(defvar solitaire-start-x nil)
(defvar solitaire-start-y nil)
#@34 Lower right corner of the board.
(defvar solitaire-end nil (#$ . 4877))
(defvar solitaire-end-x nil)
(defvar solitaire-end-y nil)
#@199 Non-nil means check for possible moves after each major change.
This takes a while, so switch this on if you like to be informed when
the game is over, or off, if you are working on a slow machine.
(custom-declare-variable 'solitaire-auto-eval t '(#$ . 5014) :type 'boolean :group 'solitaire)
(defconst solitaire-valid-directions '(solitaire-left solitaire-right solitaire-up solitaire-down))
#@1604 Play Solitaire.

To play Solitaire, type \[solitaire].
\<solitaire-mode-map>
Move around the board using the cursor keys.
Move stones using \[solitaire-move] followed by a direction key.
Undo moves using \[solitaire-undo].
Check for possible moves using \[solitaire-do-check].
(The variable `solitaire-auto-eval' controls whether to automatically
check after each move or undo.)

What is Solitaire?

I don't know who invented this game, but it seems to be rather old and
its origin seems to be northern Africa.  Here's how to play:
Initially, the board will look similar to this:

	Le Solitaire
	============

		o   o   o

		o   o   o

	o   o   o   o   o   o   o

	o   o   o   .   o   o   o

	o   o   o   o   o   o   o

		o   o   o

		o   o   o

Let's call the o's stones and the .'s holes.  One stone fits into one
hole.  As you can see, all holes but one are occupied by stones.  The
aim of the game is to get rid of all but one stone, leaving that last
one in the middle of the board if you're cool.

A stone can be moved if there is another stone next to it, and a hole
after that one.  Thus there must be three fields in a row, either
horizontally or vertically, up, down, left or right, which look like
this:  o  o  .

Then the first stone is moved to the hole, jumping over the second,
which therefore is taken away.  The above thus `evaluates' to:  .  .  o

That's all.  Here's the board after two moves:

		o   o   o

		.   o   o

	o   o   .   o   o   o   o

	o   .   o   o   o   o   o

	o   o   o   o   o   o   o

		o   o   o

		o   o   o

Pick your favorite shortcuts:

\{solitaire-mode-map}
(defalias 'solitaire #[(_arg) "\305\306!\210\307\310 \210\307\311\312 \210\313 \210db\210\314\315!`C\211)\207" [inhibit-read-only buffer-read-only solitaire-stones solitaire-center buffer-undo-list switch-to-buffer "*Solitaire*" t solitaire-mode 32 solitaire-insert-board solitaire-build-mode-line search-backward "."] 2 (#$ . 5415) "P"])
(defalias 'solitaire-build-mode-line #[nil "\302\303\304\305W\203\306\307\"\202\310\311\312\313\314\315\316\257\n\317 \207" [solitaire-stones mode-line-format "" "---" mode-line-buffer-identification 1 format "--> There are %d stones left <--" "------" global-mode-string "   %[(" mode-name minor-mode-alist "%n" ")%]-%-" force-mode-line-update] 10])
(defalias 'solitaire-insert-board #[nil "\306\307 \310 	\311V\203\312\202	\313V\203\314\202\315\n\316V\203(\317\202)\320\321\322	\323G\324_#\325\245\326\"\327 \210\321\322\n\323\n\330V\203I\331\202J\332\fGS\324_$\325\245\333\"c\210\f\317\230\204b\n\330V\203n\334\335
\"c\210\334\336
\"c\210
c\210`&i'\337 (\334\340\211\211\211\f&c\210\334\341
\211\211\211\f&c\210\334\342
\211\211\211\211\211\f&	c\210\334\343
\211\211%c\210`)\334\344\211\211\f%c\210\334\342
\211\211\211\211\211\f&	c\210\334\341
\211\211\211\f&c\210\334\345
\211\211\211\211\211&c\210`*i+\337 \211,.\207" [buffer-read-only w h hsep vsep indent nil window-width window-height 26 "   " 20 " " "" 17 "\n\n" "\n" make-string - 7 6 2 32 erase-buffer 12 3 0 10 format "%sLe Solitaire\n" "%s============\n\n" solitaire-current-line " %s %so%so%so%s" "%s %s %so%so%so%s" "%so%so%so%so%so%so%so%s" "%so%so%so%s" ".%so%so%so%s" "%s %s %so%so%so%s %s " solitaire-start solitaire-start-x solitaire-start-y solitaire-center solitaire-end solitaire-end-x solitaire-end-y] 10])
(defalias 'solitaire-right #[nil "`\301u\210g\302U\203\301u\210\202g\303U\204#g\302U\204#g\304U\205%b)\207" [start nil 32 0 10] 2 nil nil])
(defalias 'solitaire-left #[nil "`\301u\210g\302U\203\301u\210\202h\303U\204#g\302U\204#g\304U\205%b)\207" [start -1 32 0 10] 2 nil nil])
(defalias 'solitaire-up #[nil "`i\302y\210\303!\210g\304U\203 \302y\203 \303!\203 n\203h\305U\2048g\306U\2048g\307U\2048g\304U\205:	b*\207" [c start -1 move-to-column 10 0 32 61] 2 nil nil])
(defalias 'solitaire-down #[nil "`i\302y\210\303!\210g\304U\203 \302y\203 \303!\203 l\203g\305U\2042g\306U\2042g\304U\2054	b*\207" [c start 1 move-to-column 10 0 32] 2 nil nil])
(defalias 'solitaire-center-point #[nil "b\207" [solitaire-center] 1 nil nil])
(defalias 'solitaire-move-right #[nil "\300\301!\207" [solitaire-move [right]] 2 nil nil])
(defalias 'solitaire-move-left #[nil "\300\301!\207" [solitaire-move [left]] 2 nil nil])
(defalias 'solitaire-move-up #[nil "\300\301!\207" [solitaire-move [up]] 2 nil nil])
(defalias 'solitaire-move-down #[nil "\300\301!\207" [solitaire-move [down]] 2 nil nil])
#@293 Check if a move is possible from current point in the specified direction.
MOVESYMBOL specifies the direction.
Returns either a string, indicating cause of contraindication, or a
list containing three numbers: starting field, skipped field (from
which a stone will be taken away) and target.
(defalias 'solitaire-possible-move #[(movesymbol) "\212	>\203>` \210` \210`\nU\203\305\202:\ff\306U\2032f\306U\2032\nf\307U\2046\310\202:\f\nE+\202?\311)\207" [movesymbol solitaire-valid-directions target skip start "Off Board!" 111 46 "Wrong move!" "Not a valid direction"] 3 (#$ . 9923)])
#@53 Pseudo-prefix command to move a stone in Solitaire.
(defalias 'solitaire-move #[(dir) "\306\307	\"!\310\n;\203\311\n!\202R\n@\nA@\nAA@\211b\210\312\313!\210\314c\210
b\210\312\313!\210\314c\210\fb\210\312\313!\210\315c\210\fb\210S\316 \210\205Q\317 +*\207" [solitaire-mode-map dir class buffer-read-only target skip solitaire-possible-move lookup-key nil error delete-char 1 46 111 solitaire-build-mode-line solitaire-do-check start solitaire-stones solitaire-auto-eval] 5 (#$ . 10530) "kMove where? "])
#@27 Undo a move in Solitaire.
(defalias 'solitaire-undo #[(arg) "\306\307	!\210)\212\310b\210\311\312\f\313#\2038i
Y\203
iX\203
\314 Y\203
\314 X\203
\nT\202
\n))\315 \210\205G\316 \207" [buffer-read-only arg count solitaire-end solitaire-start solitaire-start-x nil undo 0 search-backward "o" done solitaire-current-line solitaire-build-mode-line solitaire-do-check solitaire-end-x solitaire-start-y solitaire-end-y solitaire-stones solitaire-auto-eval] 4 (#$ . 11057) "P"])
(defalias 'solitaire-check #[nil "\212\306U\203\307\202?	b\210\307\310\311\312#\203=i\fY\203i
X\203\313 Y\203\313 X\203\314\315\"\210\202\n))\207" [solitaire-stones solitaire-end count solitaire-start solitaire-start-x solitaire-end-x 1 0 search-backward "o" done solitaire-current-line mapc #[(movesymbol) "\302!<\205	T\211\207" [movesymbol count solitaire-possible-move] 2] solitaire-start-y solitaire-end-y solitaire-valid-directions] 4])
#@44 Check for any possible moves in Solitaire.
(defalias 'solitaire-do-check #[(&optional _arg) "\302 	\303U\203\304\305!\202+\306!\203\304\307!\202+\303U\203'\304\310!\202+\304\311\")\207" [moves solitaire-stones solitaire-check 1 message "Yeah! You made it! Only the King is left!" zerop "Sorry, no more possible moves." "There is one possible move." "There are %d possible moves."] 3 (#$ . 12025) "P"])
#@68 Return the vertical position of point.
Seen in info on text lines.
(defalias 'solitaire-current-line #[nil "\300\301e`\"i\302U\203\303\202\302\304#\207" [+ count-lines 0 1 -1] 4 (#$ . 12445)])
#@93 Spoil Solitaire by solving the game for you - nearly ...
... stops with five stones left ;)
(defalias 'solitaire-solve #[nil "\303W\203\n\304\305!\210\306\307\310 \210\311\312\n\"\210*\313 \207" [solitaire-stones solitaire-auto-eval allmoves 32 error "Cannot solve game in progress" [up up S-down up left left S-right up up left S-down up up right right S-left down down down S-up up S-down down down down S-up left left down S-right left left up up S-down right right right S-left left S-right right right right S-left right down down S-up down down left left S-right up up up S-down down S-up up up up S-down up right right S-left down right right down S-up left left left S-right right S-left down down left S-right S-up S-left S-left S-down S-right up S-right left left] nil solitaire-center-point mapc #[(op) "\301>\203\n\302\303!\210\304\305!!\210\306>\205\302\307!\207" [op (S-left S-right S-up S-down) sit-for 0.2 execute-kbd-macro vector (S-left S-right S-up S-down) 0.4] 3] solitaire-do-check] 3 (#$ . 12648) nil])
(provide 'solitaire)

MMCT - 2023