chess

package
v0.0.0-...-1a0192e Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	White side = 'w'
	Black side = 'b'
)
View Source
const (
	Pawn   pieceType = 'p'
	Rook   pieceType = 'r'
	King   pieceType = 'k'
	Queen  pieceType = 'q'
	Knight pieceType = 'n'
	Bishop pieceType = 'b'
)

Variables

This section is empty.

Functions

func SaveFENGame

func SaveFENGame(g *Game) string

func SaveGame

func SaveGame(game *Game, name string)

Types

type Board

type Board [8][8]*Piece

type Game

type Game struct {
	Pieces        []*Piece
	Side          side
	FullMoveClock int
	HalfMoveClock int
	Castling      castlingStatus
	EnPassantFile string
	EnPassantRank string
}

func CreateGame

func CreateGame(name string) *Game

func LoadFENGame

func LoadFENGame(s string) *Game

func LoadGame

func LoadGame(name string) *Game

func NewGame

func NewGame() *Game

func (*Game) Board

func (g *Game) Board() Board

func (*Game) DisplaySlack

func (g *Game) DisplaySlack() string

func (*Game) DisplayText

func (g *Game) DisplayText() string

func (*Game) Move

func (g *Game) Move(src string, dst string) error

func (*Game) Piece

func (g *Game) Piece(rankFile string) *Piece

func (*Game) ValidateMove

func (g *Game) ValidateMove(src string, dst string) error

type Piece

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

func (*Piece) Capture

func (p *Piece) Capture()

func (*Piece) Side

func (p *Piece) Side() side

func (*Piece) String

func (p *Piece) String() string

func (*Piece) Symbol

func (p *Piece) Symbol() string

Jump to

Keyboard shortcuts

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