X-Git-Url: http://git.kpe.io/?p=reversi.git;a=blobdiff_plain;f=base.lisp;fp=base.lisp;h=cffba2edf75124612bd90cbffc3812830ad14337;hp=bbcd87209a1b349a8d46e9712d395c3f090b8156;hb=7e4bfe37534bc2812d2cafabf8487bd165b2d952;hpb=20c849f483c381f84eae22eee807280c8d00e554 diff --git a/base.lisp b/base.lisp index bbcd872..cffba2e 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.4 2003/06/12 12:42:13 kevin Exp $ +;;;; $Id: base.lisp,v 1.5 2003/06/12 13:08:43 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1998-2002 Peter Norvig @@ -100,8 +100,10 @@ :clock (make-clock +default-max-minutes+))) -(defun name-of (piece) (char ".@O?" piece)) -(defun title-of (piece) (nth (1- piece) '("Black" "White")) ) +(defun name-of (piece) (schar ".@O?" piece)) +(defun title-of (piece) + (declare (fixnum piece)) + (nth (the fixnum (1- piece)) '("Black" "White")) ) (defmacro opponent (player) `(if (= ,player black) white black)) @@ -110,7 +112,9 @@ `(the piece (aref (the board ,board) (the square ,square)))) (defparameter all-squares - (loop for i fixum from 11 to 88 when (<= 1 (mod i 10) 8) collect i) + (loop for i fixnum from 11 to 88 + when (<= 1 (the fixnum (mod i 10)) 8) + collect i) "A list of all squares") (defun initial-board ()