Mercurial > hg > xemacs-beta
comparison lisp/games/mpuz.el @ 4:b82b59fe008d r19-15b3
Import from CVS: tag r19-15b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:56 +0200 |
parents | 376386a54a3c |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
3:30df88044ec6 | 4:b82b59fe008d |
---|---|
1 ;;; mpuz.el --- multiplication puzzle for XEmacs | 1 ;;; mpuz.el --- multiplication puzzle for XEmacs |
2 | 2 |
3 ;;; Copyright (C) 1990 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1990 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Philippe Schnoebelen <phs@lifia.imag.fr> | 5 ;; Author: Philippe Schnoebelen <phs@lifia.imag.fr> |
6 ;; Keywords: games | 6 ;; Keywords: games |
7 | 7 |
8 ;; This file is part of XEmacs. | 8 ;; This file is part of XEmacs. |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 ;; General Public License for more details. | 18 ;; General Public License for more details. |
19 | 19 |
20 ;; You should have received a copy of the GNU General Public License | 20 ;; You should have received a copy of the GNU General Public License |
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free | 21 ;; along with XEmacs; see the file COPYING. If not, write to the Free |
22 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
23 | 23 ;; 02111-1307, USA. |
24 ;;; Synched up with: FSF 19.30. | 24 |
25 ;;; Synched up with: FSF 19.34. | |
25 | 26 |
26 ;;; Commentary: | 27 ;;; Commentary: |
27 | 28 |
28 ;; When this package is loaded, `M-x mpuz' generates a random multiplication | 29 ;; When this package is loaded, `M-x mpuz' generates a random multiplication |
29 ;; puzzle. This is a multiplication example in which each digit has been | 30 ;; puzzle. This is a multiplication example in which each digit has been |
185 B (random 100) | 186 B (random 100) |
186 C (* A (% B 10)) | 187 C (* A (% B 10)) |
187 D (* A (/ B 10)) | 188 D (* A (/ B 10)) |
188 E (* A B)) | 189 E (* A B)) |
189 (or (< C 1000) (< D 1000)))) ; forbid leading zeros in C or D | 190 (or (< C 1000) (< D 1000)))) ; forbid leading zeros in C or D |
190 ;; Individual digits are now put on their respectives squares. | 191 ;; Individual digits are now put on their respective squares. |
191 ;; [NB: A square is a pair <row,column> of the screen.] | 192 ;; [NB: A square is a pair <row,column> of the screen.] |
192 (mpuz-put-digit-on-board A '(2 . 9)) | 193 (mpuz-put-digit-on-board A '(2 . 9)) |
193 (mpuz-put-digit-on-board (/ A 10) '(2 . 7)) | 194 (mpuz-put-digit-on-board (/ A 10) '(2 . 7)) |
194 (mpuz-put-digit-on-board (/ A 100) '(2 . 5)) | 195 (mpuz-put-digit-on-board (/ A 100) '(2 . 5)) |
195 (mpuz-put-digit-on-board B '(4 . 9)) | 196 (mpuz-put-digit-on-board B '(4 . 9)) |