From a87c4c30596729209cd174da7414715d230cb177 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 4 Feb 2007 17:29:50 +0000 Subject: [PATCH] (mpuz-random-puzzle): Fix potential lockup when `mpuz-allow-double-multiplicator' is non-zero, and correct calculation of `min'. --- lisp/ChangeLog | 6 ++++++ lisp/play/mpuz.el | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 477df137161..e5ce226e095 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-02-04 David Kastrup + + * play/mpuz.el (mpuz-random-puzzle): Fix potential lockup when + `mpuz-allow-double-multiplicator' is non-zero, and correct + calculation of `min'. + 2007-02-04 Per Abrahamsen * wid-edit.el (widget-default-create): Insert new text at the diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el index fdc30c05706..5cb2ed0c9ca 100644 --- a/lisp/play/mpuz.el +++ b/lisp/play/mpuz.el @@ -262,8 +262,9 @@ You may abort a game by typing \\\\[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))))) -- 2.11.4.GIT