prob. finished the pseudocode in main.c

This commit is contained in:
Odweta
2026-02-17 16:35:32 +01:00
parent d94e04f8ef
commit 69390eb187
2 changed files with 50 additions and 1 deletions
+32 -1
View File
@@ -18,9 +18,35 @@
#define BOARD_HORIZONTAL 8
#define BOARD_VERTICAL 8
// just a simple type abstraction
// type abstractions
typedef int board_t[BOARD_HORIZONTAL][BOARD_VERTICAL];
typedef enum {
NONE,
PAWN,
ROOK,
KNIGHT,
BISHOP,
QUEEN,
KING
} piece_e;
typedef struct {
int x;
int y;
} pos_t;
typedef enum { WHITE, BLACK } player_e;
typedef struct {
// what
// where from
// where to
piece_e piece;
pos_t from;
pos_t to;
} move_t;
// the default arrangment of pieces on the board
#define BOARD_DEFAULT_CONFIG \
{\
@@ -33,6 +59,11 @@ typedef int board_t[BOARD_HORIZONTAL][BOARD_VERTICAL];
{2,3,4,5,6,4,3,2}\
}
typedef enum {
CHECKMATE,
STALEMATE
} end_condition_e;
// initializes the board with the default configuration of pieces
bool init_board(board_t *board);