ai

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAIAction

func BasicAIAction(g core.Game, depth int) (core.Action, core.Game, bool)

BasicAIAction selects the best action for the side to move using negamax with alpha-beta pruning, MVV-LVA move ordering and quiescence search at the given depth. Depth 0 evaluates each candidate move with quiescence (captures and promotions are resolved); depth 1 additionally looks one ply ahead; etc. Returns the action, resulting game, and true; or (Action{}, game, false) when the game is already over.

func RandomAction

func RandomAction(g core.Game, rng *rand.Rand) (core.Action, core.Game, bool)

RandomAction picks a uniformly random legal non-resign action for the side to move. Returns the action and the resulting game, or (Action{}, game, false) when the game is already over.

func TimedAIAction

func TimedAIAction(g core.Game, budget time.Duration) (core.Action, core.Game, bool)

TimedAIAction selects the best action for the side to move using iterative deepening within the given time budget: it searches at increasing depths and returns the best move from the deepest fully completed iteration. Partial iterations are discarded, so the result is deterministic per depth reached. Returns the action, resulting game, and true; or (Action{}, game, false) when the game is already over.

Types

This section is empty.

Jump to

Keyboard shortcuts

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