aboutsummaryrefslogtreecommitdiff
path: root/include/tak.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/tak.h')
-rw-r--r--include/tak.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/tak.h b/include/tak.h
index 7d96b9a..f6cde6a 100644
--- a/include/tak.h
+++ b/include/tak.h
@@ -1,10 +1,7 @@
#include <stdint.h>
-enum E_RESULT {
- ACT_OK, ACT_ILLEGAL, ACT_OVERFLOW,
- PTN_VALID, PTN_INVALID,
- WIN_DRAW, WIN_FLAT_WHITE, WIN_FLAT_BLACK,
- WIN_ROAD_WHITE, WIN_ROAD_BLACK, WIN_DRAGON };
+enum E_RESULT {ACT_OK, ACT_ILLEGAL, ACT_OVERFLOW,
+ PTN_VALID, PTN_INVALID, GAME_END };
// -------------------------------------------------------------------
// State management
@@ -12,6 +9,9 @@ enum E_RESULT {
enum COLOUR { C_WHITE, C_BLACK };
enum STONE_VARIANT { STONE_FLAT, STONE_STANDING, STONE_CAPSTONE };
enum MOVE_DIRECTION { M_UP, M_DOWN, M_LEFT, M_RIGHT };
+enum WIN_TYPE { WIN_DRAW,
+ WIN_FLAT_WHITE, WIN_FLAT_BLACK,
+ WIN_ROAD_WHITE, WIN_ROAD_BLACK, WIN_DRAGON};
typedef uint8_t data_t;
typedef uint16_t colour_stack_t;
@@ -22,11 +22,12 @@ typedef uint16_t colour_stack_t;
#define COUNT_AT(l) (celldat[(l)] >> NUM_SHIFT)
#define THE_COORDS(col,row) ((col)+(row)*board_size)
+enum WIN_TYPE won;
uint8_t board_size;
data_t celldat[36];
colour_stack_t colours[36];
enum COLOUR current_colour;
-uint8_t white_flats, black_flats, white_caps, black_caps, ply;
+uint8_t white_count, black_count, ply;
void reset_state(const uint8_t new_board_size);
void next_ply(void);
@@ -39,7 +40,7 @@ enum E_RESULT
try_move(const int8_t location, const enum MOVE_DIRECTION direction,
const uint8_t steps, const uint8_t drops[5]);
-enum E_RESULT
+enum WIN_TYPE
check_win(void);
// -------------------------------------------------------------------