Post on 21-Jan-2016
transcript
Course Project Introduction
1
Zhou ZhengZhong
2015/11/12
GTP Model
Controller
Engine
Another Engine
Human
OR
GTP
GTP – Go Text Protocol
http://www.lysator.liu.se/~gunnar/gtp/
GoGui
http://gogui.sourceforge.net/
gtp2-spec-draft2.pdf
gogui-1.4.9-install.exe
GTP Basics
Character Set
Control Characters
Whitespace
Newline Convention
Engine Preprocessing
1. Remove all occurences of CR and other control characters except for HT and LF
2. For each line with a hash sign (#), remove all text following and including this character.
3. Convert all occurences of HT to SPACE
4. Discard any empty or white-space only lines
Section 2
Section 3.1
Protocol Details
Command{id} command_name {arguments}\n
Success Response={id} {response}\n\n
Failure Response?{id} error_message\n\n
Standard Error Messageunknown command
Section 3.3-3.5
Board Coordinates
Letter + Number, board size 13x13Left->Right: A~M(excluding I)
Bottom->Top: 1~13vertex
“B13”, “j11” or “pass”
color“white” or “w” to denote white, or “black” or “b” to denote black.
Colors are not case sensitive.
move the combination of one color and one vertex, separated by space.
Moves are not case sensitive“white h10”, “B F5”, “w pass”.
Brown ( Almost random)
Simple example with basic framework
brown.cGo board logic and move generation
gtp.c gtp.hGTP support code
interface.cGTP interface code and main() function
brown-1.0.tar.gz
State Variables
An engine is expected to keep track of the following state information:
board sizeboard configuration
number of captured stones of either colormove history
komitime settings
Required Commands
Administraiveprotocol_version
nameversion
known_commandlist_commands
Quit
Setupboardsize
clear_boardKomi
Core Playplay
genmove
Section 6.3 interface.c
GoGui
goguiprogram command
size ncomputer-black|white|both|none
gogui-client hostname port
gogui-twogtp-black command
-white command
( -size n)@echo offset BLACK=E:\go\Desktop\exe\brown.exeset WHITE=E:\go\Desktop\exe\ZGO.exeset TWOGTP=""E:\go\GoGui\gogui-twogtp"" -black ""%BLACK%"" -white ""%WHITE%"" -size 13"E:\go\GoGui\gogui" -program "%TWOGTP%" -size 13 -computer-both -verbose
Q&A