Chess 0.0.1
A library written in c
|
Defines the chess rank type and related utility functions for representing and manipulating chess ranks. More...
Go to the source code of this file.
Enumerations | |
enum | ChessRank : int8_t { CHESS_RANK_1 = 0 , CHESS_RANK_2 = 1 , CHESS_RANK_3 = 2 , CHESS_RANK_4 = 3 , CHESS_RANK_5 = 4 , CHESS_RANK_6 = 5 , CHESS_RANK_7 = 6 , CHESS_RANK_8 = 7 , CHESS_RANK_NONE = 8 } |
Represents the ranks (rows) on a chess board, from 1 to 8. More... | |
Functions | |
void | chess_rank_debug (ChessRank rank) |
Prints a debug representation of the given rank. | |
bool | chess_rank_is_valid (ChessRank rank) |
Checks if the given rank is valid (1-8). | |
size_t | chess_rank_from_algebraic (ChessRank *rank, const char *string) |
Parses a rank from algebraic notation (e.g., "1", "2", ..., "8"). | |
size_t | chess_rank_to_algebraic (ChessRank rank, char *string, size_t string_size) |
Converts a rank to algebraic notation (e.g., "1", "2", ..., "8"). | |
Defines the chess rank type and related utility functions for representing and manipulating chess ranks.
enum ChessRank : int8_t |
void chess_rank_debug | ( | ChessRank | rank | ) |
Prints a debug representation of the given rank.
[in] | rank | The rank to print. |
size_t chess_rank_from_algebraic | ( | ChessRank * | rank, |
const char * | string | ||
) |
Parses a rank from algebraic notation (e.g., "1", "2", ..., "8").
[out] | rank | Pointer to store the parsed rank. |
[in] | string | The string containing the algebraic notation. |
bool chess_rank_is_valid | ( | ChessRank | rank | ) |
Checks if the given rank is valid (1-8).
[in] | rank | The rank to check. |
size_t chess_rank_to_algebraic | ( | ChessRank | rank, |
char * | string, | ||
size_t | string_size | ||
) |
Converts a rank to algebraic notation (e.g., "1", "2", ..., "8").
[in] | rank | The rank to convert. |
[out] | string | The buffer to store the algebraic notation. |
[in] | string_size | The size of the output buffer. |