From d92820d39c18a373611b5bfb018631cffe3e4bcd Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 17 Jun 2003 05:47:18 +0000 Subject: [PATCH] r5141: Auto commit for Debian build --- base.lisp | 6 +++--- debian/changelog | 6 ++++++ edge-table-storage.lisp | 14 ++++++++------ edge-table.lisp | 13 ++++++++----- io.lisp | 4 ++-- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/base.lisp b/base.lisp index 8a6dd14..03a628f 100644 --- 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.6 2003/06/12 13:28:55 kevin Exp $ +;;;; $Id: base.lisp,v 1.7 2003/06/17 05:47:18 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1998-2002 Peter Norvig @@ -156,10 +156,10 @@ (defun count-difference (player board) "Count player's pieces minus opponent's pieces." (declare (type board board) - (fixnum player) + (type fixnum player) (optimize (speed 3) (safety 0) (space 0))) (the fixnum (- (the fixnum (count player board)) - (the fixum (count (opponent player) board))))) + (the fixnum (count (opponent player) board))))) (defun valid-p (move) (declare (type move move) diff --git a/debian/changelog b/debian/changelog index 81bfa92..a6005c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-reversi (1.0.8-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Mon, 16 Jun 2003 23:46:53 -0600 + cl-reversi (1.0.7-1) unstable; urgency=low * New upstream diff --git a/edge-table-storage.lisp b/edge-table-storage.lisp index 366aa90..035656e 100644 --- a/edge-table-storage.lisp +++ b/edge-table-storage.lisp @@ -7,7 +7,7 @@ ;;;; Programer: Kevin Rosenberg ;;;; Date Started: 1 Nov 2001 ;;;; -;;;; $Id: edge-table-storage.lisp,v 1.4 2003/06/12 12:42:13 kevin Exp $ +;;;; $Id: edge-table-storage.lisp,v 1.5 2003/06/17 05:47:18 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; @@ -35,7 +35,8 @@ :name "edge-table" :type "dat")))) - (defun store-edge-table (et &optional (path *et-path*)) + (defun store-edge-table (et &optional (path *et-path*)) + (declare (type edge-table et)) (with-open-file (stream path :direction :output :if-exists :supersede) (print (length et) stream) @@ -48,10 +49,11 @@ (with-open-file (stream path :direction :input) (let* ((length (read stream)) (et (make-array length :element-type 'fixnum))) - (dotimes (i length) - (declare (fixnum i)) - (setf (aref et i) (read stream))) - et)))) + (declare (type (simple-array fixnum (*)) et)) + (dotimes (i length) + (declare (fixnum i)) + (setf (aref et i) (read stream))) + et)))) (unless (probe-file *et-path*) (format *trace-output* ";; Recompiling edge-table, this make take several minutes") diff --git a/edge-table.lisp b/edge-table.lisp index c8a648e..521c7f1 100644 --- a/edge-table.lisp +++ b/edge-table.lisp @@ -7,7 +7,7 @@ ;;;; Programer: Kevin M. Rosenberg based on code by Peter Norvig ;;;; Date Started: 1 Nov 2001 ;;;; -;;;; $Id: edge-table.lisp,v 1.5 2003/06/12 13:28:55 kevin Exp $ +;;;; $Id: edge-table.lisp,v 1.6 2003/06/17 05:47:18 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; and Copyright (c) 1998-2002 Peter Norvig @@ -42,11 +42,13 @@ (init-edge-table) *edge-table*) +(deftype edge-table () '(simple-array fixnum (*))) + (defun map-edge-n-pieces (fn player board n squares index) "Call fn on all edges with n pieces." ;; Index counts 1 for player; 2 for opponent - (declare (fixnum index) + (declare (fixnum n index) (type player player) (type square index) (type (simple-array fixnum (100)) board) @@ -59,7 +61,7 @@ (sq (first squares))) (declare (fixnum index3 sq)) (map-edge-n-pieces fn player board n (rest squares) index3) - (when (and (> n 0) (eql (bref board sq) empty)) + (when (and (plusp n) (= (bref board sq) empty)) (setf (bref board sq) player) (map-edge-n-pieces fn player board (- n 1) (rest squares) (+ 1 index3)) @@ -119,7 +121,8 @@ (defun combine-edge-moves (possibilities player) "Combine the best moves." - (declare (optimize (speed 3) (safety 0) (space 0))) + (declare (type player player) + (optimize (speed 3) (safety 0) (space 0))) (let ((prob 1.0) (val 0.0) (fn (if (= player black) #'> #'<))) @@ -196,7 +199,7 @@ for i from 0 sum (the fixnum (cond - ((= (bref board sq) empty) 0) + ((= (bref board sq) empty) 0d0) ((= (bref board sq) player) (aref *static-edge-table* i (piece-stability board sq))) diff --git a/io.lisp b/io.lisp index 57940c4..635f90c 100644 --- a/io.lisp +++ b/io.lisp @@ -8,7 +8,7 @@ ;;;; Programer: Kevin Rosenberg based on code by Peter Norvig ;;;; Date Started: 1 Nov 2001 ;;;; -;;;; $Id: io.lisp,v 1.5 2003/06/12 13:28:55 kevin Exp $ +;;;; $Id: io.lisp,v 1.6 2003/06/17 05:47:18 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; and Copyright (c) 1998-2002 Peter Norvig @@ -26,7 +26,7 @@ (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)) + (declare (type list square-names)) (defun h8->88 (str) "Convert from alphanumeric to numeric square notation." -- 2.34.1