aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/play/mpuz.el
diff options
context:
space:
mode:
authorDavid Kastrup <[email protected]>2007-02-04 17:29:50 +0000
committerDavid Kastrup <[email protected]>2007-02-04 17:29:50 +0000
commita87c4c30596729209cd174da7414715d230cb177 (patch)
tree437a0645c60f7484144ee22a438b234aa7936693 /lisp/play/mpuz.el
parente0f95693512fa487411cd9d5f8fbed369941b2af (diff)
(mpuz-random-puzzle): Fix potential lockup when
`mpuz-allow-double-multiplicator' is non-zero, and correct calculation of `min'.
Diffstat (limited to 'lisp/play/mpuz.el')
-rw-r--r--lisp/play/mpuz.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el
index fdc30c0570..5cb2ed0c9c 100644
--- a/lisp/play/mpuz.el
+++ b/lisp/play/mpuz.el
@@ -262,8 +262,9 @@ You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
(fillarray mpuz-board nil) ; erase the board
;; A,B,C,D & E, are the five rows of our multiplication.
;; Choose random values, discarding cases with leading zeros in C or D.
- (let* ((A (+ 112 (random 888)))
- (min (1+ (/ 1000 A)))
+ (let* ((A (if mpuz-allow-double-multiplicator (+ 112 (random 888))
+ (+ 125 (random 875))))
+ (min (1+ (/ 999 A)))
(B1 (+ min (random (- 10 min))))
B2 C D E)
(while (if (= B1 (setq B2 (+ min (random (- 10 min)))))