xwordgame

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package xwordgame 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 (
	LeaveFile = "leave_values_011019_v5.csv"
)

Variables

View Source
var (
	CVCCounter *expvar.Int
	IsPlaying  *expvar.Int
)
View Source
var AuthorizationKey = os.Getenv("AUTH_KEY")
View Source
var GaddagDir = os.Getenv("GADDAG_DIR")

Functions

func StartCompVCompStaticGames

func StartCompVCompStaticGames(gd *gaddag.SimpleGaddag, numGames int, threads int,
	outputFilename string) error

Types

type CompVCompService

type CompVCompService struct{}

func (*CompVCompService) Play

type CompVCompServiceArgs

type CompVCompServiceArgs struct {
	NumGames        int    `json:"numGames"`
	NumCores        int    `json:"numCores"`
	Computer1Engine string `json:"comp1Engine"`
	Computer2Engine string `json:"comp2Engine"`
	OutputFile      string `json:"outputFile"`

	LexiconName string `json:"lexiconName"`
	AuthToken   string `json:"authToken"`
}

type CompVCompServiceReply

type CompVCompServiceReply struct {
	Message string `json:"message"`
}

type Job

type Job struct{}

type Player

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

A Player plays crossword game.

type XWordGame

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

XWordGame encapsulates the various components of a crossword game.

func (*XWordGame) CompVsCompStatic

func (game *XWordGame) CompVsCompStatic(gd *gaddag.SimpleGaddag)

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

func (*XWordGame) Init

func (game *XWordGame) Init(gd *gaddag.SimpleGaddag)

Init initializes the crossword game and seeds the random number generator.

func (*XWordGame) PlayBestStaticTurn

func (game *XWordGame) PlayBestStaticTurn(playerID int)

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

func (*XWordGame) PlayMove

func (game *XWordGame) PlayMove(m *move.Move)

PlayMove plays a move.

func (*XWordGame) StartGame

func (game *XWordGame) StartGame()

StartGame resets everything and deals out the first set of tiles.

Jump to

Keyboard shortcuts

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