8#ifndef CHESS_RANK_H_INCLUDED
9#define CHESS_RANK_H_INCLUDED
17#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
Defines macros and constants for the library.
#define CHESS_ENUM(type, name)
Defines a typed enum or a typedef enum based on the availability of typed enums in the compiler.
Definition macros.h:84
bool chess_rank_is_valid(ChessRank rank)
Checks if the given rank is valid (1-8).
void chess_rank_debug(ChessRank rank)
Prints a debug representation of the given rank.
ChessRank
Represents the ranks (rows) on a chess board, from 1 to 8.
Definition rank.h:27
@ CHESS_RANK_2
Definition rank.h:29
@ CHESS_RANK_8
Definition rank.h:35
@ CHESS_RANK_1
Definition rank.h:28
@ CHESS_RANK_7
Definition rank.h:34
@ CHESS_RANK_3
Definition rank.h:30
@ CHESS_RANK_NONE
Definition rank.h:37
@ CHESS_RANK_5
Definition rank.h:32
@ CHESS_RANK_6
Definition rank.h:33
@ CHESS_RANK_4
Definition rank.h:31
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").