28 lines
384 B
C
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
|