Files
chess-c/src/board.h
2023-12-21 00:48:10 +01:00

26 lines
542 B
C

#ifndef __BOARD_HEADER
#include "common.h"
typedef int Piece;
typedef enum { Pawn = 0, Knight, Bishop, Rook, Queen, King } Pieces;
typedef enum { White = 0, Black = 8 } PieceColors;
typedef struct {
uint row;
uint column;
} Coordinates;
typedef struct {
Piece piece;
Coordinates coords;
} Square;
typedef Square Board[64];
PieceColors piece_getColor(const Piece piece);
Piece piece_getColorlessPiece(const Piece piece);
bool board_movePiece(Board board, const Coordinates from, const Coordinates to);
#endif // !__BOARD_HEADER