Chess 0.0.1
A library written in c
|
Defines the chess file type and related utility functions for representing and manipulating chess files. More...
Go to the source code of this file.
Enumerations | |
enum | ChessFile : int8_t { CHESS_FILE_A = 0 , CHESS_FILE_B = 1 , CHESS_FILE_C = 2 , CHESS_FILE_D = 3 , CHESS_FILE_E = 4 , CHESS_FILE_F = 5 , CHESS_FILE_G = 6 , CHESS_FILE_H = 7 , CHESS_FILE_NONE = 8 } |
Represents the files (columns) on a chess board, from A to H. More... | |
Functions | |
void | chess_file_debug (ChessFile file) |
Prints a debug representation of the given file. | |
bool | chess_file_is_valid (ChessFile file) |
Checks if the given file is valid (A-H). | |
size_t | chess_file_from_algebraic (ChessFile *file, const char *string) |
Parses a file from algebraic notation (e.g., "a", "b", ... "h"). | |
size_t | chess_file_to_algebraic (ChessFile file, char *string, size_t string_size) |
Converts a file to algebraic notation (e.g., "a", "b", ... "h"). | |
Defines the chess file type and related utility functions for representing and manipulating chess files.
enum ChessFile : int8_t |
void chess_file_debug | ( | ChessFile | file | ) |
Prints a debug representation of the given file.
[in] | file | The file to print. |
size_t chess_file_from_algebraic | ( | ChessFile * | file, |
const char * | string | ||
) |
Parses a file from algebraic notation (e.g., "a", "b", ... "h").
[out] | file | Pointer to store the parsed file. |
[in] | string | The string containing the algebraic notation. |
bool chess_file_is_valid | ( | ChessFile | file | ) |
Checks if the given file is valid (A-H).
[in] | file | The file to check. |
size_t chess_file_to_algebraic | ( | ChessFile | file, |
char * | string, | ||
size_t | string_size | ||
) |
Converts a file to algebraic notation (e.g., "a", "b", ... "h").
[in] | file | The file to convert. |
[out] | string | The buffer to store the algebraic notation. |
[in] | string_size | The size of the output buffer. |