engine

package
v0.0.0-...-13820af Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameBoard

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

func NewGameBoard

func NewGameBoard(supportedElements []rune, message string) *GameBoard

func (*GameBoard) AppendIfMissing

func (b *GameBoard) AppendIfMissing(slice []*Point, points ...*Point) []*Point

func (*GameBoard) CountNear

func (b *GameBoard) CountNear(pt *Point, wanted ...rune) int

func (*GameBoard) Find

func (b *GameBoard) Find(wanted ...rune) []*Point

func (*GameBoard) FindFirst

func (b *GameBoard) FindFirst(wanted ...rune) *Point

func (*GameBoard) FindNear

func (b *GameBoard) FindNear(pt *Point) []rune

func (*GameBoard) GetAt

func (b *GameBoard) GetAt(pt *Point) rune

func (*GameBoard) IsAt

func (b *GameBoard) IsAt(pt *Point, wanted ...rune) bool

func (*GameBoard) IsNear

func (b *GameBoard) IsNear(pt *Point, wanted ...rune) bool

func (*GameBoard) Size

func (b *GameBoard) Size() int

func (*GameBoard) String

func (b *GameBoard) String() string

type Point

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

func NewPoint

func NewPoint(x int, y int) *Point

func StepDown

func StepDown(pt *Point) *Point

func StepLeft

func StepLeft(pt *Point) *Point

func StepRight

func StepRight(pt *Point) *Point

func StepUp

func StepUp(pt *Point) *Point

func (*Point) Equal

func (lhs *Point) Equal(rhs *Point) bool

func (*Point) IsValid

func (p *Point) IsValid(boardSize int) bool

func (*Point) String

func (p *Point) String() string

func (*Point) X

func (p *Point) X() int

func (*Point) Y

func (p *Point) Y() int

type Solver

type Solver interface {
	Answer(message string) string
}

type SortedPoints

type SortedPoints []*Point

func (SortedPoints) Len

func (p SortedPoints) Len() int

func (SortedPoints) Less

func (p SortedPoints) Less(i, j int) bool

func (SortedPoints) Swap

func (p SortedPoints) Swap(i, j int)

type WebSocketRunner

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

func NewWebSocketRunner

func NewWebSocketRunner(url string) *WebSocketRunner

func (*WebSocketRunner) Run

func (r *WebSocketRunner) Run(solver Solver)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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