aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2002-09-20 18:34:12 +0000
committerRichard M. Stallman <[email protected]>2002-09-20 18:34:12 +0000
commit4bd2c0134a243449ac0802d290c385c1c61233d8 (patch)
tree3ce9f532ec60da9037e3ca345b8b738b2d4fe1db
parent3adec967d3621fb66aeb5af1d4ead59391f856ba (diff)
(bb-right): Respect prefix argument.
(bb-left, bb-up, bb-down): Likewise.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/play/blackbox.el42
2 files changed, 26 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1730550dc9..e54ec8ab5a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-19 Tom Tromey <[email protected]>
+
+ * play/blackbox.el (bb-right): Respect prefix argument.
+ (bb-left, bb-up, bb-down): Likewise.
+
2002-09-19 Richard M. Stallman <[email protected]>
* cus-dep.el (custom-make-dependencies): Fix previous change.
diff --git a/lisp/play/blackbox.el b/lisp/play/blackbox.el
index ea709106e8..bb5aa0b3c1 100644
--- a/lisp/play/blackbox.el
+++ b/lisp/play/blackbox.el
@@ -1,6 +1,6 @@
;;; blackbox.el --- blackbox game in Emacs Lisp
-;; Copyright (C) 1985, 1986, 1987, 1992, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1992, 2001, 2002 Free Software Foundation, Inc.
;; Author: F. Thomas May <[email protected]>
;; Adapted-By: ESR
@@ -275,33 +275,33 @@ a reflection."
(insert (format "\nThere are %d balls in the box" (length bb-board)))
))
-(defun bb-right ()
- (interactive)
- (if (= bb-x 8)
- ()
+(defun bb-right (count)
+ (interactive "p")
+ (while (and (> count 0) (< bb-x 8))
(forward-char 2)
- (setq bb-x (1+ bb-x))))
+ (setq bb-x (1+ bb-x))
+ (setq count (1- count))))
-(defun bb-left ()
- (interactive)
- (if (= bb-x -1)
- ()
+(defun bb-left (count)
+ (interactive "p")
+ (while (and (> count 0) (> bb-x -1))
(backward-char 2)
- (setq bb-x (1- bb-x))))
+ (setq bb-x (1- bb-x))
+ (setq count (1- count))))
-(defun bb-up ()
- (interactive)
- (if (= bb-y -1)
- ()
+(defun bb-up (count)
+ (interactive "p")
+ (while (and (> count 0) (> bb-y -1))
(previous-line 1)
- (setq bb-y (1- bb-y))))
+ (setq bb-y (1- bb-y))
+ (setq count (1- count))))
-(defun bb-down ()
- (interactive)
- (if (= bb-y 8)
- ()
+(defun bb-down (count)
+ (interactive "p")
+ (while (and (> count 0) (< bb-y 8))
(next-line 1)
- (setq bb-y (1+ bb-y))))
+ (setq bb-y (1+ bb-y))
+ (setq count (1- count))))
(defun bb-eol ()
(interactive)