aboutsummaryrefslogtreecommitdiff
path: root/src/board.h
blob: d5fb2d03a8f4000825d21eab85e9db17db418bbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#define BOARD_WIDTH 2
#define BOARD_ROW_BYTES ((BOARD_WIDTH * 2) + 1)
#define BOARD_BYTES BOARD_ROW_BYTES * BOARD_ROW_BYTES

char EMPTY = ' ';
char FORBIDDEN = ' ';

int neighbor_increments[] = {
  - BOARD_ROW_BYTES,
    1,
    BOARD_ROW_BYTES,
  - 1
};

// Board
void initialize_board(char* board);

void print_board(char* board);

// Moves
int is_allowed_placement(char* tile, int position, char* board);

int translate_coordinate(int position);

int is_center_position(int position);

int place_tile(char* tile, int position, char* board);

// Structures
void traverse_structure(char id, int byte, char* board, char* structures);

void create_structure_mask(char* board, char* structures);