2008-05-07 11:07:47 +02:00
|
|
|
(in-package :common-lisp)
|
2008-04-28 09:18:59 +02:00
|
|
|
|
2008-05-07 11:07:47 +02:00
|
|
|
;(clc:clc-require :cl-ppcre)
|
2008-05-08 03:36:06 +02:00
|
|
|
;(asdf:oos 'asdf:load-op :cl-ppcre)
|
2008-05-07 11:07:47 +02:00
|
|
|
(require :sb-bsd-sockets)
|
2008-04-28 09:18:59 +02:00
|
|
|
|
2008-05-21 20:46:32 +02:00
|
|
|
(defpackage macro-utils
|
|
|
|
(:use :common-lisp)
|
|
|
|
(:export :with-gensyms
|
2008-06-21 08:03:06 +02:00
|
|
|
:once-only
|
|
|
|
:while
|
2008-06-24 19:45:26 +02:00
|
|
|
:until
|
2008-08-23 19:19:41 +02:00
|
|
|
:pdebug
|
|
|
|
:*print-debug*))
|
2008-05-21 20:46:32 +02:00
|
|
|
|
2008-05-17 00:17:38 +02:00
|
|
|
(defpackage netpipe
|
2008-05-08 03:36:06 +02:00
|
|
|
(:use :common-lisp)
|
2008-05-17 00:17:38 +02:00
|
|
|
(:export :tcp-connect
|
|
|
|
:nslookup
|
|
|
|
:tcp-print
|
|
|
|
:tcp-read))
|
|
|
|
|
|
|
|
|
2008-05-29 04:40:25 +02:00
|
|
|
|
2008-05-05 17:00:06 +02:00
|
|
|
|
2008-05-17 00:17:38 +02:00
|
|
|
(defpackage board
|
2008-05-21 20:46:32 +02:00
|
|
|
(:use :common-lisp
|
|
|
|
:macro-utils)
|
2008-05-19 06:00:04 +02:00
|
|
|
(:export :basic-board
|
2008-05-29 04:40:25 +02:00
|
|
|
:boardsize
|
2008-05-27 02:46:43 +02:00
|
|
|
:ranked-board
|
2008-05-17 00:17:38 +02:00
|
|
|
:get-stone
|
|
|
|
:set-stone
|
2008-07-01 20:29:14 +02:00
|
|
|
:remove-stone
|
2008-06-24 19:45:26 +02:00
|
|
|
:get-player
|
2008-05-17 00:17:38 +02:00
|
|
|
:coord-to-str
|
2008-05-26 21:13:18 +02:00
|
|
|
:str-to-coord
|
2008-05-29 04:40:25 +02:00
|
|
|
:genmove
|
2008-06-19 08:16:51 +02:00
|
|
|
:do-with-copy-of-array
|
|
|
|
:copy-array
|
|
|
|
:copy-2d-array
|
2008-05-29 04:40:25 +02:00
|
|
|
:copy-2d-board
|
|
|
|
:make-2d-board
|
|
|
|
:do-over-board
|
|
|
|
:def-over-board
|
|
|
|
:set-2d-stone
|
|
|
|
:get-2d-stone
|
2008-08-23 19:19:41 +02:00
|
|
|
:coords-eql
|
2008-05-29 04:40:25 +02:00
|
|
|
:invert-player
|
|
|
|
:prune
|
|
|
|
:focus
|
|
|
|
:score
|
|
|
|
:copy-slots
|
|
|
|
:analyze-board-score
|
2008-06-18 02:46:32 +02:00
|
|
|
:board-to-analyze
|
|
|
|
; :do-over-2d-adjacent
|
2008-08-23 19:19:41 +02:00
|
|
|
:do-over-adjacent
|
|
|
|
:stones-to-analyze))
|
2008-05-17 00:17:38 +02:00
|
|
|
|
2008-06-03 18:08:30 +02:00
|
|
|
(defpackage liberty-board
|
2008-05-27 02:46:43 +02:00
|
|
|
(:use :common-lisp
|
|
|
|
:macro-utils
|
|
|
|
:board)
|
2008-05-29 04:40:25 +02:00
|
|
|
(:export :liberty-board
|
2008-06-21 08:03:06 +02:00
|
|
|
:liberty-to-analyze
|
|
|
|
:liberty))
|
2008-05-27 02:46:43 +02:00
|
|
|
|
2008-06-03 18:08:30 +02:00
|
|
|
(defpackage shape-board
|
|
|
|
(:use :common-lisp
|
|
|
|
:macro-utils
|
|
|
|
:board)
|
|
|
|
(:export :shape-board
|
2008-06-19 08:16:51 +02:00
|
|
|
:shapes-to-analyze
|
2008-06-21 08:03:06 +02:00
|
|
|
:shape-id
|
|
|
|
:shapes-points
|
|
|
|
:shape-sizes
|
|
|
|
:next-shape-id
|
|
|
|
:convert-shape
|
2008-08-23 19:19:41 +02:00
|
|
|
:shape-size
|
|
|
|
:remove-shape))
|
2008-06-19 08:16:51 +02:00
|
|
|
|
|
|
|
(defpackage liberty-shape-board
|
|
|
|
(:use :common-lisp
|
|
|
|
:macro-utils
|
|
|
|
:board
|
|
|
|
:liberty-board
|
|
|
|
:shape-board)
|
|
|
|
(:export :liberty-shape-board
|
2008-08-23 19:19:41 +02:00
|
|
|
:liberty-shape-to-analyze))
|
|
|
|
;:liberty-shape-stone-to-analyze))
|
2008-06-03 18:08:30 +02:00
|
|
|
|
2008-05-27 02:46:43 +02:00
|
|
|
|
2008-05-17 00:17:38 +02:00
|
|
|
(defpackage go-bot
|
|
|
|
(:use :common-lisp
|
2008-05-29 04:40:25 +02:00
|
|
|
:board
|
2008-06-03 18:08:30 +02:00
|
|
|
:liberty-board
|
2008-06-21 08:03:06 +02:00
|
|
|
:shape-board
|
|
|
|
:liberty-shape-board)
|
2008-05-05 17:39:04 +02:00
|
|
|
(:export :*name*
|
|
|
|
:*version*
|
2008-05-06 09:53:22 +02:00
|
|
|
:*author*
|
2008-05-08 03:36:06 +02:00
|
|
|
:*player*
|
2008-05-27 01:30:59 +02:00
|
|
|
:*cputime*
|
2008-05-06 09:53:22 +02:00
|
|
|
:set-komi
|
|
|
|
:set-boardsize
|
|
|
|
:init-board
|
|
|
|
:init
|
2008-05-19 06:00:04 +02:00
|
|
|
:do-play
|
|
|
|
:do-genmove
|
2008-05-29 04:40:25 +02:00
|
|
|
:composite-board
|
2008-08-23 19:19:41 +02:00
|
|
|
:analyze-stones
|
2008-05-29 04:40:25 +02:00
|
|
|
:analyze-score
|
|
|
|
:analyze-liberty
|
2008-06-19 08:16:51 +02:00
|
|
|
:analyze-shapes
|
2008-06-21 08:03:06 +02:00
|
|
|
:analyze-shape-liberties
|
2008-06-24 19:45:26 +02:00
|
|
|
:analyze-shape-stone-liberties
|
2008-05-29 04:40:25 +02:00
|
|
|
))
|
|
|
|
|
|
|
|
(defpackage gtp-handler
|
|
|
|
(:use :common-lisp
|
|
|
|
:netpipe
|
2008-08-23 19:19:41 +02:00
|
|
|
:go-bot
|
|
|
|
:macro-utils)
|
2008-05-29 04:40:25 +02:00
|
|
|
(:export :gtp-client
|
|
|
|
:gtp-net-client))
|
|
|
|
|