csa-rs
A Shogi game serialization/deserialization library in CSA format. CSA format is a plaintext format for recording Shogi games. This library supports parsing CSA-formatted string as well as composing CSA-formatted string from structs. Detail about CSA format is found at here.
Usage
Below is an example of parsing CSA-formatted string into structs.
use Duration;
use ;
let csa_str = "\
V2.2
N+NAKAHARA
N-YONENAGA
$EVENT:13th World Computer Shogi Championship
PI
+
+2726FU
T12
";
let game = parse_csa.expect;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
In contrast, structs can be composed into CSA-formatted string.
use Duration;
use ;
let mut g = default;
g.black_player = Some;
g.white_player = Some;
g.event = Some;
g.moves.push;
g.moves.push;
let csa_str = "\
V2.2
N+NAKAHARA
N-YONENAGA
$EVENT:13th World Computer Shogi Championship
PI
+
+2726FU
T5
%TORYO
";
assert_eq!;
License
csa-rs
is licensed under the MIT license. Please read the LICENSE file in this repository for more information.