Mercurial > emacs
changeset 7800:329e59e31d8d
(gomoku-display-statistics): Use human's point of view
for wins and losses.
(gomoku-number-of-emacs-wins): Renamed from gomoku-number-of-wins.
(gomoku-number-of-human-wins): Renamed from gomoku-number-losses.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 05 Jun 1994 17:36:02 +0000 |
parents | 1eb0d0f0f71b |
children | 10e818a0248a |
files | lisp/play/gomoku.el |
diffstat | 1 files changed, 14 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/play/gomoku.el Sun Jun 05 16:57:22 1994 +0000 +++ b/lisp/play/gomoku.el Sun Jun 05 17:36:02 1994 +0000 @@ -578,11 +578,11 @@ ;;; SESSION CONTROL. ;;; -(defvar gomoku-number-of-wins 0 - "Number of games already won in this session.") +(defvar gomoku-number-of-emacs-wins 0 + "Number of games Emacs won in this session.") -(defvar gomoku-number-of-losses 0 - "Number of games already lost in this session.") +(defvar gomoku-number-of-human-wins 0 + "Number of games you won in this session.") (defvar gomoku-number-of-draws 0 "Number of games already drawn in this session.") @@ -593,7 +593,7 @@ (let (message) (cond ((eq result 'emacs-won) - (setq gomoku-number-of-wins (1+ gomoku-number-of-wins)) + (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) (setq message (cond ((< gomoku-number-of-moves 20) "This was a REALLY QUICK win.") @@ -603,14 +603,14 @@ "I won... Taking moves back will not help you !") ((not gomoku-emacs-played-first) "I won... Playing first did not help you much !") - ((and (zerop gomoku-number-of-losses) + ((and (zerop gomoku-number-of-human-wins) (zerop gomoku-number-of-draws) - (> gomoku-number-of-wins 1)) + (> gomoku-number-of-emacs-wins 1)) "I'm becoming tired of winning...") (t "I won.")))) ((eq result 'human-won) - (setq gomoku-number-of-losses (1+ gomoku-number-of-losses)) + (setq gomoku-number-of-human-wins (1+ gomoku-number-of-human-wins)) (setq message (cond (gomoku-human-took-back @@ -620,7 +620,7 @@ (t "OK, you won this one. Now, let me play first just once.")))) ((eq result 'human-resigned) - (setq gomoku-number-of-wins (1+ gomoku-number-of-wins)) + (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) (setq message "So you resign. That's just one more win for me.")) ((eq result 'nobody-won) (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) @@ -954,20 +954,13 @@ (cond ((not (zerop gomoku-number-of-draws)) (format ": Won %d, lost %d, drew %d" - gomoku-number-of-wins - gomoku-number-of-losses + gomoku-number-of-human-wins + gomoku-number-of-emacs-wins gomoku-number-of-draws)) - ((not (zerop gomoku-number-of-losses)) + (t (format ": Won %d, lost %d" - gomoku-number-of-wins - gomoku-number-of-losses)) - ((zerop gomoku-number-of-wins) - "") - ((= 1 gomoku-number-of-wins) - ": Already won one") - (t - (format ": Won %d in a row" - gomoku-number-of-wins)))) + gomoku-number-of-human-wins + gomoku-number-of-emacs-wins)))) ;; Then a (standard) kludgy line will force update of mode line. (set-buffer-modified-p (buffer-modified-p)))