Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perrutquist/gotextprotocol.jl
https://github.com/perrutquist/gotextprotocol.jl
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/perrutquist/gotextprotocol.jl
- Owner: perrutquist
- License: mit
- Created: 2024-02-01T08:16:07.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-09T07:35:12.000Z (11 months ago)
- Last Synced: 2024-03-15T09:47:54.945Z (10 months ago)
- Language: Julia
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoTextProtocol.jl
This Julia package implements a subset of the [Go Text Protocol (GTP), version 2](https://www.lysator.liu.se/~gunnar/gtp/gtp2-spec-draft2/gtp2-spec.html), as well as keeping track of the Go board (captures, etc). (Here, "Go" refers to the [board game](https://en.wikipedia.org/wiki/Go_(game)), not the programming language.)
If a Go playing engine is written in Julia, then this package should make it easy to connect it to any [Go client](https://senseis.xmp.net/?GoClient) that speaks the GTP protocol. That will allow it to play humans or other engines via a GUI or over the internet.
## Usage
All that is needed to create a Go playing engine is to write a function `genmove(board, color, info)` that decides which move to make, given the `board` state and `color` to play (and some additional `info` like komi and time left.) This function is then passed to the `GoTextProtocol.gtp_repl` function, which implements the GTP protocol. This REPL can be used directly from the terminal (for testing), but most commonly it will be accessed by a Go client that provides a more friendly user interface.
The file [example_engine.jl](./example_engine.jl) demonstrates how to write a Julia script that can be used by a Go client. The Go client will typically have an "Add Go engine" option in the settings, where the path to this script can be entered.
# Notes
* The aim of this package is not to provide a Go playing engine. The example script is barely better than random play!
* I have only tested this with a single Go client so far. Please file an issue if you encounter problems.
* At the moment, only the bare minimum of GTP commands are supported. PRs are welcome!## Credit
This package is based on the [gtp Python package](https://github.com/jtauber/gtp) by James Tauber and on [Julia Go board code](https://gist.github.com/GunnarFarneback/3373404) by by Gunnar Farnebäck.