aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-24 16:49:00 +0000
committerRichard M. Stallman1998-05-24 16:49:00 +0000
commit20a6d217c3da9e09f4866ca0fca80117d1d91c6c (patch)
treee328877c6a1b7805435c66620f19c097e1a580ec
parente81d27c2cf7e0bd41b44c53faf91664f2126154b (diff)
downloademacs-20a6d217c3da9e09f4866ca0fca80117d1d91c6c.tar.gz
emacs-20a6d217c3da9e09f4866ca0fca80117d1d91c6c.zip
(solitaire-possible-move): Use funcall to invoke movesymbol.
-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
333which a stone will be taken away) and target." 333which a stone will be taken away) and target."
334 334
335 (save-excursion 335 (save-excursion
336 (let (move) 336 (if (memq movesymbol solitaire-valid-directions)
337 (fset 'move movesymbol) 337 (let ((start (point))
338 (if (memq movesymbol solitaire-valid-directions) 338 (skip (progn (funcall movesymbol) (point)))
339 (let ((start (point)) 339 (target (progn (funcall movesymbol) (point))))
340 (skip (progn (move) (point))) 340 (if (= skip target)
341 (target (progn (move) (point)))) 341 "Off Board!"
342 (if (= skip target) 342 (if (or (/= ?o (char-after start))
343 "Off Board!" 343 (/= ?o (char-after skip))
344 (if (or (/= ?o (char-after start)) 344 (/= ?. (char-after target)))
345 (/= ?o (char-after skip)) 345 "Wrong move!"
346 (/= ?. (char-after target))) 346 (list start skip target))))
347 "Wrong move!" 347 "Not a valid direction")))
348 (list start skip target))))
349 "Not a valid direction"))))
350 348
351(defun solitaire-move (dir) 349(defun solitaire-move (dir)
352 "Pseudo-prefix command to move a stone in Solitaire." 350 "Pseudo-prefix command to move a stone in Solitaire."