aboutsummaryrefslogtreecommitdiff
path: root/include/state.h
blob: 17d705ab7315698f778d7a3d09c5030474ac818c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdint.h>
#include "enums.h"

typedef uint16_t colour_stack_t;
typedef uint8_t data_t;

static uint8_t board_size;
static data_t celldat[36];
static colour_stack_t colours[36];
static uint8_t white_flats, black_flats, white_caps, black_caps, turn;

void reset_state(const uint8_t new_board_size);

enum ACTION_RESULT
try_place(const int8_t location, const enum COLOUR colour,
          const enum STONE_VARIANT stone);

enum ACTION_RESULT
try_move(const int8_t location, const enum MOVE_DIRECTION direction,
         const uint8_t steps, const uint8_t drops[5]);

enum WIN_RESULT
check_win(const enum COLOUR colour);