;;; mpuz.el --- multiplication puzzle for GNU Emacs
-;; Copyright (C) 1990, 2002, 2005 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>
(t (:bold t)))
"*Face to use for letters to be solved."
:group 'mpuz)
-;; backward-compatibility alias
-(put 'mpuz-unsolved-face 'face-alias 'mpuz-unsolved)
(defface mpuz-solved
'((((class color)) (:foreground "green1" :bold t))
(t (:bold t)))
"*Face to use for solved digits."
:group 'mpuz)
-;; backward-compatibility alias
-(put 'mpuz-solved-face 'face-alias 'mpuz-solved)
(defface mpuz-trivial
'((((class color)) (:foreground "blue" :bold t))
(t (:bold t)))
"*Face to use for trivial digits solved for you."
:group 'mpuz)
-;; backward-compatibility alias
-(put 'mpuz-trivial-face 'face-alias 'mpuz-trivial)
(defface mpuz-text
'((t (:inherit variable-pitch)))
"*Face to use for text on right."
:group 'mpuz)
-;; backward-compatibility alias
-(put 'mpuz-text-face 'face-alias 'mpuz-text)
\f
;; Mpuz mode and keymaps
(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)))))
(defun mpuz-offer-abort ()
"Ask if user wants to abort current puzzle."
(interactive)
- (if (y-or-n-p "Abort game ")
+ (if (y-or-n-p "Abort game? ")
(let ((buf (mpuz-get-buffer)))
(message "Mult Puzzle aborted.")
(setq mpuz-in-progress nil
(mpuz-ding t))
(t
(mpuz-try-proposal letter-char digit-char))))
- (if (y-or-n-p "Start a new game ")
+ (if (y-or-n-p "Start a new game? ")
(mpuz-start-new-game)
(message "OK. I won't."))))
(t "not serious.")))))
(message message)
(sit-for 4)
- (if (y-or-n-p (concat message " Start a new game "))
+ (if (y-or-n-p (concat message " Start a new game? "))
(mpuz-start-new-game)
(message "Good Bye!"))))