diff options
| author | David Kastrup | 2007-02-04 17:29:50 +0000 |
|---|---|---|
| committer | David Kastrup | 2007-02-04 17:29:50 +0000 |
| commit | a87c4c30596729209cd174da7414715d230cb177 (patch) | |
| tree | 437a0645c60f7484144ee22a438b234aa7936693 | |
| parent | e0f95693512fa487411cd9d5f8fbed369941b2af (diff) | |
| download | emacs-a87c4c30596729209cd174da7414715d230cb177.tar.gz emacs-a87c4c30596729209cd174da7414715d230cb177.zip | |
(mpuz-random-puzzle): Fix potential lockup when
`mpuz-allow-double-multiplicator' is non-zero, and correct
calculation of `min'.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2007-02-04 David Kastrup <dak@gnu.org> | ||
| 2 | |||
| 3 | * play/mpuz.el (mpuz-random-puzzle): Fix potential lockup when | ||
| 4 | `mpuz-allow-double-multiplicator' is non-zero, and correct | ||
| 5 | calculation of `min'. | ||
| 6 | |||
| 1 | 2007-02-04 Per Abrahamsen <abraham@dina.kvl.dk> | 7 | 2007-02-04 Per Abrahamsen <abraham@dina.kvl.dk> |
| 2 | 8 | ||
| 3 | * wid-edit.el (widget-default-create): Insert new text at the | 9 | * 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-mode-map>\\[mpuz-offer-abort]." | |||
| 262 | (fillarray mpuz-board nil) ; erase the board | 262 | (fillarray mpuz-board nil) ; erase the board |
| 263 | ;; A,B,C,D & E, are the five rows of our multiplication. | 263 | ;; A,B,C,D & E, are the five rows of our multiplication. |
| 264 | ;; Choose random values, discarding cases with leading zeros in C or D. | 264 | ;; Choose random values, discarding cases with leading zeros in C or D. |
| 265 | (let* ((A (+ 112 (random 888))) | 265 | (let* ((A (if mpuz-allow-double-multiplicator (+ 112 (random 888)) |
| 266 | (min (1+ (/ 1000 A))) | 266 | (+ 125 (random 875)))) |
| 267 | (min (1+ (/ 999 A))) | ||
| 267 | (B1 (+ min (random (- 10 min)))) | 268 | (B1 (+ min (random (- 10 min)))) |
| 268 | B2 C D E) | 269 | B2 C D E) |
| 269 | (while (if (= B1 (setq B2 (+ min (random (- 10 min))))) | 270 | (while (if (= B1 (setq B2 (+ min (random (- 10 min))))) |