Documentation ¶
Index ¶
- Constants
- func BlackFigure(char string) string
- func BoardColumnToFile(col int) string
- func BoardFileToColumn(char string) int
- func BoardRankToRow(char string) int
- func BoardRowToRank(row int) string
- func ColoredFigure(char string, isWhite bool) string
- func ExecuteMove(board *Board, move *Move, isWhite bool)
- func IsFigureType(char string, fig string) bool
- func IsGameWon(board *Board, isWhite bool) bool
- func IsKingCheck(board *Board, isWhite bool) bool
- func IsPlayersFigure(char string, isWhite bool) bool
- func IsValidFigure(char string) bool
- func MakeStartingBoard() string
- func ValidateMove(board *Board, move *Move, isWhite bool, moveHistory *[]Move) error
- func WhiteFigure(char string) string
- type Board
- type Game
- type Move
Constants ¶
View Source
const ( CaptureSign = "x" KingCheckSign = "+" CheckmateSign = "#" DrawOfferMove = "=" DrawOfferRejectMove = "!" KingSideCastligMove = "0-0" QueenSideCastligMove = "0-0-0" )
View Source
const ( Rook = "R" Knight = "N" Bishop = "B" King = "K" Queen = "Q" Pawn = "P" Empty = "0" )
Variables ¶
This section is empty.
Functions ¶
func BlackFigure ¶
func BoardColumnToFile ¶
func BoardFileToColumn ¶
func BoardRankToRow ¶
func BoardRowToRank ¶
func ColoredFigure ¶
func ExecuteMove ¶
func IsFigureType ¶
func IsKingCheck ¶
func IsPlayersFigure ¶
func IsValidFigure ¶
func MakeStartingBoard ¶
func MakeStartingBoard() string
func ValidateMove ¶
func WhiteFigure ¶
Types ¶
type Game ¶
func (*Game) MakeMove ¶
MakeMove godoc The move parameter represents the moving of a single figure on board and should be in following format: (figure_char)(file)?(rank)?(capture_sign)?(file)(rank)(promoted_figure_char)(king_check_sign|checkmate_sign)?
The x represents that this move captures opponents figure and + at the end that this move is king check for opponent. (e.g. Qa3, Nxf3, Bxc4+, R3xa6+)
The move can also be a request for draw by containing only = (equals sign) or rejection of draw ! (exclamation mark)
This function returns following values (normalized move, is game won, error)
Click to show internal directories.
Click to hide internal directories.