tinymove

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const BlanksBitMask = 127 << 12
View Source
const ColBitMask = 0b00111110
View Source
const RowBitMask = 0b00000111_11000000

Variables

View Source
var DefaultSmallMove = SmallMove{}

DefaultSmallMove is a blank move (a pass)

View Source
var TBitMasks = [7]uint64{63 << 20, 63 << 26, 63 << 32, 63 << 38, 63 << 44, 63 << 50, 63 << 56}

Functions

This section is empty.

Types

type SmallMove

type SmallMove struct {
	// contains filtered or unexported fields
}

A SmallMove consists of a TinyMove which encodes all the positional and tile info, plus a few extra fields needed for endgames and related modules. We're trying to strike a balance between decreasing allocations and still staying speedy.

func PassMove

func PassMove() SmallMove

func TilePlayMove

func TilePlayMove(tm TinyMove, score int16, tilesPlayed, playLength uint8) SmallMove

func (*SmallMove) AddEstimatedValue

func (m *SmallMove) AddEstimatedValue(v int16)

AddEstimatedValue adds an estimate to the existing estimated value of this estimate. Estimate.

func (*SmallMove) CoordsAndVertical

func (m *SmallMove) CoordsAndVertical() (int, int, bool)

func (*SmallMove) EstimatedValue

func (m *SmallMove) EstimatedValue() int16

EstimatedValue is an internal value that is used in calculating endgames and related metrics.

func (*SmallMove) IsPass

func (m *SmallMove) IsPass() bool

func (*SmallMove) PlayLength

func (m *SmallMove) PlayLength() int

func (*SmallMove) Score

func (m *SmallMove) Score() int

func (*SmallMove) SetEstimatedValue

func (m *SmallMove) SetEstimatedValue(v int16)

SetEstimatedValue sets the estimated value of this move. It is calculated outside of this package.

func (*SmallMove) ShortDescription

func (m *SmallMove) ShortDescription() string

func (*SmallMove) TilesPlayed

func (m *SmallMove) TilesPlayed() int

func (*SmallMove) TinyMove

func (m *SmallMove) TinyMove() TinyMove

type TinyMove

type TinyMove uint64

TinyMove is a 64-bit representation of a move. We can probably make it smaller at the cost of higher decoding. It is made to be as small as possible to fit it in a transposition table.

const InvalidTinyMove TinyMove = 1 << 63

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL