some defaults and the beggining of the init method

This commit is contained in:
Odweta
2026-02-17 15:22:59 +01:00
parent c768cf7bc4
commit 021dbb9c11
3 changed files with 46 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
#include "chess.h"
#include <stdbool.h>
int board[BOARD_VERTICAL][BOARD_HORIZONTAL];
bool init_board() {
}
+34
View File
@@ -0,0 +1,34 @@
#ifndef CHESS_H
#define CHESS_H
/* the "board" is the playable area on which
* pieces move. pieces are represented by numbers:
* 0 - no piece
* 1 - pawn
* 2 - rook
* 3 - knight
* 4 - bishop
* 5 - queen
* 6 - king
*/
#define BOARD_HORIZONTAL 8
#define BOARD_VERTICAL 8
//int board[BOARD_VERTICAL][BOARD_HORIZONTAL];
// the default arrangment of pieces on the board
#define BOARD_DEFAULT_CONFIG \
{\
{2,3,4,5,6,4,3,2}\
{1,1,1,1,1,1,1,1}\
{0,0,0,0,0,0,0,0}\
{0,0,0,0,0,0,0,0}\
{0,0,0,0,0,0,0,0}\
{1,1,1,1,1,1,1,1}\
{2,3,4,5,6,4,3,2}\
}
// initializes the board with the default configuration of pieces
bool init_board();
#endif // CHESS_H
+4
View File
@@ -0,0 +1,4 @@
#ifndef UTIL_H
#define UTIL_H
#endif // UTIL_H