analyzer

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SampleJson = []byte(`{
"scores": [0, 0],
"onturn": 0,
"size": 15,
"rack": "EINRSTZ",
"lexicon": "CSW19",
"board": [
  "...............",
  "...............",
  "...............",
  "...............",
  "...............",
  "...............",
  "...............",
  "...HELLO.......",
  "...............",
  "...............",
  "...............",
  "...............",
  "...............",
  "...............",
  "..............."
]}`)

Functions

func AnalyzeBoard

func AnalyzeBoard(jsonBoard []byte) ([]byte, error)

Types

type Analyzer

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

func NewAnalyzer

func NewAnalyzer(config *config.Config) *Analyzer

func NewDefaultAnalyzer

func NewDefaultAnalyzer() *Analyzer

Create an analyzer with an empty config. This will not have any relative resource paths resolved to actual paths; the caller is responsible for precaching everything so that we never actually hit the file system.

func (*Analyzer) Analyze

func (an *Analyzer) Analyze(jsonBoard []byte) ([]byte, error)

func (*Analyzer) GenerateMoves added in v0.8.2

func (an *Analyzer) GenerateMoves(numPlays int)

func (*Analyzer) LoadGame added in v0.8.2

func (an *Analyzer) LoadGame(jsonBoard []byte) error

func (*Analyzer) RunTest

func (an *Analyzer) RunTest() error

func (*Analyzer) SimInit added in v0.8.2

func (an *Analyzer) SimInit() error

func (*Analyzer) SimSingleThread added in v0.8.2

func (an *Analyzer) SimSingleThread(iters int) error

func (*Analyzer) SimState added in v0.8.2

func (an *Analyzer) SimState() ([]byte, error)

temp

func (*Analyzer) ToJsonMoves added in v0.8.2

func (an *Analyzer) ToJsonMoves() ([]byte, error)

type JsonBoard

type JsonBoard struct {
	Scores  []int
	Onturn  int
	Size    int
	Lexicon string
	Board   []string
	Rack    string
}

type JsonMove

type JsonMove struct {
	Action             string
	Row                int
	Column             int
	Vertical           bool
	DisplayCoordinates string
	Tiles              string
	Leave              string
	Equity             float64
	Score              int
}

func MakeJsonMove

func MakeJsonMove(m *move.Move) JsonMove

Jump to

Keyboard shortcuts

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