gambit

module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT

README

gambit

gambit — material sacrificed for position. Also: two bots arguing in algebraic notation.

CI codecov Quality Gate Status Go Reference Go 1.26 MIT License

Two chess agents play each other, every move logged to the terminal in algebraic notation — headless by default, or in an optional Ebiten window. Built as a testbed for experimenting with search strategies.

Agents

Name Description
random Picks uniformly at random from the legal moves
greedy Best immediate material gain, no lookahead
minimax Alpha-beta search to a fixed depth
iterative Iterative-deepening search
beam Beam search over a bounded frontier
mcts Monte Carlo tree search
human You, in the GUI build

Install

Homebrew
# CLI (all platforms)
brew install danielriddell21/tap/gambit

# native macOS GUI window
brew install --cask danielriddell21/tap/gambit
Go install
go install github.com/danielriddell21/gambit/cmd/gambit@latest
From source
git clone https://github.com/danielriddell21/gambit
cd gambit
just run

A go install build is headless — the window sits behind the ebiten build tag.

Library

pkg/chess is the public package — board, moves, legality, FEN and results — and is documented on pkg.go.dev.

Documentation

Full documentation lives in the gambit wiki.

Directories

Path Synopsis
cmd
gambit command
internal
cli
gui
log
pkg
chess
Package chess is a self-contained chess engine: board state, pieces, move generation, legality checking, FEN parsing, make/unmake, and game-result detection.
Package chess is a self-contained chess engine: board state, pieces, move generation, legality checking, FEN parsing, make/unmake, and game-result detection.
tools
demogen command
Command demogen renders gambit's documentation media headlessly: short, deterministic games between agents, one frame per move.
Command demogen renders gambit's documentation media headlessly: short, deterministic games between agents, one frame per move.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL