aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-05 17:36:02 +0000
committerRichard M. Stallman1994-06-05 17:36:02 +0000
commitd9a62b4c38624d34dd4e1568ec49867d7c750bd8 (patch)
tree42999a339b3bd253a6ed3c6571ee86c63aa32b1e
parentf5608c76212fbe5405e8b83408af9c518f699831 (diff)
downloademacs-d9a62b4c38624d34dd4e1568ec49867d7c750bd8.tar.gz
emacs-d9a62b4c38624d34dd4e1568ec49867d7c750bd8.zip
(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.
-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."
578;;; SESSION CONTROL. 578;;; SESSION CONTROL.
579;;; 579;;;
580 580
581(defvar gomoku-number-of-wins 0 581(defvar gomoku-number-of-emacs-wins 0
582 "Number of games already won in this session.") 582 "Number of games Emacs won in this session.")
583 583
584(defvar gomoku-number-of-losses 0 584(defvar gomoku-number-of-human-wins 0
585 "Number of games already lost in this session.") 585 "Number of games you won in this session.")
586 586
587(defvar gomoku-number-of-draws 0 587(defvar gomoku-number-of-draws 0
588 "Number of games already drawn in this session.") 588 "Number of games already drawn in this session.")
@@ -593,7 +593,7 @@ that DVAL has been added on SQUARE."
593 (let (message) 593 (let (message)
594 (cond 594 (cond
595 ((eq result 'emacs-won) 595 ((eq result 'emacs-won)
596 (setq gomoku-number-of-wins (1+ gomoku-number-of-wins)) 596 (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins))
597 (setq message 597 (setq message
598 (cond ((< gomoku-number-of-moves 20) 598 (cond ((< gomoku-number-of-moves 20)
599 "This was a REALLY QUICK win.") 599 "This was a REALLY QUICK win.")
@@ -603,14 +603,14 @@ that DVAL has been added on SQUARE."
603 "I won... Taking moves back will not help you !") 603 "I won... Taking moves back will not help you !")
604 ((not gomoku-emacs-played-first) 604 ((not gomoku-emacs-played-first)
605 "I won... Playing first did not help you much !") 605 "I won... Playing first did not help you much !")
606 ((and (zerop gomoku-number-of-losses) 606 ((and (zerop gomoku-number-of-human-wins)
607 (zerop gomoku-number-of-draws) 607 (zerop gomoku-number-of-draws)
608 (> gomoku-number-of-wins 1)) 608 (> gomoku-number-of-emacs-wins 1))
609 "I'm becoming tired of winning...") 609 "I'm becoming tired of winning...")
610 (t 610 (t
611 "I won.")))) 611 "I won."))))
612 ((eq result 'human-won) 612 ((eq result 'human-won)
613 (setq gomoku-number-of-losses (1+ gomoku-number-of-losses)) 613 (setq gomoku-number-of-human-wins (1+ gomoku-number-of-human-wins))
614 (setq message 614 (setq message
615 (cond 615 (cond
616 (gomoku-human-took-back 616 (gomoku-human-took-back
@@ -620,7 +620,7 @@ that DVAL has been added on SQUARE."
620 (t 620 (t
621 "OK, you won this one. Now, let me play first just once.")))) 621 "OK, you won this one. Now, let me play first just once."))))
622 ((eq result 'human-resigned) 622 ((eq result 'human-resigned)
623 (setq gomoku-number-of-wins (1+ gomoku-number-of-wins)) 623 (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins))
624 (setq message "So you resign. That's just one more win for me.")) 624 (setq message "So you resign. That's just one more win for me."))
625 ((eq result 'nobody-won) 625 ((eq result 'nobody-won)
626 (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) 626 (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."
954 (cond 954 (cond
955 ((not (zerop gomoku-number-of-draws)) 955 ((not (zerop gomoku-number-of-draws))
956 (format ": Won %d, lost %d, drew %d" 956 (format ": Won %d, lost %d, drew %d"
957 gomoku-number-of-wins 957 gomoku-number-of-human-wins
958 gomoku-number-of-losses 958 gomoku-number-of-emacs-wins
959 gomoku-number-of-draws)) 959 gomoku-number-of-draws))
960 ((not (zerop gomoku-number-of-losses))
961 (format ": Won %d, lost %d"
962 gomoku-number-of-wins
963 gomoku-number-of-losses))
964 ((zerop gomoku-number-of-wins)
965 "")
966 ((= 1 gomoku-number-of-wins)
967 ": Already won one")
968 (t 960 (t
969 (format ": Won %d in a row" 961 (format ": Won %d, lost %d"
970 gomoku-number-of-wins)))) 962 gomoku-number-of-human-wins
963 gomoku-number-of-emacs-wins))))
971 ;; Then a (standard) kludgy line will force update of mode line. 964 ;; Then a (standard) kludgy line will force update of mode line.
972 (set-buffer-modified-p (buffer-modified-p))) 965 (set-buffer-modified-p (buffer-modified-p)))
973 966