automatic

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 30 Imported by: 1

Documentation

Overview

Package automatic contains all the logic for the actual gameplay of Crossword Game, which, as we said before, features all sorts of things like wingos and blonks.

Index

Constants

This section is empty.

Variables

View Source
var (
	CVCCounter *expvar.Int
	IsPlaying  *expvar.Int
)
View Source
var MaxTimePerEndgame = 10 * time.Second
View Source
var MaxTimePerTurn = 15 * time.Second

Functions

func AnalyzeLogFile added in v0.4.2

func AnalyzeLogFile(filepath string) (string, error)

AnalyzeLogFile analyzes the given game CSV file and spits out a bunch of statistics.

func ExportGCG added in v0.4.10

func ExportGCG(cfg *config.Config, filename, letterdist, lexicon, boardlayout, gid string,
	out io.Writer) error

func StartCompVCompStaticGames

func StartCompVCompStaticGames(ctx context.Context, cfg *config.Config,
	numGames int, block bool, threads int,
	outputFilename, lexicon, letterDistribution string,
	players []AutomaticRunnerPlayer) error

Types

type AutomaticRunnerPlayer added in v0.5.0

type AutomaticRunnerPlayer struct {
	LeaveFile   string
	PEGFile     string
	BotCode     pb.BotRequest_BotCode
	MinSimPlies int
}

type GameRunner

type GameRunner struct {
	// contains filtered or unexported fields
}

GameRunner is the master struct here for the automatic game logic.

func NewGameRunner added in v0.4.2

func NewGameRunner(logchan chan string, cfg *config.Config) *GameRunner

NewGameRunner just instantiates and initializes a game runner.

func (*GameRunner) CompVsCompStatic

func (r *GameRunner) CompVsCompStatic(addToHistory bool) error

CompVsCompStatic plays out a game to the end using best static turns.

func (*GameRunner) Game added in v0.4.5

func (r *GameRunner) Game() *game.Game

func (*GameRunner) Init

func (r *GameRunner) Init(players []AutomaticRunnerPlayer) error

Init initializes the runner

func (*GameRunner) PlayBestTurn added in v0.5.0

func (r *GameRunner) PlayBestTurn(playerIdx int, addToHistory bool) error

PlayBestTurn generates the best move for the player and plays it on the board.

func (*GameRunner) StartGame

func (r *GameRunner) StartGame(gidx int)

type Job

type Job struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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