mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-05 20:43:08 +00:00
(solitaire-possible-move): Use funcall to invoke movesymbol.
This commit is contained in:
parent
e81d27c2cf
commit
20a6d217c3
@ -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."
|
||||
|
Loading…
x
Reference in New Issue
Block a user