Versions in this module Expand all Collapse all v0 v0.0.2 Feb 4, 2022 v0.0.1 Feb 4, 2022 Changes in this version + const ASCIIPlayedThrough + const BlankMachineLetter + const BlankOffset + const BlankToken + const EmptySquareMarker + const MaxAlphabetSize + const PlayedThroughMarker + const SeparationMachineLetter + const SeparationToken + var CacheKeyPrefix = "letterdist:" + func CacheLoadFunc(cfg *config.Config, key string) (interface{}, error) + func CacheReadFunc(data []byte) (interface{}, error) + func HashableToUserVisible(s string, alph *Alphabet) string + func Set(name string, data []byte) error + func ToMachineOnlyString(word string, alph *Alphabet) (string, error) + type Alphabet struct + func EnglishAlphabet() *Alphabet + func FrenchAlphabet() *Alphabet + func FromSlice(arr []uint32) *Alphabet + func GermanAlphabet() *Alphabet + func NorwegianAlphabet() *Alphabet + func PolishAlphabet() *Alphabet + func SpanishAlphabet() *Alphabet + func (a *Alphabet) Init() + func (a *Alphabet) Reconcile() + func (a *Alphabet) Serialize() []uint32 + func (a *Alphabet) Update(word string) error + func (a Alphabet) CurIdx() MachineLetter + func (a Alphabet) Letter(b MachineLetter) rune + func (a Alphabet) Letters() map[MachineLetter]rune + func (a Alphabet) NumLetters() uint8 + func (a Alphabet) Val(r rune) (MachineLetter, error) + func (a Alphabet) Vals() map[rune]MachineLetter + type Bag struct + func NewBag(ld *LetterDistribution, alph *Alphabet) *Bag + func (b *Bag) Copy() *Bag + func (b *Bag) CopyFrom(other *Bag) + func (b *Bag) Draw(n int) ([]MachineLetter, error) + func (b *Bag) DrawAtMost(n int) []MachineLetter + func (b *Bag) Exchange(letters []MachineLetter) ([]MachineLetter, error) + func (b *Bag) LetterDistribution() *LetterDistribution + func (b *Bag) Peek() []MachineLetter + func (b *Bag) PutBack(letters []MachineLetter) + func (b *Bag) Redraw(currentRack []MachineLetter) []MachineLetter + func (b *Bag) Refill() + func (b *Bag) RemoveTiles(tiles []MachineLetter) error + func (b *Bag) Shuffle() + func (b *Bag) TilesRemaining() int + type LetterDistribution struct + Distribution map[rune]uint8 + PointValues map[rune]uint8 + SortOrder map[rune]int + Vowels []rune + func EnglishLetterDistribution(cfg *config.Config) (*LetterDistribution, error) + func FrenchLetterDistribution(cfg *config.Config) (*LetterDistribution, error) + func GermanLetterDistribution(cfg *config.Config) (*LetterDistribution, error) + func Get(cfg *config.Config, name string) (*LetterDistribution, error) + func NamedLetterDistribution(cfg *config.Config, name string) (*LetterDistribution, error) + func NorwegianLetterDistribution(cfg *config.Config) (*LetterDistribution, error) + func PolishLetterDistribution(cfg *config.Config) (*LetterDistribution, error) + func ScanLetterDistribution(data io.Reader) (*LetterDistribution, error) + func SpanishLetterDistribution(cfg *config.Config) (*LetterDistribution, error) + func (ld *LetterDistribution) Alphabet() *Alphabet + func (ld *LetterDistribution) MakeBag() *Bag + func (ld *LetterDistribution) NumTotalTiles() int + func (ld *LetterDistribution) Score(ml MachineLetter) int + type LetterSet uint64 + type LetterSlice []rune + func (a LetterSlice) Len() int + func (a LetterSlice) Less(i, j int) bool + func (a LetterSlice) Swap(i, j int) + type MachineLetter byte + func ToMachineLetters(word string, alph *Alphabet) ([]MachineLetter, error) + func (ml MachineLetter) Blank() MachineLetter + func (ml MachineLetter) IntrinsicTileIdx() (MachineLetter, bool) + func (ml MachineLetter) IsBlanked() bool + func (ml MachineLetter) IsPlayedTile() bool + func (ml MachineLetter) IsVowel(alph *Alphabet) bool + func (ml MachineLetter) Unblank() MachineLetter + func (ml MachineLetter) UserVisible(alph *Alphabet) rune + type MachineWord []MachineLetter + func ToMachineWord(word string, alph *Alphabet) (MachineWord, error) + func (mw MachineWord) Bytes() []byte + func (mw MachineWord) Score(ld *LetterDistribution) int + func (mw MachineWord) String() string + func (mw MachineWord) UserVisible(alph *Alphabet) string + type Rack struct + LetArr []int + func NewRack(alph *Alphabet) *Rack + func RackFromString(rack string, a *Alphabet) *Rack + func (r *Rack) Add(letter MachineLetter) + func (r *Rack) Alphabet() *Alphabet + func (r *Rack) Clear() + func (r *Rack) Copy() *Rack + func (r *Rack) CopyFrom(other *Rack) + func (r *Rack) Empty() bool + func (r *Rack) Has(letter MachineLetter) bool + func (r *Rack) Hashable() string + func (r *Rack) NumTiles() uint8 + func (r *Rack) ScoreOn(ld *LetterDistribution) int + func (r *Rack) Set(mls []MachineLetter) + func (r *Rack) String() string + func (r *Rack) Take(letter MachineLetter) + func (r *Rack) TilesOn() MachineWord + type Word struct + Dist *LetterDistribution + Word string + func (w Word) Len() int + func (w Word) Less(i, j int) bool + func (w Word) MakeAlphagram() string + func (w Word) String() string + func (w Word) Swap(i, j int)