r3190: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 25 Oct 2002 13:14:00 +0000 (13:14 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 25 Oct 2002 13:14:00 +0000 (13:14 +0000)
.cvsignore
README
base.lisp
debian/upload.sh
io-clim.lisp
package.lisp
strategies.lisp

index e5f6120f32d6b0eed1d0503391cf815f2cc10ed2..ca8d09f870e17506a3a0bbb43dfd0c8f4f8aee48 100644 (file)
@@ -1,2 +1 @@
 .bin
-edge-table.dat
diff --git a/README b/README
index cb07af233128eb6db2954706283de5b50f2c408c..d462524952f8bf5c32c2c8114ea2b2cb3236f3f8 100644 (file)
--- a/README
+++ b/README
@@ -3,3 +3,19 @@ This is a Common Lisp implementation of the Reversi game.
 The web site for this package is http://reversi.b9.com which has
 documentation for this package.
 
+Reversi is based on the Othello(tm) game presented in Peter Norvig's
+book "Paradigms of Artificial Intelligence Programming", chapter 18.
+I highly suggest this book in general. If you wish to take full
+advantage of this package, you should read the chapter referenced.
+
+Quickstart
+==========
+
+If you are using AllegroCL or Lispworks with CLIM, you can play
+Reversi with a graphical user interface using the command
+   (reversi:clim-reversi)
+
+Otherwise, you can play in a text mode, such as
+   (reversi:reversi #'reversi:human (reversi:iago 1))
+
+
index 587a8438b522545e00f6ea69a045d8321f18af42..10edbde0e34502bc7af0a95af0fe065d5d14f3b6 100644 (file)
--- a/base.lisp
+++ b/base.lisp
@@ -8,7 +8,7 @@
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: base.lisp,v 1.1 2002/10/25 12:42:42 kevin Exp $
+;;;; $Id: base.lisp,v 1.2 2002/10/25 13:09:11 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
   (count-difference black (board game)))
 
 
-
 (defun reversi (bl-strategy wh-strategy 
                 &optional (print t) (minutes +default-max-minutes+))
   (play-game (make-game bl-strategy wh-strategy :print print
                        :record-game nil :minutes minutes)))
 
-
-#+ignore
-(defun reversi (bl-strategy wh-strategy 
-                &optional (print t) (minutes 30))
-  "Play a game of reversi.  Return the score, where a positive
-  difference means black, the first player, wins."
-  (let ((board (initial-board))
-        (clock (make-clock minutes)))
-    (declare (type board board))
-    (catch 'game-over
-      (loop for *move-number* from 1
-            for player = black then (next-to-play board player print)
-            for strategy = (if (eql player black) 
-                               bl-strategy
-                               wh-strategy)
-            until (null player)
-            do (get-move nil strategy player board print clock))
-      (when print
-        (format t "~&The game is over.  Final result:")
-        (print-board board clock))
-      (count-difference black board))))
-
 (defvar *clock* (make-clock +default-max-minutes+) "A copy of the game clock")
 (defvar *board* (initial-board) "A copy of the game board")
 
index c98cd66aa4ce4ca58565096b6e10b44e63ac5eb8..632d4af3818140a438425e2c6979c4d36a32832f 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/bash -e
 
-dup reversi -Uftp.med-info.com -D/home/ftp/reversi -C"(cd /opt/apache/htdocs/reversi.med-info.com; make install)" -su $*
+dup reversi -Uftp.med-info.com -D/home/ftp/reversi -C"(cd /opt/apache/htdocs/reversi; make install)" -su $*
 
index 9dcfb13ad2aa4f9c3891599391d483ba774fb8e6..78775ded4a0e29dbd134490ffb1b889d574965e1 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;  Programer:      Kevin M. Rosenberg
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: io-clim.lisp,v 1.2 2002/10/25 09:23:39 kevin Exp $
+;;;; $Id: io-clim.lisp,v 1.3 2002/10/25 13:09:11 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
 ;;;;
   #-(and os-threads microsoft-32)
   nil))
 
-(defun g ()
- (greversi))
-
-(defun greversi ()
+(defun clim-reversi ()
   (unless (or *force* (null *reversi-frame*))
     (setq *reversi-frame* (make-application-frame 'reversi)))
   (setq *reversi-frame* (run-frame 'reversi *reversi-frame*)))
index c50d3ef57350c69a0abf8f099132517301c73877..95979167cd6168a4d3ac1624fc39ca23daa571ec 100644 (file)
@@ -7,7 +7,7 @@
 ;;;;  Programer:      Kevin M. Rosenberg
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: package.lisp,v 1.2 2002/10/25 09:23:39 kevin Exp $
+;;;; $Id: package.lisp,v 1.3 2002/10/25 13:09:11 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
 ;;;;
 ;;;;***************************************************************************
 
 
-(in-package :cl-user)
+(in-package #:cl-user)
 
-(defpackage :reversi
-  (:use :common-lisp :common-lisp-user 
-       #+clisp :ext
-       #+clim :clim
-       #+clim :clim-sys)
+(defpackage #:reversi
+  (:use #:common-lisp #:common-lisp-user 
+       #+clisp #:ext
+       #+clim #:clim
+       #+clim #:clim-sys)
   #+clim
   (:shadowing-import-from :clim :pathname)
   #+clim
   (:shadowing-import-from :clim :interactive-stream-p)
   #+clim
   (:shadowing-import-from :clim :boolean)
+  
   (:export
    #:reversi
    #:random-reversi-series
@@ -43,6 +44,8 @@
    #:count-difference
    #:weighted-squares
    #:modified-weighted-squares
-   #+clim   #:greversi
+
+   #:text-reversi
+   #+clim #:gui-reversi
 ))
 
index b18a7c391b861a4feb7fa524ccf6f1c2ffa948ea..5529d01d4361dc33467e5e38b036150119d04057 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: strategies.lisp,v 1.3 2002/10/25 12:39:15 kevin Exp $
+;;;; $Id: strategies.lisp,v 1.4 2002/10/25 13:09:11 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
    '(random ab3-df ab3-wt ab3-md-wt iago)))
 
   
+(defun text-reversi ()
+  "Sets up a text game between player and computer"
+  )