/sfen

Primary LanguageRust

Rust SFEN

Rust SFEN is a SFEN(Shogi Forsyth-Edwards Notation) deserialization library.

Build Status MIT License

Usage

Add this to your Cargo.toml:

[dependencies]
sfen = "0.0.6"

and this to your crate root:

extern crate sfen;

SFEN specification

sfen_record = board " " player " " captured_pieces (" "+ integer)?
captured_pieces = "-" / (integer? piece)+
player = "b" / "w"
board = row (row_separator row)*
row = (piece / integer)+
integer = digit / nonzero_digit integer
digit = "0" / nonzero_digit
nonzero_digit = "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
row_separator = "/"
piece = king / gold / (promotion? ( rook / bishop / silver / knight / lance / pawn ))
king = "K" / "k"
gold = "G" / "g"
rook = "R" / "r"
bishop = "B" / "b"
silver = "S" / "s"
knight = "N" / "n"
lance = "L" / "l"
pawn = "P" / "p"
promotion = "+"

License

MIT

Author