init board
This commit is contained in:
+5
-1
@@ -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
@@ -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}\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user