X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base.lisp;h=ac4fb55d8d91c256bb3f2844913317f58fe390cb;hb=48b1a775e575a66bc154620107a8e27321ea306c;hp=587a8438b522545e00f6ea69a045d8321f18af42;hpb=5c954ef78b1ea675a6f3f12c118b053665a38f39;p=reversi.git diff --git a/base.lisp b/base.lisp index 587a843..ac4fb55 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.1 2002/10/25 12:42:42 kevin Exp $ +;;;; $Id: base.lisp,v 1.3 2003/05/06 15:51:20 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1998-2002 Peter Norvig @@ -18,9 +18,10 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;;*************************************************************************** -(in-package :reversi) -(declaim (optimize (safety 1) (debug 3) (speed 3) (compilation-speed 0))) +(in-package #:reversi) +(eval-when (:compile-toplevel) + (declaim (optimize (safety 1) (space 0) (speed 3) (compilation-speed 0)))) (defparameter +all-directions+ '(-11 -10 -9 -1 1 9 10 11)) (defconstant +default-max-minutes+ 30) @@ -387,34 +388,11 @@ (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")