X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=io-clim.lisp;h=d50f3a8e935fe583b8820a42e9a215476e8a60dc;hb=48b1a775e575a66bc154620107a8e27321ea306c;hp=78775ded4a0e29dbd134490ffb1b889d574965e1;hpb=9fb8305e6005c35f639a46d00c626805054e3d4a;p=reversi.git diff --git a/io-clim.lisp b/io-clim.lisp index 78775de..d50f3a8 100644 --- a/io-clim.lisp +++ b/io-clim.lisp @@ -8,7 +8,7 @@ ;;;; Programer: Kevin M. Rosenberg ;;;; Date Started: 1 Nov 2001 ;;;; -;;;; $Id: io-clim.lisp,v 1.3 2002/10/25 13:09:11 kevin Exp $ +;;;; $Id: io-clim.lisp,v 1.11 2003/05/06 15:51:20 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg ;;;; @@ -17,7 +17,9 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;;*************************************************************************** -(in-package :reversi) +(in-package #:reversi) + +#+mcclim (shadowing-import 'clim-internals::stream-set-cursor-position) (defparameter cell-inner-width 40) (defparameter cell-inner-height 40) @@ -40,7 +42,7 @@ id name searcher eval ply strategy start-time searcher-id eval-id) -(defun make-gui-player (&key id name strategy searcher-id eval-id ply) +(defun make-gui-player (&key id name strategy searcher-id eval-id (ply 0)) (let ((p (make-gui-player-struct :id id :ply ply :name name :strategy strategy :searcher-id searcher-id :eval-id eval-id)) @@ -198,11 +200,11 @@ reversi-help-table) :menu (("Game" :menu reversi-game-table - :mnemonic #\G + :keystroke #\G :documentation "Game commands") ("Help" :menu reversi-help-table - :mnemonic #\H + :keystroke #\H :documentation "Help Commands")))) (:menu-bar t) (:layouts @@ -247,7 +249,7 @@ record stream state) state (multiple-value-bind (xoff yoff) - (convert-from-relative-to-absolute-coordinates + (clim::convert-from-relative-to-absolute-coordinates stream (output-record-parent record)) (with-bounding-rectangle* (left top right bottom) record (draw-rectangle* stream @@ -345,9 +347,13 @@ (format stream "Valid Moves~%~A" (list-to-delimited-string legal-moves #\space))))) (when (null (player game)) - (if (plusp (final-result game)) - (format stream "Black wins by ~d!" (final-result game)) - (format stream "White wins by ~d!" (- 0 (final-result game))))))))) + (cond + ((zerop (final-result games)) + (format stream "It's a draw!")) + ((plusp (final-result game)) + (format stream "Black wins by ~d!" (final-result game))) + (t + (format stream "White wins by ~d!" (- 0 (final-result game))))))))))