aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1993-08-01 20:50:07 +0000
committerPaul Eggert1993-08-01 20:50:07 +0000
commitc9575b25acfec3493b56d63deb78c7e19ae0ec8c (patch)
tree708cf7ca7f60433b7c1503f29264c8cb4b5d78a7
parente00fcc05ecc69e9f0d74a25d021c43528c08004c (diff)
downloademacs-c9575b25acfec3493b56d63deb78c7e19ae0ec8c.tar.gz
emacs-c9575b25acfec3493b56d63deb78c7e19ae0ec8c.zip
(mpuz-random): Remove.
All callers changed to use `random' instead.
-rw-r--r--lisp/play/mpuz.el11
1 files changed, 3 insertions, 8 deletions
diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el
index b0d7aeaab0c..d04889f8a6f 100644
--- a/lisp/play/mpuz.el
+++ b/lisp/play/mpuz.el
@@ -33,11 +33,6 @@
33 33
34(random t) ; randomize 34(random t) ; randomize
35 35
36(defun mpuz-random (n)
37 "Return a random integer between 0 and N - 1 inclusive."
38 (setq n (% (random) n))
39 (if (< n 0) (- n) n))
40
41(defvar mpuz-silent nil 36(defvar mpuz-silent nil
42 "*Set this to T if you don't want dings on inputs.") 37 "*Set this to T if you don't want dings on inputs.")
43 38
@@ -142,7 +137,7 @@ You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
142 (index 10) 137 (index 10)
143 elem) 138 elem)
144 (while letters 139 (while letters
145 (setq elem (nth (mpuz-random index) letters) 140 (setq elem (nth (random index) letters)
146 letters (delq elem letters) 141 letters (delq elem letters)
147 index (1- index)) 142 index (1- index))
148 (aset mpuz-digit-to-letter index elem) 143 (aset mpuz-digit-to-letter index elem)
@@ -185,8 +180,8 @@ You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
185 ;; A,B,C,D & E, are the five rows of our multiplication. 180 ;; A,B,C,D & E, are the five rows of our multiplication.
186 ;; Choose random values, discarding uninteresting cases. 181 ;; Choose random values, discarding uninteresting cases.
187 (while (progn 182 (while (progn
188 (setq A (mpuz-random 1000) 183 (setq A (random 1000)
189 B (mpuz-random 100) 184 B (random 100)
190 C (* A (% B 10)) 185 C (* A (% B 10))
191 D (* A (/ B 10)) 186 D (* A (/ B 10))
192 E (* A B)) 187 E (* A B))