13
Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

Embed Size (px)

Citation preview

Page 1: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

Course Project Introduction

1

Zhou ZhengZhong

2015/11/12

Page 2: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

GTP Model

Controller

Engine

Another Engine

Human

OR

GTP

Page 3: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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

Page 4: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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

Page 5: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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

Page 6: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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”.

Page 7: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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

Page 8: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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

Page 9: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

Required Commands

Administraiveprotocol_version

nameversion

known_commandlist_commands

Quit

Setupboardsize

clear_boardKomi

Core Playplay

genmove

Section 6.3 interface.c

Page 10: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

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

Page 11: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12
Page 12: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12
Page 13: Course Project Introduction 1 Zhou ZhengZhong 2015/11/12

Q&A