mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Fix savegames in dunnet
* lisp/play/dunnet.el (dun-rot13): Use the standard rot13-region instead of separate implementation.
This commit is contained in:
parent
2e6d7d1e34
commit
3e309ad86c
1 changed files with 1 additions and 22 deletions
|
|
@ -1321,29 +1321,8 @@ for a moment, then straighten yourself up.
|
|||
(setq new-inven (append new-inven (list x)))))
|
||||
(setq dun-inventory new-inven)))
|
||||
|
||||
|
||||
(let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper)
|
||||
(setq dun-translate-table (make-vector 256 0))
|
||||
(while (< i 256)
|
||||
(aset dun-translate-table i i)
|
||||
(setq i (1+ i)))
|
||||
(setq lower (concat lower lower))
|
||||
(setq upper (upcase lower))
|
||||
(setq i 0)
|
||||
(while (< i 26)
|
||||
(aset dun-translate-table (+ ?a i) (aref lower (+ i 13)))
|
||||
(aset dun-translate-table (+ ?A i) (aref upper (+ i 13)))
|
||||
(setq i (1+ i))))
|
||||
|
||||
(defun dun-rot13 ()
|
||||
(let (str len (i 0))
|
||||
(setq str (buffer-substring (point-min) (point-max)))
|
||||
(setq len (length str))
|
||||
(while (< i len)
|
||||
(aset str i (aref dun-translate-table (aref str i)))
|
||||
(setq i (1+ i)))
|
||||
(erase-buffer)
|
||||
(insert str)))
|
||||
(rot13-region (point-min) (point-max)))
|
||||
|
||||
;;;;
|
||||
;;;; This section defines the globals that are used in dunnet.
|
||||
|
|
|
|||
Loading…
Reference in a new issue