oware

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

README

oware

Library defining a set of rules for the game Oware

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	Status GameStatus
	// contains filtered or unexported fields
}

func New

func New(playerToMove int, scores []int, pits []int, validMoves []int, status GameStatus) (*Board, error)

func NewS

func NewS(s string) (*Board, error)

func (*Board) GetValidMoves

func (b *Board) GetValidMoves() []int

func (*Board) Move

func (b *Board) Move(pit int) (*Board, error)

func (*Board) ToString

func (b *Board) ToString() string

"Status/Player/pit0,pit1,...pit11/score1,score2/validmove1,..."

type GameStatus

type GameStatus int64
const (
	InProgress GameStatus = iota
	Player1Won
	Player2Won
	Tie
)

Jump to

Keyboard shortcuts

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