movegen

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2014 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Overview

Package movegen contains all the move-generating functions. It makes heavy use of the GADDAG.

Index

Constants

View Source
const (
	NumTotalLetters = 27 // includes blank
	BlankPosition   = 26 // The blank is located at this position in a rack.
)

Variables

This section is empty.

Functions

func LettersRemain

func LettersRemain(rack []uint8) bool

LettersRemain returns true if there is at least one letter in the rack, 0 otherwise.

func NextNodeIdx

func NextNodeIdx(gaddagData []uint32, nodeIdx uint32, letter byte) uint32

NextNodeIdx returns the index, in gaddagData, of the next node's arc bit vector, given an initial node index and a letter. The letter can be the SeparationToken as well. It finds the ARC corresponding to the letter/token and finds the node that it points to. This is a rewrite of the NextArc function in the original GADDAG paper. Returns 0 if the next node was not found.

func NodeChildIdxs

func NodeChildIdxs(gaddagData []uint32, nodeIdx uint32) (
	children []uint32, letters []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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