• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/play/

Lines Matching defs:game

35 ;;; Lm is a relatively non-participatory game in which a robot
286 ;; qtuple is winning the game. Just after this comes the "XXXX" qtuple because
287 ;; not playing in it is just loosing the game, and so on. Note that a
559 ;; Several variables are used to monitor a game, including a GAME-HISTORY (the
564 (defvar lm-game-in-progress nil
565 "Non-nil if a game is in progress.")
567 (defvar lm-game-history nil
568 "A record of all moves that have been played during current game.")
571 "Number of moves already played in current game.")
574 "Number of moves already played by human in current game.")
580 "Non-nil if Human took back a move during the game.")
590 (defun lm-start-game (n m)
591 "Initialize a new game on an N by M board."
593 (setq lm-game-in-progress t)
599 lm-game-history nil
617 (setq lm-game-history
619 lm-game-history)
631 (let* ((last-move (car lm-game-history))
636 (setq lm-game-history (cdr lm-game-history)
663 (defun lm-terminate-game (result)
664 "Terminate the current game with RESULT."
667 (if (eq result 'crash-game)
669 "Sorry, I have been interrupted and cannot resume that game..."))
672 (setq lm-game-in-progress nil))
674 (defun lm-crash-game ()
677 (lm-terminate-game 'crash-game)
679 (lm-prompt-for-other-game))
690 (lm-crash-game))
691 ((not lm-game-in-progress)
692 (lm-prompt-for-other-game))
698 (lm-terminate-game 'nobody-won))
705 (lm-terminate-game 'emacs-won))
707 (lm-terminate-game 'nobody-won))
711 (lm-terminate-game 'draw-agreed))
756 If the game is finished, this command requests for another game."
761 (lm-crash-game))
762 ((not lm-game-in-progress)
763 (lm-prompt-for-other-game))
779 (lm-terminate-game 'human-won))
789 (lm-crash-game))
790 ((not lm-game-in-progress)
793 (lm-prompt-for-other-game))
813 (lm-crash-game))
814 ((not lm-game-in-progress)
815 (message "There is no game in progress"))
817 (lm-terminate-game 'human-resigned))
821 (lm-terminate-game 'human-resigned)))) ; OK. Accept it
834 (defun lm-prompt-for-other-game ()
835 "Ask for another game, and start it."
836 (if (y-or-n-p "Another game? ")
976 (if lm-game-in-progress
977 (lm-crash-game)) ; buffer has been killed or something
1509 (lm-terminate-game nil))
1516 If the game is finished, this command requests for another game."
1521 (lm-crash-game))
1522 ((not lm-game-in-progress)
1523 (lm-prompt-for-other-game))
1631 "Run 100 Lm games, each time saving the weights from the previous game."
1647 "Start or resume an Lm game.
1648 If a game is in progress, this command allows you to resume it.
1649 Here is the relation between prefix args and game options:
1651 prefix arg | robot is auto-started | weights are saved from last game
1667 (lm-crash-game))
1668 ((or (not lm-game-in-progress)
1687 (lm-start-game lm-n lm-m)