r3215: *** empty log message ***
[reversi.git] / strategies.lisp
index 3d0570b1052bfa8b9b585866af67ee8fe89e142b..5529d01d4361dc33467e5e38b036150119d04057 100644 (file)
@@ -1,19 +1,26 @@
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: reversi -*-
 ;;;;***************************************************************************
 ;;;;
 ;;;; FILE IDENTIFICATION
 ;;;; 
-;;;;  Name:           strategies.cl
+;;;;  Name:           strategies.lisp
 ;;;;  Purpose:        Strategy routines for reversi
-;;;;  Programer:      Kevin M. Rosenberg, M.D.
+;;;;  Programer:      Kevin Rosenberg based on code by Peter Norvig
 ;;;;  Date Started:   1 Nov 2001
-;;;;  CVS Id:         $Id: strategies.lisp,v 1.1 2002/10/25 08:36:42 kevin Exp $
 ;;;;
+;;;; $Id: strategies.lisp,v 1.4 2002/10/25 13:09:11 kevin Exp $
+;;;;
+;;;; This file is Copyright (c) 2001-2002 by Kevin M. Rosenberg 
+;;;; and Copyright (c) 1998-2002 Peter Norvig
+;;;;
+;;;; Reversi users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (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)))
 
-
 (defun random-strategy (player board)
   "Make any legal move."
   (declare (type player player)
@@ -43,8 +50,8 @@
                                  (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)
 
 
 (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."
    '(random ab3-df ab3-wt ab3-md-wt iago)))
 
   
+(defun text-reversi ()
+  "Sets up a text game between player and computer"
+  )