#![cfg(not(doctest))]
#![doc = include_str!("../README.md")]
pub mod chess_board;
pub mod chess_piece;
pub use chess_board::{coordinates, fen_notation, notation};
pub use chess_piece::piece;
pub use chess_piece::pieces::{bishop, king, knight, pawn, queen, rook};
#[cfg(test)]
mod test {
use crate::{chess_board::board::Board, coordinates::Coordinates, notation::Notation};
#[test]
fn create_notation_and_coordinates() {
let notation: Notation = Notation::new('e', '4').unwrap();
let coordinates: Coordinates = Coordinates::new(5, 4);
assert_eq!(coordinates, notation.to_coordinates().unwrap());
assert_eq!(notation, coordinates.to_notation().unwrap());
let notation_from_string: Notation = Notation::from_string("e4").unwrap();
let coordinate_from_string: Coordinates = Coordinates::from_string("5,4").unwrap();
assert_eq!(
coordinate_from_string,
notation_from_string.to_coordinates().unwrap()
);
assert_eq!(
notation_from_string,
coordinate_from_string.to_notation().unwrap()
);
}
#[test]
fn create_chess_board() {
let two_dimensional_board = Board::new_two_dimensional_starting_position();
let one_dimensional_board = Board::new_one_dimensional_starting_position();
dbg!(one_dimensional_board);
dbg!(two_dimensional_board);
}
}