aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeder O. Klingenberg2015-11-17 21:47:27 +0100
committerNicolas Richard2015-11-18 13:25:08 +0100
commit3e309ad86c8f11765d28a875bb2299d0e214d16d (patch)
treea569e848fed69ee5f0849113f430dc623ae45b34
parent2e6d7d1e3408168545d5afd33ae8dd5a2881a22c (diff)
downloademacs-3e309ad86c8f11765d28a875bb2299d0e214d16d.tar.gz
emacs-3e309ad86c8f11765d28a875bb2299d0e214d16d.zip
Fix savegames in dunnet
* lisp/play/dunnet.el (dun-rot13): Use the standard rot13-region instead of separate implementation.
-rw-r--r--lisp/play/dunnet.el23
1 files changed, 1 insertions, 22 deletions
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index ba137f54d8c..8aba50b8dc5 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -1321,29 +1321,8 @@ for a moment, then straighten yourself up.
1321 (setq new-inven (append new-inven (list x))))) 1321 (setq new-inven (append new-inven (list x)))))
1322 (setq dun-inventory new-inven))) 1322 (setq dun-inventory new-inven)))
1323 1323
1324
1325(let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper)
1326 (setq dun-translate-table (make-vector 256 0))
1327 (while (< i 256)
1328 (aset dun-translate-table i i)
1329 (setq i (1+ i)))
1330 (setq lower (concat lower lower))
1331 (setq upper (upcase lower))
1332 (setq i 0)
1333 (while (< i 26)
1334 (aset dun-translate-table (+ ?a i) (aref lower (+ i 13)))
1335 (aset dun-translate-table (+ ?A i) (aref upper (+ i 13)))
1336 (setq i (1+ i))))
1337
1338(defun dun-rot13 () 1324(defun dun-rot13 ()
1339 (let (str len (i 0)) 1325 (rot13-region (point-min) (point-max)))
1340 (setq str (buffer-substring (point-min) (point-max)))
1341 (setq len (length str))
1342 (while (< i len)
1343 (aset str i (aref dun-translate-table (aref str i)))
1344 (setq i (1+ i)))
1345 (erase-buffer)
1346 (insert str)))
1347 1326
1348;;;; 1327;;;;
1349;;;; This section defines the globals that are used in dunnet. 1328;;;; This section defines the globals that are used in dunnet.