home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Club Elmshorn Atari PD
/
CCE_PD.iso
/
pc
/
0400
/
CCE_0410.ZIP
/
CCE_0410.PD
/
EMACS_58.ZOO
/
e-lisp
/
getris.elc
< prev
next >
Wrap
Text File
|
1992-05-20
|
10KB
|
179 lines
(provide (quote getris))
(defvar getris-initial-delay 10 "\
*delay count to control the speed of getris game. bigger means slower.
You should substitute this value according to your system's performance.")
(defvar getris-min-delay 2 "\
*Minimum delay count to control the maximum speed of getris game.
Smaller means faster. The default value, 2, means `as fast as possible.'")
(defvar getris-acceleration 200 "\
*Acceleration rate of getris game.
Smaller value means quicker speed-up. This value is performance independent.")
(defvar getris-high-score-file (or (getenv "GETRISFILE") "$HOME/.getris") "\
*File name where top ten scores of getris are recorded.
Initialized from GETRISFILE environment variable.
Nil means does not record scores.")
(defvar getris-block-string (if (and (boundp (quote kanji-flag)) kanji-flag)
"**" "**") "\ *String for getris block. Must be width of two column.")
(defvar getris-width 10 "\
*Width of getris board (number of blocks). Each block occupies two
column width on window.")
(defvar getris-use-full-window nil "\
*Non-nil means that starting Getris game deletes other windows.")
(defun getris nil "\
Clone of a famous Russian game program." (interactive) (byte-code "IJêא ë⓪êבג!êד êה ç" [getris-previous-window-configuration nil current-window-configuration switch-to-buffer "*Getris*" getris-mode getris-startup] 5))
(defvar getris-command-vector nil "\
Vector of functions which maps character to getris command.")
(defvar getris-mode-map nil)
(defvar getris-piece-data nil "\
Vector of piece data.
Each element of this vector is vector of size four, which correspond
to four directions of piece. And each element of four size vectors is
a list of form:
(max-y-offset (x1 . y1) (x2 . y2) (x3 . y3) (x4 . y4))
where:
(x1 . y1) ... (x4 . y4) are offsets of dot from imaginary `origin'
at upper-left side of the piece,
0 <= y[1-4] <= max-y-offset.")
(defvar getris-left-margin)
(defvar getris-height)
(defvar getris-previous-window-configuration nil)
(defvar getris-blank-line)
(defvar getris-complete-line)
(defvar getris-line-length)
(defun getris-startup nil (byte-code "IJë⓪êב êebêגד!cêהed\"êאë⓪ç" [buffer-read-only nil t erase-buffer substitute-command-keys "
<<< G E T R I S >>>
Clone of a famous Russian game program.
Originally written by
MAEDA Atusi
mad@nakanishi.math.keio.junet
<Type \\[getris-mode-help] for help, \\[getris-start] to start game.>
" center-region] 5))
(defun getris-mode-help nil (interactive) (byte-code "ijêIJאבג!בד!בה!בו!בז!%!ç" [nil message concat substitute-command-keys "\\[getris-mode-help]:Print this " "\\[getris-start]:Start new game " "\\[getris-help]:List action keys " "\\[boss-has-come]:Boss has come! " "\\[getris-exit]:Exit"] 12))
(or getris-mode-map (progn (setq getris-mode-map (make-sparse-keymap)) (define-key getris-mode-map "?" (quote getris-mode-help)) (define-key getris-mode-map "" (quote getris-start)) (define-key getris-mode-map "h" (quote getris-help)) (define-key getris-mode-map "" (quote boss-has-come)) (define-key getris-mode-map "q" (quote getris-exit))))
(defun getris-help nil (interactive) (byte-code "ijêIJא!ç" [nil message "j:Left k:Rotate l:Right Space:Drop ESC:Escape q:Exit"] 2))
(or getris-command-vector (progn (setq getris-command-vector (make-vector 256 (quote getris-help))) (aset getris-command-vector 106 (quote getris-move-left)) (aset getris-command-vector 107 (quote getris-rotate)) (aset getris-command-vector 108 (quote getris-move-right)) (aset getris-command-vector 32 (quote getris-drop)) (aset getris-command-vector 113 (quote getris-quit)) (aset getris-command-vector 27 (quote getris-boss-has-come))))
(defun getris-mode nil "\
Major mode for playing getris game.
\\{getris-mode-map}
Type \\[getris-help] for key action in the game.
Entry to this mode calls the value of getris-mode-hook
if that value is non-nil." (interactive) (byte-code "דêה êוז!êחë⓪êטë①êי
!êכp!êגë③êל êמנ!ç" [major-mode mode-name getris-mode-map buffer-read-only t nil kill-all-local-variables make-local-variable global-mode-string getris-mode "Getris" use-local-map buffer-flush-undo getris-mode-help run-hooks getris-mode-hook] 7))
(defun getris-start nil (interactive) (byte-code "יêלמ!ê✓â נ é. ס ê עWà\" פצקע Z\"Tא\"ê♪רWà. פר♪Z!êס ê♪רWå; עWàA שת!êן Sך\"םןצק╱\"ך\"ףRë⑤êץם§✓╱\"םR!ë⑥◆êGë⑥ êיë⑥
ê∧ ê∞♪Wàî cêTë⑥êéx )êןαצק╱\"\\β\"Pc)êΓא!êπΣìç" [getris-use-full-window getris-left-margin t getris-height left-margin-space getris-blank-line getris-width getris-complete-line getris-block-string getris-line-length buffer-read-only nil i switch-to-buffer "*Getris*" delete-other-windows getris-get-window-size 5 enlarge-window * 2 20 error "Window size too small for getris." make-string 32 "||" "||
" regexp-quote getris-repeat-string erase-buffer 0 4 61 random getris-quit-tag (byte-code "ij êIJ ç" [getris-main-loop getris-mode-help] 3)] 20))
(defun getris-get-window-size nil (byte-code "ב גZë⓪êדהו זג
\"ח#ג\"ë①ç" [getris-height getris-left-margin getris-width window-height 2 / - window-width * 4] 8))
(defun getris-repeat-string (string times) (byte-code "ב⑧ גVà⑥
✓Pë⓪ê Së①êé⇩ ê✓)ç" [result times string "" 0] 3))
(defun getris-exit nil (interactive) (byte-code "IJêא✓!ç" [getris-previous-window-configuration nil set-window-configuration] 2))
(defun abs (number) (byte-code "✓IJWâ♪ ✓[é ✓ç" [number 0] 2))
(defun getris-main-loop nil (byte-code " תתןך╱ם\"ף#ץ╱§\"∧∧∧∧∧♪
✓◆ə⑧∞αβ ◆\"ם\"\\⑥ Γ⑥
απβ !§\"⑥♪απβ !Σ\"⑥H⑥♪Hë⑥⓪êσ ת⓪#àם σ
T⓪#à† µ
Të⑥
⓪#êτ①Φ ץ♪②\"Z#ë⓪ê✓ë⑥✓ê✓Së⑥✓תVà« ♪Të③êΘ à¬ Ω③rH!êéÅ êδ
⓪#êéb êµ
⓪#êן
⓪@∮
⓪\"#ë②êϕ êé&