Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChessBoard ¶
type ChessBoard struct { Cells map[int]string // Numeric Position to Text Representation. For e.g. 10 -> B2 Pieces map[int]*Piece // Numeric Position --> Piece. For printing purposes only StrCells map[string]int // Text Representation to Numeric Position of a cell }
func CreateChessBoard ¶
func CreateChessBoard() *ChessBoard
Create new chessboard Create cells with their numeric identifiers
func (*ChessBoard) PlacePiece ¶
func (b *ChessBoard) PlacePiece(pos int, p *Piece)
Place piece on a chessboard and update available move positions for a piece.
pos numeric position on board p Piece
type DiagonalBoundry ¶
type DiagonalBoundry struct {
// contains filtered or unexported fields
}
Diagonal boundries for a piece
type Piece ¶
type Piece struct { Kind string // Kind of piece. e.g. king, queen, horse, pawn, rook, bishop CurPos int // Numeric position on board Symbol string // e.g. ♚, ♛, ♜, ♝, ♞ AvailPos map[int]bool // Available move positions for a piece // contains filtered or unexported fields }
Chessboard piece
Click to show internal directories.
Click to hide internal directories.