Crates.io | fenx |
lib.rs | fenx |
version | 0.1.1 |
source | src |
created_at | 2024-01-13 16:37:05.174905 |
updated_at | 2024-01-13 17:36:40.132305 |
description | A rust library for parsing and handling FEN and algebraic chess notations. |
homepage | |
repository | https://github.com/Smallsan/fenx |
max_upload_size | |
id | 1098677 |
size | 23,802 |
Fenx is a Rust library for handling chess game logic. It provides support for parsing Forsyth-Edwards Notation (FEN) strings, handling chess moves in algebraic notation, and more.
The Fen module provides the Fen
struct for representing a chess position in Forsyth-Edwards Notation (FEN).
Fen
StructConstructor: Fen::new(board: &str) -> Fen
Fen
struct from a given board position string.Parser: Fen::parse_fen(fen_str: &str) -> Result<Fen, &'static str>
Fen
struct.Debug Printing: Fen::debug()
Fen
struct for debugging purposes.Board Printing: Fen::print_to_board()
Board Conversion: Fen::boardify() -> String
Fen
struct into a string representation of a chess board.The Coordinates module provides the Coordinates
struct for representing a position on the chess board.
Coordinates
StructConstructor: Coordinates { x: i8, y: i8 }
Coordinates
struct with given x and y values.From Notation: Coordinates::from_notation(notation: Notation) -> Result<Coordinates, &'static str>
Notation
struct into a Coordinates
struct.To Notation: Coordinates::to_notation(&self) -> Result<Notation, &'static str>
Coordinates
struct into a Notation
struct.The Notation module provides the Notation
struct for representing a chess move in algebraic notation.
Notation
StructConstructor: Notation::new(file: char, rank: char) -> Option<Notation>
Notation
struct with given file and rank values.From Coordinates: Notation::from_coordinates(coordinates: Coordinates) -> Result<Notation, &'static str>
Coordinates
struct into a Notation
struct.To Coordinates: Notation::to_coordinates(&self) -> Result<Coordinates, &'static str>
Notation
struct into a Coordinates
struct.Contributions to Fenix are welcome! Please ensure your code is formatted with cargo fmt
before creating a pull request.