init board

This commit is contained in:
Odweta
2026-02-17 17:10:27 +01:00
parent ed02a45205
commit 9dea0555dc
2 changed files with 13 additions and 9 deletions
+5 -1
View File
@@ -3,7 +3,11 @@
#include "util.h" #include "util.h"
bool init_board(board_t *board) { bool init_board(board_t *board) {
for (int i = 0; i < BOARD_VERTICAL; i++) {
for (int j = 0; j < BOARD_HORIZONTAL; j++) {
*board[i][j] = BOARD_DEFAULT_CONFIG[i][j];
}
}
} }
void select_player(player_e *player, unsigned int round_count) { void select_player(player_e *player, unsigned int round_count) {
+7 -7
View File
@@ -49,13 +49,13 @@ typedef struct {
// the default arrangment of pieces on the board // the default arrangment of pieces on the board
#define BOARD_DEFAULT_CONFIG \ #define BOARD_DEFAULT_CONFIG \
{\ (board_t){\
{2,3,4,5,6,4,3,2}\ {2,3,4,5,6,4,3,2},\
{1,1,1,1,1,1,1,1}\ {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}\ {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}\ {1,1,1,1,1,1,1,1},\
{2,3,4,5,6,4,3,2}\ {2,3,4,5,6,4,3,2}\
} }