analyzer

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: GPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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