https://github.com/codereclaimers/gtp
Communicate with GNU Go via stdin/stdout or sockets.
https://github.com/codereclaimers/gtp
Last synced: 9 months ago
JSON representation
Communicate with GNU Go via stdin/stdout or sockets.
- Host: GitHub
- URL: https://github.com/codereclaimers/gtp
- Owner: CodeReclaimers
- License: mit
- Created: 2016-01-20T01:50:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-30T20:15:05.000Z (about 10 years ago)
- Last Synced: 2025-04-14T15:25:50.559Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gtp
Library to communicate with instances of GNU Go via stdin/stdout or sockets.
# Example usage
>>> import gtp
>>> go = gtp.GoTextPipe()
>>> go.genmove('black')
'E5'
>>> go.genmove('white')
'C3'
>>> print go.showboard()
A B C D E F G H J
9 . . . . . . . . . 9
8 . . . . . . . . . 8
7 . . + . . . + . . 7
6 . . . . . . . . . 6
5 . . . . X . . . . 5
4 . . . . . . . . . 4
3 . . O . . . + . . 3
2 . . . . . . . . . 2 WHITE (O) has captured 0 stones
1 . . . . . . . . . 1 BLACK (X) has captured 0 stones
A B C D E F G H J
>>> print go.estimate_score()
W+3.8 (upper bound: 3.8, lower: 3.8)