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