Module shakmaty::san
[−]
[src]
Read and write Standard Algebraic Notation.
Examples
Parse and write SANs:
use shakmaty::{Chess, Position}; use shakmaty::san::San; let san: San = "Nf3".parse()?; assert_eq!(san.to_string(), "Nf3");
Converting to a move:
let pos = Chess::default(); let m = san.to_move(&pos)?; assert_eq!(m, Move::Normal { role: Role::Knight, from: Square::G1, capture: None, to: Square::F3, promotion: None, });
Back to a (possibly disambiguated) SAN:
use shakmaty::san; assert_eq!(san::san(&pos, &m).to_string(), "Nf3");
Structs
InvalidSan |
Error when parsing a syntactially invalid SAN. |
SanPlus |
A |
Enums
San |
A move in Standard Algebraic Notation. |
SanError |
|
Functions
san |
Converts a move to Standard Algebraic Notation. |
san_plus |
Converts a move to Standard Algebraic Notation including possible check and checkmate suffixes. |