summaryrefslogtreecommitdiff
path: root/lisp/play
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-24 16:49:00 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-24 16:49:00 +0000
commit20a6d217c3da9e09f4866ca0fca80117d1d91c6c (patch)
treee328877c6a1b7805435c66620f19c097e1a580ec /lisp/play
parente81d27c2cf7e0bd41b44c53faf91664f2126154b (diff)
downloademacs-20a6d217c3da9e09f4866ca0fca80117d1d91c6c.tar.gz
(solitaire-possible-move): Use funcall to invoke movesymbol.
Diffstat (limited to 'lisp/play')
-rw-r--r--lisp/play/solitaire.el26
1 files changed, 12 insertions, 14 deletions
diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el
index 4ab7754b324..5b0071839f1 100644
--- a/lisp/play/solitaire.el
+++ b/lisp/play/solitaire.el
@@ -333,20 +333,18 @@ list containing three numbers: starting field, skipped field (from
which a stone will be taken away) and target."
(save-excursion
- (let (move)
- (fset 'move movesymbol)
- (if (memq movesymbol solitaire-valid-directions)
- (let ((start (point))
- (skip (progn (move) (point)))
- (target (progn (move) (point))))
- (if (= skip target)
- "Off Board!"
- (if (or (/= ?o (char-after start))
- (/= ?o (char-after skip))
- (/= ?. (char-after target)))
- "Wrong move!"
- (list start skip target))))
- "Not a valid direction"))))
+ (if (memq movesymbol solitaire-valid-directions)
+ (let ((start (point))
+ (skip (progn (funcall movesymbol) (point)))
+ (target (progn (funcall movesymbol) (point))))
+ (if (= skip target)
+ "Off Board!"
+ (if (or (/= ?o (char-after start))
+ (/= ?o (char-after skip))
+ (/= ?. (char-after target)))
+ "Wrong move!"
+ (list start skip target))))
+ "Not a valid direction")))
(defun solitaire-move (dir)
"Pseudo-prefix command to move a stone in Solitaire."