Documentation
¶
Overview ¶
Code generated by go generate; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func CommandDigits() *cli.Command
- func CommandLetterBoxed() *cli.Command
- func CommandOrder() *cli.Command
- func CommandPlay() *cli.Command
- func CommandRanks() *cli.Command
- func CommandScore() *cli.Command
- func CommandStrategies() *cli.Command
- func CommandSuggest() *cli.Command
- func CommandValidate() *cli.Command
- func CommandVersion() *cli.Command
- func CommandWordlists() *cli.Command
- func NoOp(_ string) bool
- func Score(secret string, guesses ...string) ([]string, error)
- type Alpha
- type Bigram
- type Board
- type Box
- type BoxOption
- type Candidate
- type Chain
- type Dictionary
- type Digits
- type Elimination
- type Encoder
- type FilterFunc
- type Frequency
- type Game
- type Grab
- type Graph
- type Mark
- type Marks
- type Operation
- type Operations
- type Operator
- type Option
- type Position
- type Probe
- type Round
- type Rt
- type Scoreboard
- type Speculate
- type Strategies
- type Strategy
- type Tiered
- type Trie
Constants ¶
const RuntimeKey = "github.com/bzimmer/qordle#RuntimeKey"
RuntimeKey in app metadata
Variables ¶
var ErrInvalidFormat = errors.New("invalid pattern format")
var ErrInvalidLength = errors.New("secret and guess lengths do not match")
Functions ¶
func CommandDigits ¶
func CommandLetterBoxed ¶
func CommandOrder ¶
func CommandPlay ¶
func CommandRanks ¶
func CommandScore ¶
func CommandStrategies ¶
func CommandSuggest ¶
func CommandValidate ¶
func CommandVersion ¶
func CommandWordlists ¶
Types ¶
type Alpha ¶
type Alpha struct{}
Alpha orders the dictionary alphabetically
func (*Alpha) Apply ¶
func (s *Alpha) Apply(words Dictionary) Dictionary
type Bigram ¶
type Bigram struct{}
Bigram sorts the dictionary by the bigram frequency of the word
func (*Bigram) Apply ¶
func (s *Bigram) Apply(words Dictionary) Dictionary
type BoxOption ¶
type BoxOption func(*Box)
func WithConcurrent ¶
func WithMaxSolutionLength ¶
func WithMinWordLength ¶
type Candidate ¶
type Candidate struct {
Board Board `json:"board"`
Ops Operations `json:"ops"`
}
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain chains multiple strategies to sort the wordlist
func (*Chain) Apply ¶
func (s *Chain) Apply(words Dictionary) Dictionary
type Dictionary ¶
type Dictionary []string
func Filter ¶
func Filter(words Dictionary, fns ...FilterFunc) Dictionary
func Read ¶
func Read(name string) (Dictionary, error)
type Elimination ¶
type Elimination struct{}
func (*Elimination) Apply ¶
func (s *Elimination) Apply(words Dictionary) Dictionary
func (*Elimination) String ¶
func (s *Elimination) String() string
type FilterFunc ¶
FilterFunc performs a validation on the word
func Guess ¶
func Guess(guesses ...string) (FilterFunc, error)
func IsLower ¶
func IsLower() FilterFunc
func Length ¶
func Length(length int) FilterFunc
type Frequency ¶
type Frequency struct{}
Frequency sorts the wordlist by letter frequency
func (*Frequency) Apply ¶
func (s *Frequency) Apply(words Dictionary) Dictionary
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
type Operation ¶
type Operations ¶
type Operations []Operation
func (Operations) Hash ¶
func (o Operations) Hash() string
func (Operations) String ¶
func (o Operations) String() string
type Option ¶
type Option func(*Game)
Option provides a configuration mechanism for a Game
func WithDictionary ¶
func WithDictionary(dictionary Dictionary) Option
WithDictionary is the dictionary to use
func WithRounds ¶
type Position ¶
type Position struct{}
Position sorts the word list be letter position
func (*Position) Apply ¶
func (s *Position) Apply(words Dictionary) Dictionary
type Probe ¶ added in v0.5.0
type Probe struct {
// contains filtered or unexported fields
}
Probe puts a guess ahead of the ranked words when it is expected to reveal more than guessing a remaining word, even though it may not be a candidate. A guess scores the entropy of its feedback across the remaining words: one splitting them into many small groups of identical feedback beats one leaving a few large groups. Each remaining word earns a bonus for the chance of being the secret, so with only a few words left a candidate wins over a pure probe.
func (*Probe) Apply ¶ added in v0.5.0
func (s *Probe) Apply(words Dictionary) Dictionary
type Rt ¶
type Rt struct {
// Encoder encodes a struct
Encoder Encoder
// Grab for querying http endpoints
Grab Grab
// Start time of the execution
Start time.Time
// Strategies manages the available strategies
Strategies Strategies
}
Rt for access to runtime components
type Scoreboard ¶
type Speculate ¶
type Speculate struct {
// contains filtered or unexported fields
}
Speculate attempts to find a word which eliminates the most letters
func (*Speculate) Apply ¶
func (s *Speculate) Apply(words Dictionary) Dictionary
type Strategies ¶
type Strategy ¶
type Strategy interface {
String() string
Apply(Dictionary) Dictionary
}
func NewProbe ¶ added in v0.5.0
func NewProbe(guesses, preferred Dictionary, strategy Strategy) Strategy
NewProbe returns a strategy which may lead with any of guesses, planning against the preferred words while they remain.
func NewSpeculator ¶
func NewSpeculator(words Dictionary, strategy Strategy) Strategy
func NewTiered ¶ added in v0.5.0
func NewTiered(preferred Dictionary, strategy Strategy) Strategy
type Tiered ¶ added in v0.5.0
type Tiered struct {
// contains filtered or unexported fields
}
Tiered ranks the preferred words ahead of the rest, ordering them with the wrapped strategy. The rest stay reachable but are only ranked by the strategy once no preferred words remain; until then they follow in alphabetical order, sparing quadratic strategies such as elimination from scoring thousands of unlikely words.
func (*Tiered) Apply ¶ added in v0.5.0
func (s *Tiered) Apply(words Dictionary) Dictionary
