Files
chess/src/types.h
2024-03-10 20:11:14 +01:00

28 lines
384 B
C

#ifndef CHESS_TYPES_H
#define CHESS_TYPES_H
#include <stdbool.h>
#include <stdint.h>
#define BOARD_SIZE 8
#define TOTAL_BOARD_SIZE BOARD_SIZE * BOARD_SIZE
#define LENGTH(array) (sizeof array / sizeof *array)
#define NOT_SELECTED UINT_LEAST8_MAX
enum pieces {
NOTHING,
KING,
QUEEN,
ROOK,
BISHOP,
KNIGHT,
PAWN
};
struct piece_t {
uint_least8_t type;
bool white;
};
#endif