Documentation ¶
Index ¶
- func FromBoardGameCoords(c string) (int, int, bool)
- func ToBoardGameCoords(row int, col int, vertical bool) string
- type Move
- func NewBonusScoreMove(t MoveType, tiles alphabet.MachineWord, score int) *Move
- func NewChallengeMove(leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
- func NewExchangeMove(tiles alphabet.MachineWord, leave alphabet.MachineWord, ...) *Move
- func NewLostScoreMove(t MoveType, rack alphabet.MachineWord, score int) *Move
- func NewPassMove(leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
- func NewScoringMove(score int, tiles alphabet.MachineWord, leave alphabet.MachineWord, ...) *Move
- func NewScoringMoveSimple(score int, coords string, word string, leave string, alph *alphabet.Alphabet) *Move
- func NewUnsuccessfulChallengePassMove(leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
- func (m *Move) Action() MoveType
- func (m *Move) Alphabet() *alphabet.Alphabet
- func (m *Move) BingoPlayed() bool
- func (m *Move) BoardCoords() string
- func (m *Move) CoordsAndVertical() (int, int, bool)
- func (m *Move) CopyFrom(other *Move)
- func (m *Move) Equals(o *Move) bool
- func (m *Move) Equity() float64
- func (m *Move) FullRack() string
- func (m *Move) Leave() alphabet.MachineWord
- func (m *Move) LeaveString() string
- func (m *Move) MoveTypeString() string
- func (m *Move) Score() int
- func (m *Move) Set(tiles alphabet.MachineWord, leave alphabet.MachineWord, score int, ...)
- func (m *Move) SetAction(action MoveType)
- func (m *Move) SetAlphabet(alph *alphabet.Alphabet)
- func (m *Move) SetEmpty()
- func (m *Move) SetEquity(e float64)
- func (m *Move) SetValuation(v float32)
- func (m *Move) ShortDescription() string
- func (m *Move) String() string
- func (m *Move) Tiles() alphabet.MachineWord
- func (m *Move) TilesPlayed() int
- func (m *Move) TilesString() string
- func (m *Move) Valuation() float32
- type MoveType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromBoardGameCoords ¶ added in v0.2.9
FromBoardGameCoords does the inverse operation of ToBoardGameCoords above.
Types ¶
type Move ¶
type Move struct {
// contains filtered or unexported fields
}
Move is a move. It can have a score, position, equity, etc. It doesn't have to be a scoring move.
func NewBonusScoreMove ¶ added in v0.2.11
func NewBonusScoreMove(t MoveType, tiles alphabet.MachineWord, score int) *Move
func NewChallengeMove ¶ added in v0.4.5
func NewChallengeMove(leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
NewChallengeMove creates a challenge with the given leave.
func NewExchangeMove ¶
func NewExchangeMove(tiles alphabet.MachineWord, leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
NewExchangeMove creates an exchange.
func NewLostScoreMove ¶ added in v0.2.11
func NewLostScoreMove(t MoveType, rack alphabet.MachineWord, score int) *Move
func NewPassMove ¶
func NewPassMove(leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
NewPassMove creates a pass with the given leave.
func NewScoringMove ¶
func NewScoringMove(score int, tiles alphabet.MachineWord, leave alphabet.MachineWord, vertical bool, tilesPlayed int, alph *alphabet.Alphabet, rowStart int, colStart int) *Move
NewScoringMove creates a scoring *Move and returns it.
func NewScoringMoveSimple ¶
func NewScoringMoveSimple(score int, coords string, word string, leave string, alph *alphabet.Alphabet) *Move
NewScoringMoveSimple takes in user-visible strings. Consider moving to this (it is a little slower, though, so maybe only for tests)
func NewUnsuccessfulChallengePassMove ¶ added in v0.4.5
func NewUnsuccessfulChallengePassMove(leave alphabet.MachineWord, alph *alphabet.Alphabet) *Move
func (*Move) BingoPlayed ¶ added in v0.4.9
func (*Move) BoardCoords ¶
func (*Move) FullRack ¶ added in v0.3.0
FullRack returns the entire rack that the move was made from. This can be calculated from the tiles it uses and the leave.
func (*Move) Leave ¶
func (m *Move) Leave() alphabet.MachineWord
func (*Move) LeaveString ¶ added in v0.4.5
func (*Move) MoveTypeString ¶ added in v0.4.5
func (*Move) SetAlphabet ¶ added in v0.4.9
func (*Move) SetEquity ¶
SetEquity sets the equity of this move. It is calculated outside this package.
func (*Move) SetValuation ¶ added in v0.2.11
SetValuation sets the valuation of this move. It is calculated outside of this package.
func (*Move) ShortDescription ¶
ShortDescription provides a short description, useful for logging or user display.
func (*Move) Tiles ¶
func (m *Move) Tiles() alphabet.MachineWord
func (*Move) TilesPlayed ¶
TilesPlayed returns the number of tiles played by this move.