Documentation ¶
Index ¶
- func FromBoardGameCoords(c string) (int, int, bool)
- func MinimallyEqual(m1 *Move, m2 *Move) bool
- func ToBoardGameCoords(row int, col int, vertical bool) string
- type Move
- func NewBonusScoreMove(t MoveType, tiles tilemapping.MachineWord, score int) *Move
- func NewChallengeMove(leave tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
- func NewExchangeMove(tiles tilemapping.MachineWord, leave tilemapping.MachineWord, ...) *Move
- func NewLostScoreMove(t MoveType, rack tilemapping.MachineWord, score int) *Move
- func NewPassMove(leave tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
- func NewScoringMove(score int, tiles tilemapping.MachineWord, leave tilemapping.MachineWord, ...) *Move
- func NewScoringMoveSimple(score int, coords string, word string, leave string, ...) *Move
- func NewUnsuccessfulChallengePassMove(leave tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
- func (m *Move) Action() MoveType
- func (m *Move) Alphabet() *tilemapping.TileMapping
- 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, alsoCheckTransposition, ignoreLeave bool) bool
- func (m *Move) Equity() float64
- func (m *Move) FullRack() string
- func (m *Move) Leave() tilemapping.MachineWord
- func (m *Move) LeaveString() string
- func (m *Move) MoveTypeString() string
- func (m *Move) PlayLength() int
- func (m *Move) Score() int
- func (m *Move) Set(tiles tilemapping.MachineWord, leave tilemapping.MachineWord, score int, ...)
- func (m *Move) SetAction(action MoveType)
- func (m *Move) SetAlphabet(alph *tilemapping.TileMapping)
- func (m *Move) SetEmpty()
- func (m *Move) SetEquity(e float64)
- func (m *Move) SetLeave(leave tilemapping.MachineWord)
- func (m *Move) SetScore(s int)
- func (m *Move) ShortDescription() string
- func (m *Move) String() string
- func (m *Move) Tiles() tilemapping.MachineWord
- func (m *Move) TilesPlayed() int
- func (m *Move) TilesString() string
- func (m *Move) TilesStringExchange() string
- 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.
func MinimallyEqual ¶ added in v0.8.7
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 tilemapping.MachineWord, score int) *Move
func NewChallengeMove ¶ added in v0.4.5
func NewChallengeMove(leave tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
NewChallengeMove creates a challenge with the given leave.
func NewExchangeMove ¶
func NewExchangeMove(tiles tilemapping.MachineWord, leave tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
NewExchangeMove creates an exchange.
func NewLostScoreMove ¶ added in v0.2.11
func NewLostScoreMove(t MoveType, rack tilemapping.MachineWord, score int) *Move
func NewPassMove ¶
func NewPassMove(leave tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
NewPassMove creates a pass with the given leave.
func NewScoringMove ¶
func NewScoringMove(score int, tiles tilemapping.MachineWord, leave tilemapping.MachineWord, vertical bool, tilesPlayed int, alph *tilemapping.TileMapping, 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 *tilemapping.TileMapping) *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 tilemapping.MachineWord, alph *tilemapping.TileMapping) *Move
func (*Move) Alphabet ¶
func (m *Move) Alphabet() *tilemapping.TileMapping
Alphabet is the alphabet used by this 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() tilemapping.MachineWord
func (*Move) LeaveString ¶ added in v0.4.5
func (*Move) MoveTypeString ¶ added in v0.4.5
func (*Move) PlayLength ¶ added in v0.8.7
func (*Move) Set ¶ added in v0.4.9
func (m *Move) Set(tiles tilemapping.MachineWord, leave tilemapping.MachineWord, score int, rowStart, colStart, tilesPlayed int, vertical bool, action MoveType, alph *tilemapping.TileMapping)
func (*Move) SetAlphabet ¶ added in v0.4.9
func (m *Move) SetAlphabet(alph *tilemapping.TileMapping)
func (*Move) SetEquity ¶
SetEquity sets the equity of this move. It is calculated outside this package.
func (*Move) SetLeave ¶ added in v0.5.0
func (m *Move) SetLeave(leave tilemapping.MachineWord)
func (*Move) ShortDescription ¶
ShortDescription provides a short description, useful for logging or user display.
func (*Move) Tiles ¶
func (m *Move) Tiles() tilemapping.MachineWord
func (*Move) TilesPlayed ¶
TilesPlayed returns the number of tiles played by this move.