]> git.eshelyaron.com Git - emacs.git/commitdiff
Set up combination and random item location
authorMark Oteiza <mvoteiza@udel.edu>
Wed, 18 Jan 2017 04:15:25 +0000 (23:15 -0500)
committerMark Oteiza <mvoteiza@udel.edu>
Sun, 19 Feb 2017 13:28:50 +0000 (08:28 -0500)
* lisp/play/dunnet.el (dun-combination): Make defconst.
(tloc, tcomb): Remove.  Replace with a top-level form.

lisp/play/dunnet.el

index 95a9e9ce7d0effa9e2a95ce645cb08983d3350d1..1c8fab050929b3c74efbe16569002b30dd8df8aa 100644 (file)
@@ -1123,6 +1123,8 @@ treasures for points?" "4" "four")
     ("What network protocol is used between pokey and gamma?"
      "tcp/ip" "ip" "tcp")))
 
+(defconst dun-combination (prin1-to-string (+ 100 (random 899))))
+
 ;;;; Mode definitions for interactive mode
 
 (define-derived-mode dun-mode text-mode "Dungeon"
@@ -2964,12 +2966,9 @@ drwxr-xr-x  3 root     staff          2048 Jan 1 1970 ..")
     (dun-uexit nil)))
 
 
-(setq tloc (+ 60 (random 18)))
-(dun-replace dun-room-objects tloc
-            (append (nth tloc dun-room-objects) (list 18)))
-
-(setq tcomb (+ 100 (random 899)))
-(setq dun-combination (prin1-to-string tcomb))
+(let ((tloc (+ 60 (random 18))))
+  (dun-replace dun-room-objects tloc
+               (append (nth tloc dun-room-objects) (list 18))))
 
 ;;;;
 ;;;; This section defines the DOS emulation functions for dunnet