r5107: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 12 Jun 2003 13:28:55 +0000 (13:28 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 12 Jun 2003 13:28:55 +0000 (13:28 +0000)
base.lisp
debian/changelog
edge-table.lisp
io.lisp
strategies.lisp

index cffba2edf75124612bd90cbffc3812830ad14337..8a6dd146f494a4a3845eb448a9525893e73c2142 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
 ;;;;
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: base.lisp,v 1.5 2003/06/12 13:08:43 kevin Exp $
+;;;; $Id: base.lisp,v 1.6 2003/06/12 13:28:55 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
 ;;;;
 ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
   (declare (type board board)
           (type move move)
           (type player player)
   (declare (type board board)
           (type move move)
           (type player player)
-          (optimize speed (safety 0))
-)
+          (optimize speed (safety 0) (space 0)))
   (if (= (bref board move) empty)
       (block search
        (let ((i 0))
   (if (= (bref board move) empty)
       (block search
        (let ((i 0))
   (let ((c (+ move dir)))
     (declare (type square c))
     (and (= (the piece (bref board c)) (the player (opponent player)))
   (let ((c (+ move dir)))
     (declare (type square c))
     (and (= (the piece (bref board c)) (the player (opponent player)))
-         (find-bracketing-piece (+ c dir) player board dir))))
+         (find-bracketing-piece (the fixnum (+ c dir)) player board dir))))
 
 (defun find-bracketing-piece (square player board dir)
   "Return the square number of the bracketing piece."
 
 (defun find-bracketing-piece (square player board dir)
   "Return the square number of the bracketing piece."
index f02f03242ad979e352c99fa5c51041d8e0e763ea..81bfa92608a0fae95147c939672fff6381f53f38 100644 (file)
@@ -1,3 +1,9 @@
+cl-reversi (1.0.7-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Thu, 12 Jun 2003 07:28:39 -0600
+
 cl-reversi (1.0.6-1) unstable; urgency=low
 
   * New upstream
 cl-reversi (1.0.6-1) unstable; urgency=low
 
   * New upstream
index 9b2f94928403f06212845e2eea1f5f5c44f78f24..c8a648e6351756f5709a7f1773d6adabd54ea0bf 100644 (file)
@@ -7,7 +7,7 @@
 ;;;;  Programer:      Kevin M. Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
 ;;;;  Programer:      Kevin M. Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: edge-table.lisp,v 1.4 2003/06/12 12:42:13 kevin Exp $
+;;;; $Id: edge-table.lisp,v 1.5 2003/06/12 13:28:55 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
 ;;;;
 ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (let ((stable 0) (semi-stable 1) (unstable 2))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (let ((stable 0) (semi-stable 1) (unstable 2))
-    (declaim (type fixnum stable semi-stable unstable))
+    (declare (type fixnum stable semi-stable unstable))
     
     (defun piece-stability (board sq)
       (declare (type board board)
     
     (defun piece-stability (board sq)
       (declare (type board board)
diff --git a/io.lisp b/io.lisp
index 1d3d2c81781eccb6169b1b3d61467e83b981637d..57940c47ae0e6cbab44c7c7372fb0f19a499c767 100644 (file)
--- a/io.lisp
+++ b/io.lisp
@@ -8,7 +8,7 @@
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: io.lisp,v 1.4 2003/06/12 12:42:13 kevin Exp $
+;;;; $Id: io.lisp,v 1.5 2003/06/12 13:28:55 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
 ;;;;
 ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
@@ -26,6 +26,7 @@
         (cross-product #'concat-symbol
                        '(? A B C D E F G H ?)
                        '(? 1 2 3 4 5 6 7 8 ?))))
         (cross-product #'concat-symbol
                        '(? A B C D E F G H ?)
                        '(? 1 2 3 4 5 6 7 8 ?))))
+  (declaim (type list square-names))
 
   (defun h8->88 (str)
     "Convert from alphanumeric to numeric square notation."
 
   (defun h8->88 (str)
     "Convert from alphanumeric to numeric square notation."
@@ -35,7 +36,7 @@
   (defun 88->h8 (num)
     "Convert from numeric to alphanumeric square notation."
     (if (valid-p num)
   (defun 88->h8 (num)
     "Convert from numeric to alphanumeric square notation."
     (if (valid-p num)
-        (elt square-names num)
+        (nth num square-names)
       num)))
 
 (defun moves-to-string (moves)
       num)))
 
 (defun moves-to-string (moves)
index e0e108d1d0ed1320b3c9d25b392570cc6bc82421..e3101405e0597b61cc60e6082b555d8db1bd9c5b 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
 ;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
 ;;;;
-;;;; $Id: strategies.lisp,v 1.7 2003/06/12 13:08:43 kevin Exp $
+;;;; $Id: strategies.lisp,v 1.8 2003/06/12 13:28:55 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
 ;;;;
 ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg 
 ;;;; and Copyright (c) 1998-2002 Peter Norvig
 
 (defun negate-value (node)
   "Set the value of a node to its negative."
 
 (defun negate-value (node)
   "Set the value of a node to its negative."
-  (declare (fixnum node)
-          (optimize (speed 3) (safety 0) (space 0)))
+  (declare (optimize (speed 3) (safety 0) (space 0)))
   (setf (node-value node) (- (node-value node)))
   node)
 
   (setf (node-value node) (- (node-value node)))
   node)
 
   (declare (type board board)
           (type player player)
           (type fixnum achievable cutoff ply)
   (declare (type board board)
           (type player player)
           (type fixnum achievable cutoff ply)
-          (type move killer)
+          (type (or null move) killer)
           (optimize (speed 3) (safety 0) (space 0)))
   "A-B search, putting killer move first."
   (if (= ply 0)
           (optimize (speed 3) (safety 0) (space 0)))
   "A-B search, putting killer move first."
   (if (= ply 0)
 
 (defun alpha-beta-searcher3w (depth eval-fn)
   "Return a strategy that does A-B search with killer moves."
 
 (defun alpha-beta-searcher3w (depth eval-fn)
   "Return a strategy that does A-B search with killer moves."
-  (declare (fixnum depth))
   #'(lambda (player board)
   #'(lambda (player board)
-      (multiple-value-bind (value move)
-          (alpha-beta3w player board losing-value winning-value
-                       depth eval-fn nil)
-        (declare (ignore value))
-        move)))
+      (nth-value 1
+                (alpha-beta3w player board losing-value winning-value
+                              depth eval-fn nil))))
 
 (defun put-first (killer moves)
   "Move the killer move to the front of moves,
 
 (defun put-first (killer moves)
   "Move the killer move to the front of moves,
 
 (defun iago (depth)
   "Use an approximation of Iago's evaluation function."
 
 (defun iago (depth)
   "Use an approximation of Iago's evaluation function."
+  (declare (fixnum depth))
   (alpha-beta-searcher3 depth #'iago-eval))
 
 ;; Maximizer (1-ply)
   (alpha-beta-searcher3 depth #'iago-eval))
 
 ;; Maximizer (1-ply)
 
 
 (defun ab3w-df (ply)
 
 
 (defun ab3w-df (ply)
+  (declare (fixnum ply))
   (alpha-beta-searcher3w ply #'count-difference))
 
 (defun ab3w-wt (ply)
   (alpha-beta-searcher3w ply #'count-difference))
 
 (defun ab3w-wt (ply)
+  (declare (fixnum ply))
   (alpha-beta-searcher3w ply #'weighted-squares))
 
 (defun ab3w-md-wt (ply)
   (alpha-beta-searcher3w ply #'weighted-squares))
 
 (defun ab3w-md-wt (ply)
+  (declare (fixnum ply))
   (alpha-beta-searcher3w ply #'modified-weighted-squares))
 
 
   (alpha-beta-searcher3w ply #'modified-weighted-squares))