projects
/
reversi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r4852: Auto commit for Debian build
[reversi.git]
/
strategies.lisp
diff --git
a/strategies.lisp
b/strategies.lisp
index 785009ace75234352ad20d8a24bb0e57ef98716b..e7d2fe681063a35c0c402e28b0a035c7cb99a2dc 100644
(file)
--- a/
strategies.lisp
+++ b/
strategies.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: strategies.lisp,v 1.
2 2002/10/25 09:23:39
kevin Exp $
+;;;; $Id: strategies.lisp,v 1.
5 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
;;;;
;;;; 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.
;;;;***************************************************************************
;;;; (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))))
(defun random-strategy (player board)
"Make any legal move."
(defun random-strategy (player board)
"Make any legal move."
@@
-51,8
+52,8
@@
(make-move move player
(copy-board board))))
moves))
(make-move move player
(copy-board board))))
moves))
- (best
(apply #'max scores)))
- (declare (fixnum
moves
best))
+ (best (apply #'max scores)))
+ (declare (fixnum best))
(elt moves (position best scores)))))
(eval-when (:compile-toplevel :load-toplevel :execute)
(elt moves (position best scores)))))
(eval-when (:compile-toplevel :load-toplevel :execute)
@@
-235,9
+236,9
@@
(defstruct (node)
(defstruct (node)
- (square
nil
:type square)
- (board
nil
:type board)
- (value
nil
:type integer))
+ (square
(missing-argument)
:type square)
+ (board
(missing-argument)
:type board)
+ (value
(missing-argument)
:type integer))
(defun alpha-beta-searcher2 (depth eval-fn)
"Return a strategy that does A-B search with sorted moves."
(defun alpha-beta-searcher2 (depth eval-fn)
"Return a strategy that does A-B search with sorted moves."
@@
-534,6
+535,9
@@
'(random ab3-df ab3-wt ab3-md-wt iago)))
'(random ab3-df ab3-wt ab3-md-wt iago)))
+(defun text-reversi ()
+ "Sets up a text game between player and computer"
+ )