Documentation
¶
Index ¶
- Constants
- Variables
- type AlgebraicNotation
- func (an AlgebraicNotation) DestinationPosition() Position
- func (an AlgebraicNotation) IsCastle() bool
- func (an AlgebraicNotation) IsCastleKingSide() bool
- func (an AlgebraicNotation) IsCastleQueenSide() bool
- func (an AlgebraicNotation) IsCheck() bool
- func (an AlgebraicNotation) IsCheckMate() bool
- func (an AlgebraicNotation) IsPromotion() bool
- func (an AlgebraicNotation) Material() Material
- func (an AlgebraicNotation) OriginDisambiguated() bool
- func (an AlgebraicNotation) OriginFile() File
- func (an AlgebraicNotation) OriginRank() Rank
- func (an AlgebraicNotation) PromotedTo() Material
- func (an AlgebraicNotation) Takes() bool
- type AlgebraiclyNotated
- type Board
- type Color
- type Direction
- type File
- type Game
- type Material
- type Move
- type Movetext
- type MovetextMove
- type Outcome
- type PGN
- type PGNParser
- type Path
- type Piece
- type Position
- type Rank
- type Square
- type Tags
Constants ¶
View Source
const ( WhiteWin Outcome = "1-0" BlackWin = "0-1" Draw = "1/2-1/2" )
View Source
const ( A File = "a" B = "b" C = "c" D = "d" E = "e" F = "f" G = "g" H = "h" )
Variables ¶
View Source
var ( ErrorMoveByWrongColor = errors.New("pawn: move by wrong color") ErrorInvalidPosition = errors.New("pawn: invalid position") )
View Source
var ( A1 = Position{A, 1} A2 = Position{A, 2} A3 = Position{A, 3} A4 = Position{A, 4} A5 = Position{A, 5} A6 = Position{A, 6} A7 = Position{A, 7} A8 = Position{A, 8} B1 = Position{B, 1} B2 = Position{B, 2} B3 = Position{B, 3} B4 = Position{B, 4} B5 = Position{B, 5} B6 = Position{B, 6} B7 = Position{B, 7} B8 = Position{B, 8} C1 = Position{C, 1} C2 = Position{C, 2} C3 = Position{C, 3} C4 = Position{C, 4} C5 = Position{C, 5} C6 = Position{C, 6} C7 = Position{C, 7} C8 = Position{C, 8} D1 = Position{D, 1} D2 = Position{D, 2} D3 = Position{D, 3} D4 = Position{D, 4} D5 = Position{D, 5} D6 = Position{D, 6} D7 = Position{D, 7} D8 = Position{D, 8} E1 = Position{E, 1} E2 = Position{E, 2} E3 = Position{E, 3} E4 = Position{E, 4} E5 = Position{E, 5} E6 = Position{E, 6} E7 = Position{E, 7} E8 = Position{E, 8} F1 = Position{F, 1} F2 = Position{F, 2} F3 = Position{F, 3} F4 = Position{F, 4} F5 = Position{F, 5} F6 = Position{F, 6} F7 = Position{F, 7} F8 = Position{F, 8} G1 = Position{G, 1} G2 = Position{G, 2} G3 = Position{G, 3} G4 = Position{G, 4} G5 = Position{G, 5} G6 = Position{G, 6} G7 = Position{G, 7} G8 = Position{G, 8} H1 = Position{H, 1} H2 = Position{H, 2} H3 = Position{H, 3} H4 = Position{H, 4} H5 = Position{H, 5} H6 = Position{H, 6} H7 = Position{H, 7} H8 = Position{H, 8} )
View Source
var NoPiece = Piece{}
Functions ¶
This section is empty.
Types ¶
type AlgebraicNotation ¶
type AlgebraicNotation string
func (AlgebraicNotation) DestinationPosition ¶
func (an AlgebraicNotation) DestinationPosition() Position
func (AlgebraicNotation) IsCastle ¶
func (an AlgebraicNotation) IsCastle() bool
func (AlgebraicNotation) IsCastleKingSide ¶
func (an AlgebraicNotation) IsCastleKingSide() bool
func (AlgebraicNotation) IsCastleQueenSide ¶
func (an AlgebraicNotation) IsCastleQueenSide() bool
func (AlgebraicNotation) IsCheck ¶
func (an AlgebraicNotation) IsCheck() bool
func (AlgebraicNotation) IsCheckMate ¶
func (an AlgebraicNotation) IsCheckMate() bool
func (AlgebraicNotation) IsPromotion ¶
func (an AlgebraicNotation) IsPromotion() bool
func (AlgebraicNotation) Material ¶
func (an AlgebraicNotation) Material() Material
func (AlgebraicNotation) OriginDisambiguated ¶
func (an AlgebraicNotation) OriginDisambiguated() bool
func (AlgebraicNotation) OriginFile ¶
func (an AlgebraicNotation) OriginFile() File
func (AlgebraicNotation) OriginRank ¶
func (an AlgebraicNotation) OriginRank() Rank
func (AlgebraicNotation) PromotedTo ¶
func (an AlgebraicNotation) PromotedTo() Material
func (AlgebraicNotation) Takes ¶
func (an AlgebraicNotation) Takes() bool
type AlgebraiclyNotated ¶
type Board ¶
type Board struct { Squares []*Square // contains filtered or unexported fields }
func (*Board) MoveFromAlgebraic ¶
func (b *Board) MoveFromAlgebraic(an AlgebraicNotation) (Move, error)
func (Board) SquareAtPosition ¶
func (Board) SquaresForPiece ¶
type Movetext ¶
type Movetext struct {
Moves []*MovetextMove
}
func (Movetext) Turns ¶
func (m Movetext) Turns() []AlgebraicNotation
type MovetextMove ¶
type MovetextMove struct { Number uint8 WhiteMove AlgebraicNotation BlackMove AlgebraicNotation }
func (MovetextMove) String ¶
func (m MovetextMove) String() string
type PGN ¶
func ParseAllPGNFromFilePath ¶
type PGNParser ¶
type PGNParser struct {
// contains filtered or unexported fields
}
func NewPGNParser ¶
func NewPGNParser() *PGNParser
func NewPGNParserFromReader ¶
func (*PGNParser) ParseFromString ¶
type Position ¶
type Square ¶
func AllSquares ¶
func AllSquares() []*Square
Source Files
¶
Click to show internal directories.
Click to hide internal directories.