https://github.com/dolegi/uci
Universal Chess Interface Library
https://github.com/dolegi/uci
golang stockfish uci
Last synced: about 1 month ago
JSON representation
Universal Chess Interface Library
- Host: GitHub
- URL: https://github.com/dolegi/uci
- Owner: dolegi
- License: mit
- Created: 2019-02-25T08:18:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T09:56:27.000Z (over 5 years ago)
- Last Synced: 2025-08-12T02:58:08.053Z (about 2 months ago)
- Topics: golang, stockfish, uci
- Language: Go
- Size: 182 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Universal Chess Interface
Small wrapper for interacting with uci compliant chess engines.
[Godoc](https://godoc.org/github.com/dolegi/uci)# Usage
Import library
```go
import "github.com/dolegi/uci"
```
Create a new engine
```go
eng, _ := uci.NewEngine("path-to-engine")
```
Set options
```go
eng.SetOption("Ponder", false)
eng.SetOption("Threads", "2")
```
Check if ready
```go
eng.IsReady()
```
Create a new game, use full algorithmic positioning and assign white
```go
eng.NewGame(uci.NewGameOpts{uci.ALG, uci.W})
```
Set the moves after start position
```go
eng.Position("e2e4")
```
Find best move
```go
resp := eng.Go(uci.GoOpts{MoveTime: 100})
fmt.Println(resp.Bestmove)
```See example folder for a working example. Run with `go run example/main.go `
# Missing features
- [ ] go infinite + stop
- [ ] ponderhit
- [ ] debug mode
- [ ] register# References
- [UCI reference documention](https://www.shredderchess.com/chess-info/features/uci-universal-chess-interface.html)
- [Stockfish](https://github.com/official-stockfish/Stockfish)