summaryrefslogtreecommitdiff
path: root/lisp/play
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-06-05 17:36:02 +0000
committerRichard M. Stallman <rms@gnu.org>1994-06-05 17:36:02 +0000
commitd9a62b4c38624d34dd4e1568ec49867d7c750bd8 (patch)
tree42999a339b3bd253a6ed3c6571ee86c63aa32b1e /lisp/play
parentf5608c76212fbe5405e8b83408af9c518f699831 (diff)
downloademacs-d9a62b4c38624d34dd4e1568ec49867d7c750bd8.tar.gz
(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.
Diffstat (limited to 'lisp/play')
-rw-r--r--lisp/play/gomoku.el35
1 files changed, 14 insertions, 21 deletions
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index 18c0b1173d8..314a7de4592 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -578,11 +578,11 @@ that DVAL has been added on SQUARE."
;;; 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 @@ that DVAL has been added on SQUARE."
(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 @@ that DVAL has been added on SQUARE."
"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 @@ that DVAL has been added on SQUARE."
(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 @@ If the game is finished, this command requests for another game."
(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))
- (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))))
+ (format ": Won %d, lost %d"
+ 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)))