c4

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

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

func (*Board) Apply

func (b *Board) Apply(m game.PlayerMove) error

func (*Board) Format

func (b *Board) Format(s fmt.State, c rune)

type Game

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

func New

func New(rows, cols, N int) *Game

New creates a new game with a board of (rows,cols) and N to win (connect4 being 4 to win)

func (*Game) ActionSpace

func (g *Game) ActionSpace() int

func (*Game) AdditionalScore

func (g *Game) AdditionalScore() float32

func (*Game) Apply

func (g *Game) Apply(m game.PlayerMove) game.State

func (*Game) Board

func (g *Game) Board() []game.Colour

func (*Game) BoardSize

func (g *Game) BoardSize() (int, int)

func (*Game) Check

func (g *Game) Check(m game.PlayerMove) bool

func (*Game) Clone

func (g *Game) Clone() game.State

func (*Game) Ended

func (g *Game) Ended() (bool, game.Player)

func (*Game) Eq

func (g *Game) Eq(other game.State) bool

func (*Game) Format

func (g *Game) Format(s fmt.State, c rune)

func (*Game) Fwd

func (g *Game) Fwd()

func (*Game) Handicap

func (g *Game) Handicap() int

func (*Game) Hash

func (g *Game) Hash() game.Zobrist

func (*Game) Historical

func (g *Game) Historical(i int) []game.Colour

func (*Game) LastMove

func (g *Game) LastMove() game.PlayerMove

func (*Game) MoveNumber

func (g *Game) MoveNumber() int

func (*Game) Passes

func (g *Game) Passes() int

Passes will always return 0

func (*Game) Reset

func (g *Game) Reset()

func (*Game) Score

func (g *Game) Score(p game.Player) float32

func (*Game) SetToMove

func (g *Game) SetToMove(p game.Player)

func (*Game) ToMove

func (g *Game) ToMove() game.Player

func (*Game) UndoLastMove

func (g *Game) UndoLastMove()

Jump to

Keyboard shortcuts

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