pub enum Rule {
Show 17 variants
EOI,
piece,
active_color,
castling,
rank_digit,
rank,
piece_placement,
square,
en_passant,
halfmove,
fullmove,
event_tag,
white_tag,
black_tag,
comment,
fen_core,
fen_record,
}Variants§
EOI
End-of-input
piece
piece — a single piece character.
Allowed: p,r,n,b,q,k (black) or P,R,N,B,Q,K (white).
Examples: r, N
active_color
active_color — which side is to move.
w for White, b for Black.
castling
castling — castling availability field.
Either - (no castling rights) or one or more of K, Q, k, q.
K = White king-side, Q = White queen-side, k = Black king-side, q = Black queen-side.
rank_digit
rank_digit — number of consecutive empty squares in a rank.
A single character ‘1’..‘8’.
rank
rank — one board rank (row).
A sequence of piece and/or rank_digit tokens that expands to exactly 8 squares.
Examples: rnbqkbnr, pppppppp, 8, 3k4
piece_placement
piece_placement — full board placement: eight ranks separated by ‘/’.
Example: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR
square
square — algebraic square coordinate (file + rank).
file: a..h, rank: 1..8.
Example: e4
en_passant
en_passant — en-passant target square or ‘-’.
Either ‘-’ or a square (e.g. e3).
halfmove
halfmove — halfmove clock: number of halfmoves since last capture or pawn move.
fullmove
fullmove — fullmove number: incremented after Black’s move.
event_tag
[Event "World Blitz Championship"]
white_tag
[White "Magnus Carlsen"]
black_tag
[Black "Ian Nepomniachtchi"]
comment
comment — textual comment enclosed in curly braces {}.
Comments can appear after the FEN string.
Example: {This position is from round 3}
fen_core
fen_core — the core FEN record:
piece placement, active color, castling rights,
en-passant target, halfmove clock, and fullmove number.
Example full FEN:
r1bqkbnr/pppppppp/2n5/8/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 1
fen_record
fen_record — the complete record including optional PGN-like tags and a comment.
Example:
[Event “World Blitz Championship”]
[White “Magnus Carlsen”]
[Black “Ian Nepomniachtchi”]
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
{Starting position of the match}