gameboard

package
v0.0.0-...-c7a9053 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Character string
	InUse     bool
}

Cell is a Game Board individual space

func (Cell) String

func (c Cell) String() string

type GameBoard

type GameBoard struct {
	Width  int
	Height int
	Board  [][]Cell
}

The GameBoard type holds the state of all the characters on the gamebaord

func NewGameBoard

func NewGameBoard(boardMap []string) GameBoard

NewGameBoard is a factory for the gameboard data. It will leave the board in its zero state to keep the factory lean and efficient.

func (*GameBoard) CheckBoard

func (g *GameBoard) CheckBoard(l lexicon.WordPrefixGroup) Groups

CheckBoard starts the recursive breadth-first search on the gameboard. This one is the main bit. Iterates over the entire board, looking for words. Words can be strung together from any direction, so long as a letter has not been used more than once in the same word.

func (GameBoard) String

func (g GameBoard) String() string

type Groups

type Groups map[int][]string

Groups is a collection of words grouped by their length

type Letters

type Letters []string

Letters is an array of the Letters making up the word in progress.

func (Letters) String

func (l Letters) String() string

type Words

type Words map[string]struct{}

Words is a unique collection of words found in the gameboard

func (Words) String

func (w Words) String() string

Jump to

Keyboard shortcuts

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