]> code.delx.au - gnu-emacs/blobdiff - lisp/play/mpuz.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / play / mpuz.el
index ebeeb3159f8e582b15321e6df7f2e4dcb8528fc1..4cd3bd673ff3169907969e4d667504bd49b75933 100644 (file)
@@ -1,7 +1,7 @@
 ;;; mpuz.el --- multiplication puzzle for GNU Emacs
 
-;; Copyright (C) 1990, 2002, 2003, 2004, 2005,
-;;   2006 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>
 ;; Overhauled: Daniel Pfeiffer <occitan@esperanto.org>
@@ -11,7 +11,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -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)))))