mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-04 02:51:31 -08:00
(solitaire-possible-move): Use funcall to invoke movesymbol.
This commit is contained in:
parent
e81d27c2cf
commit
20a6d217c3
1 changed files with 12 additions and 14 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue