Function: landmark-human-plays

landmark-human-plays is an interactive and byte-compiled function defined in landmark.el.gz.

Signature

(landmark-human-plays)

Documentation

Signal to the Landmark program that you have played.

You must have put the cursor on the square where you want to play. If the game is finished, this command requests for another game.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/landmark.el.gz
(defun landmark-human-plays ()
  "Signal to the Landmark program that you have played.
You must have put the cursor on the square where you want to play.
If the game is finished, this command requests for another game."
  (interactive)
  (landmark-switch-to-window)
  (cond
   (landmark-emacs-is-computing
    (landmark-crash-game))
   ((not landmark-game-in-progress)
    (landmark-prompt-for-other-game))
   (t
    (let ((square (landmark-point-square))
          score)
      (cond ((null square)
             (error "Your point is not on a square.  Retry!"))
	    ((not (zerop (aref landmark-board square)))
             (error "Your point is not on a free square.  Retry!"))
	    (t
	     (setq score (aref landmark-score-table square))
	     (landmark-play-move square 1)
	     (cond ((and (>= score landmark-losing-threshold)
			 ;; Just testing SCORE > THRESHOLD is not enough for
			 ;; detecting wins, it just gives an indication that
			 ;; we confirm with LANDMARK-FIND-FILLED-QTUPLE.
			 (landmark-find-filled-qtuple square 1))
		    (landmark-terminate-game 'human-won))
		   (t
		    (landmark-emacs-plays)))))))))