schachmatt 0.3.0

A chess library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use schachmatt::Fen;

/// Imports the default chess starting position from a fen string
/// and exports it again afterwards
fn main() {
    let starting_position = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";

    println!("{starting_position}");
    let Ok(position) = Fen::import(starting_position) else {
        panic!("Unable to import position");
    };

    let exported_position = Fen::export(&position);
    println!("{exported_position}");
}