403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
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/pong.elc
;ELC
;;; Compiled
;;; in Emacs version 28.2
;;; with all optimizations.



(byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\210\312\313\314\315\316DD\317\320\321%\210\312\322\314\315\323DD\324\320\325%\210\312\326\314\315\327DD\330\320\331%\210\312\332\314\315\333DD\334\320\335%\210\312\336\314\315\337DD\340\320\341%\210\312\342\314\315\343DD\344\320\341%\210\312\345\314\315\346DD\347\320\341%\210\312\350\314\315\351DD\352\320\341%\210\312\353\314\315\354DD\355\320\356%\210\312\357\314\315\360DD\361\320\362%\210\312\363\314\315\364DD\365\320\366%\210\312\367\314\315\370DD\371\320\372%\210\312\373\314\315\374DD\375\320\376%\210\312\377\314\315\201@DD\201A\320\201B%\210\312\201C\314\315\201DDD\201E\320\201F%\210\312\201G\314\315\201HDD\201I\320\201J%\207" [require gamegrid custom-declare-group pong nil "Emacs Lisp implementation of the classical game pong." :tag "Pong" :group games custom-declare-variable pong-buffer-name funcall function #[0 "\300\207" ["*Pong*"] 1 #1=""] "Name of the buffer used to play." :type (string) pong-width #[0 "\300\207" [50] 1 #1#] "Width of the playfield." (integer) pong-height #[0 "\300\301 \302Z^\207" [30 frame-height 6] 3 #1#] "Height of the playfield." (integer) pong-bat-width #[0 "\300\207" [3] 1 #1#] "Width of the bats for pong." (integer) pong-blank-color #[0 "\300\207" ["black"] 1 #1#] "Color used for background." color pong-bat-color #[0 "\300\207" ["yellow"] 1 #1#] "Color used for bats." pong-ball-color #[0 "\300\207" ["red"] 1 #1#] "Color used for the ball." pong-border-color #[0 "\300\207" ["white"] 1 #1#] "Color used for pong borders." pong-left-key #[0 "\300\207" ["4"] 1 #1#] "Alternate key to press for bat 1 to go up (primary one is [left])." (restricted-sexp :match-alternatives (stringp vectorp)) pong-right-key #[0 "\300\207" ["6"] 1 #1#] "Alternate key to press for bat 1 to go down (primary one is [right])." (restricted-sexp :match-alternatives (stringp vectorp)) pong-up-key #[0 "\300\207" ["8"] 1 #1#] "Alternate key to press for bat 2 to go up (primary one is [up])." (restricted-sexp :match-alternatives (stringp vectorp)) pong-down-key #[0 "\300\207" ["2"] 1 #1#] "Alternate key to press for bat 2 to go down (primary one is [down])." (restricted-sexp :match-alternatives (stringp vectorp)) pong-quit-key #[0 "\300\207" ["q"] 1 #1#] "Key to press to quit pong." (restricted-sexp :match-alternatives (stringp vectorp)) pong-pause-key #[0 "\300\207" ["p"] 1 #1#] "Key to press to pause pong." (restricted-sexp :match-alternatives (stringp vectorp)) pong-resume-key #[0 "\300\207" ["p"] 1 #1#] "Key to press to resume pong." (restricted-sexp :match-alternatives (stringp vectorp)) pong-timer-delay #[0 "\300\207" [0.1] 1 #1#] "Time to wait between every cycle." number] 8)
(defvar pong-blank-options '(((glyph colorize) (t 32)) ((color-x color-x) (mono-x grid-x) (color-tty color-tty)) (((glyph color-x) [0 0 0]) (color-tty pong-blank-color))))
(defvar pong-bat-options '(((glyph colorize) (emacs-tty 79) (t 32)) ((color-x color-x) (mono-x mono-x) (color-tty color-tty) (mono-tty mono-tty)) (((glyph color-x) [1 1 0]) (color-tty pong-bat-color))))
(defvar pong-ball-options '(((glyph colorize) (t 42)) ((color-x color-x) (mono-x grid-x) (color-tty color-tty)) (((glyph color-x) [1 0 0]) (color-tty pong-ball-color))))
(defvar pong-border-options '(((glyph colorize) (t 43)) ((color-x color-x) (mono-x grid-x) (color-tty color-tty)) (((glyph color-x) [0.5 0.5 0.5]) (color-tty pong-border-color))))
(defconst pong-blank 0)
(defconst pong-bat 1)
(defconst pong-ball 2)
(defconst pong-border 3)
#@31 Horizontal speed of the ball.
(defvar pong-xx nil (#$ . 3601))
#@29 Vertical speed of the ball.
(defvar pong-yy nil (#$ . 3670))
#@34 Horizontal position of the ball.
(defvar pong-x nil (#$ . 3737))
#@32 Vertical position of the ball.
(defvar pong-y nil (#$ . 3808))
#@29 Vertical position of bat 1.
(defvar pong-bat-player1 nil (#$ . 3877))
#@29 Vertical position of bat 2.
(defvar pong-bat-player2 nil (#$ . 3953))
(defvar pong-score-player1 nil)
(defvar pong-score-player2 nil)
#@24 Modemap for pong-mode.
(defvar pong-mode-map (byte-code "\306\307!\310\311\312#\210\310\313\314#\210\310\315\316#\210\310\317\320#\210\310\312#\210\310	\314#\210\310\n\316#\210\310\320#\210\310\f\321#\210\310
\322#\210\207" [pong-left-key pong-right-key pong-up-key pong-down-key pong-quit-key pong-pause-key make-sparse-keymap pong-mode-map define-key [left] pong-move-left [right] pong-move-right [up] pong-move-up [down] pong-move-down pong-quit pong-pause] 5) (#$ . 4093))
#@25 Null map for pong-mode.
(defvar pong-null-map (make-sparse-keymap 'pong-null-map) (#$ . 4588))
#@61 Computes display options (required by gamegrid for colors).
(defalias 'pong-display-options #[0 "\306\307\310\"\311\211\307W\203A\211U\203	\2028\nU\203!\2028\fU\203+
\2028U\2037\f\2028\312I\210\211T\262\202\210\207" [pong-blank pong-blank-options pong-bat pong-bat-options pong-ball pong-ball-options make-vector 256 nil 0 (nil nil nil) pong-border pong-border-options] 6 (#$ . 4689)])
#@67 Initialize pong buffer and draw stuff thanks to gamegrid library.
(defalias 'pong-init-buffer #[0 "\306!\210\307!\210\310	!\210\311\211\312\313 !\210\314\f\315
\\\316#\210\317
\320\211W\203G\f\320\211W\203>\321#\210\211T\262\202*\266\211T\262\202\"\266\322
\315ZX\203t\322\f\315ZX\203k\321#\210T\262\202W\266T\262\202M\266)\211\\SX\203\222\321\315#\210T\262\202~\266\211\\SX\203\261\321\f\323Z#\210T\262\202\233\317\207" [pong-buffer-name pong-mode-map gamegrid-use-glyphs gamegrid-use-color pong-width pong-height get-buffer-create switch-to-buffer use-local-map t gamegrid-init pong-display-options gamegrid-init-buffer 2 32 nil 0 gamegrid-set-cell 1 3 buffer-read-only pong-border pong-blank pong-bat-player1 pong-bat-width pong-bat pong-bat-player2] 9 (#$ . 5104)])
#@128 Move bat 1 up.
This is called left for historical reasons, since in some pong
implementations you move with left/right paddle.
(defalias 'pong-move-left #[0 "\301V\205S\211\205\302\303\"\207" [pong-bat-player1 1 pong-update-bat 2] 3 (#$ . 5946) [nil (pong-mode)]])
#@18 Move bat 1 down.
(defalias 'pong-move-right #[0 "	\\\nSW\205T\211\205\303\304\"\207" [pong-bat-player1 pong-bat-width pong-height pong-update-bat 2] 3 (#$ . 6225) [nil (pong-mode)]])
#@16 Move bat 2 up.
(defalias 'pong-move-up #[0 "\302V\205S\211\205\303	\304Z\"\207" [pong-bat-player2 pong-width 1 pong-update-bat 3] 3 (#$ . 6422) [nil (pong-mode)]])
#@18 Move bat 2 down.
(defalias 'pong-move-down #[0 "	\\\nSW\205T\211\205\304\305Z\"\207" [pong-bat-player2 pong-bat-width pong-height pong-width pong-update-bat 3] 3 (#$ . 6600) [nil (pong-mode)]])
#@80 Move a bat (suppress a cell and draw another one on the other side).

(fn X Y)
(defalias 'pong-update-bat #[514 "\305p!\230\2054\306	#\210\306\n\\S	#\210\211\307V\203$\306S#\210\211\n\\\fSW\2054\306\n\\#\207" [pong-buffer-name pong-bat pong-bat-width pong-blank pong-height buffer-name gamegrid-set-cell 1] 6 (#$ . 6809)])
#@20 Initialize a game.
(defalias 'pong-init #[0 "\306	\307#\210\310\311\312\313\314$\210\nZ\315\245T\211\316\317\315\245\n\315\245\320 \210\321 \210\322\323\"\210\324 \207" [pong-mode-map pong-pause-key pong-height pong-bat-width pong-bat-player1 pong-bat-player2 define-key pong-pause add-hook kill-buffer-hook pong-quit nil t 2 -1 0 pong-init-buffer gamegrid-kill-timer gamegrid-start-timer pong-update-game pong-update-score pong-xx pong-yy pong-width pong-x pong-y pong-timer-delay] 6 (#$ . 7152)])
#@199 "Main" function for pong.
It is called every pong-cycle-delay seconds and
updates ball and bats positions.  It is responsible of collision
detection and checks if a player scores.

(fn PONG-BUFFER)
(defalias 'pong-update-game #[257 "p=\204	\306 \207	\211\307V\203B\211\nSW\203B\310U\203$\307W\2042\f\311ZU\203;\307V\203;\312
#\210\202B\312#\210\\	\\\307X\203Y[\313\202\207	\\\nSY\203o[\n\310Z\202\207	\\\211\313X\204\202	\n\310ZY\203\207[	\307V\203\233	\nSW\203\233\312	#\210\311U\204\247\310U\203\340\307V\203\340	Y\203\340	\\W\203\340	U\203\313\314\202\330	TU\203\327\307\202\330\313\\[\211\207\f\315ZU\204\360\f\311ZU\203)\307W\203)	Y\203)	\\W\203)	U\203\314\202!	TU\203 \307\202!\313\\[\211\207\313W\2037T\316 \207\fSY\205ET\316 \207" [pong-x pong-y pong-height pong-xx pong-width pong-bat pong-pause 0 2 3 gamegrid-set-cell 1 -1 4 pong-init pong-blank pong-yy pong-ball pong-bat-player1 pong-bat-width pong-bat-player2 pong-score-player2 pong-score-player1] 8 (#$ . 7674)])
#@55 Update score and print it on bottom of the game grid.
(defalias 'pong-update-score #[0 "\304\305	#\211G\306\211W\205%\307p!\n\230\203\310H#\210\211T\262\202\207" [pong-score-player1 pong-score-player2 pong-buffer-name pong-height format "Score:  %d / %d" 0 buffer-name gamegrid-set-cell] 8 (#$ . 8783)])
#@17 Pause the game.
(defalias 'pong-pause #[0 "\302 \210\303\304!\210\305	\306#\207" [pong-mode-map pong-resume-key gamegrid-kill-timer cancel-function-timers pong-update-game define-key pong-resume] 4 (#$ . 9105) [nil (pong-mode)]])
#@23 Resume a paused game.
(defalias 'pong-resume #[0 "\303	\304#\210\305\n\306\"\207" [pong-mode-map pong-pause-key pong-timer-delay define-key pong-pause gamegrid-start-timer pong-update-game] 4 (#$ . 9342) [nil (pong-mode)]])
#@41 Quit the game and kill the pong buffer.
(defalias 'pong-quit #[0 "\302 \210\303\304\305	$\207" [pong-timer-delay pong-buffer-name gamegrid-kill-timer run-with-timer nil kill-buffer] 5 (#$ . 9573) [nil (pong-mode)]])
#@209 Play pong and waste time.
This is an implementation of the classical game pong.
Move left and right bats and try to bounce the ball to your opponent.

pong-mode keybindings:\<pong-mode-map>

\{pong-mode-map}
(defalias 'pong #[0 "\302\211\303 \207" [pong-score-player1 pong-score-player2 0 pong-init] 2 (#$ . 9797) nil])
(provide 'pong)

Youez - 2016 - github.com/yon3zu
LinuXploit