diff options
Diffstat (limited to 'src/board.h')
-rw-r--r-- | src/board.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/board.h b/src/board.h index 442b03d..f5d2da3 100644 --- a/src/board.h +++ b/src/board.h @@ -1,12 +1,15 @@ -#define TILE_SIZE 5 -#define BOARD_WIDTH 6 -#define BOARD_BYTES TILE_SIZE * (BOARD_WIDTH * BOARD_WIDTH) +#define BOARD_WIDTH 2 +#define BOARD_ROW_BYTES ((BOARD_WIDTH * 2) + 1) +#define BOARD_BYTES BOARD_ROW_BYTES * BOARD_ROW_BYTES -int direction_increments[] = { - - TILE_SIZE * BOARD_WIDTH + 2, - TILE_SIZE + 2, - TILE_SIZE * BOARD_WIDTH - 2, - - TILE_SIZE - 2 +char EMPTY = ' '; +char FORBIDDEN = ' '; + +int neighbor_increments[] = { + - BOARD_ROW_BYTES, + 1, + BOARD_ROW_BYTES, + - 1 }; // Board @@ -15,7 +18,8 @@ void initialize_board(char* board); void print_board(char* board); // Moves -int check_allowed_tile(char* tile, int position, char* board); +int is_allowed_placement(char* tile, int position, char* board); -void place_tile(char* tile, int position, char* board); +int is_center_position(int position); +int place_tile(char* tile, int position, char* board); |