automatic

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: GPL-3.0 Imports: 26 Imported by: 0

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

View Source
const (
	ExhaustiveLeavePlayer = "exhaustiveleave"
	NoLeavePlayer         = "noleave"
)

Variables

View Source
var (
	CVCCounter *expvar.Int
	IsPlaying  *expvar.Int
)

Functions

func AnalyzeLogFile

func AnalyzeLogFile(filepath string) (string, error)

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

func StartCompVCompStaticGames

func StartCompVCompStaticGames(ctx context.Context, cfg *config.Config,
	numGames int, block bool, threads int, outputFilename, player1, player2, lexicon, letterDistribution,
	leavefile1, leavefile2, pegfile1, pegfile2 string, botcode1, botcode2 pb.BotRequest_BotCode) error

Types

type GameRunner

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

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

func NewGameRunner

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

NewGameRunner just instantiates and initializes a game runner.

func (*GameRunner) CompVsCompStatic

func (r *GameRunner) CompVsCompStatic() error

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

func (*GameRunner) Init

func (r *GameRunner) Init(player1, player2, leavefile1, leavefile2, pegfile1, pegfile2 string,
	botcode1, botcode2 pb.BotRequest_BotCode) error

Init initializes the runner

func (*GameRunner) PlayBestStaticTurn

func (r *GameRunner) PlayBestStaticTurn(playerIdx int)

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

func (*GameRunner) StartGame

func (r *GameRunner) StartGame()

type Job

type Job struct{}

Jump to

Keyboard shortcuts

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