# HG changeset patch # User David Kastrup # Date 1170610190 0 # Node ID 6986faa706cac5b82cc3d4b306880529f9a412f1 # Parent 5181776fdb930183ec611805bbe11eaa38e91906 (mpuz-random-puzzle): Fix potential lockup when `mpuz-allow-double-multiplicator' is non-zero, and correct calculation of `min'. diff -r 5181776fdb93 -r 6986faa706ca lisp/ChangeLog --- a/lisp/ChangeLog Sun Feb 04 16:02:32 2007 +0000 +++ b/lisp/ChangeLog Sun Feb 04 17:29:50 2007 +0000 @@ -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 -r 5181776fdb93 -r 6986faa706ca lisp/play/mpuz.el --- a/lisp/play/mpuz.el Sun Feb 04 16:02:32 2007 +0000 +++ b/lisp/play/mpuz.el Sun Feb 04 17:29:50 2007 +0000 @@ -262,8 +262,9 @@ (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)))))