diff options
Diffstat (limited to 'include/tak.h')
| -rw-r--r-- | include/tak.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/include/tak.h b/include/tak.h index 8b40430..63dffe1 100644 --- a/include/tak.h +++ b/include/tak.h @@ -24,8 +24,10 @@ // Types // =================================================================== -enum E_RESULT {ACT_OK, ACT_ILLEGAL, ACT_OVERFLOW, - PTN_VALID, PTN_INVALID, GAME_END }; +enum ACT_RESULT { ACT_OK, ACT_ILLEGAL, ACT_OVERFLOW, ACT_INVALID_PTN, GAME_END }; + +enum PTN_RESULT { PTN_OK, PTN_INVALID }; +enum TPS_RESULT { TPS_OK, TPS_INVALID }; enum COLOUR { C_WHITE, C_BLACK }; enum STONE_VARIANT { STONE_FLAT, STONE_STANDING, STONE_CAPSTONE }; @@ -49,6 +51,8 @@ typedef uint16_t colour_stack_t; // Variables // =================================================================== +// NOTE: We only support one capstone per player and 5s or 6s games. + extern enum WIN_TYPE won; extern uint8_t board_size; extern data_t celldat[36]; @@ -66,11 +70,11 @@ extern uint8_t white_count, black_count, ply; void reset_state(const uint8_t new_board_size); void next_ply(void); -enum E_RESULT +enum ACT_RESULT try_place(const int8_t location, const enum COLOUR colour, const enum STONE_VARIANT stone); -enum E_RESULT +enum ACT_RESULT try_move(const int8_t location, const enum MOVE_DIRECTION direction, const uint8_t steps, const uint8_t drops[5]); @@ -80,13 +84,13 @@ check_win(void); // ------------------------------------------------------------------- // PTN related -enum E_RESULT -parse_place(const uint8_t board_size, char *ptn, - uint8_t *out_location, enum STONE_VARIANT *out_stone); +enum PTN_RESULT +parse_place(char *in_ptn, uint8_t *out_location, + enum STONE_VARIANT *out_stone); -enum E_RESULT -parse_move(const uint8_t board_size, char *ptn, - uint8_t *out_location, enum MOVE_DIRECTION *out_direction, +enum PTN_RESULT +parse_move(char *in_ptn, uint8_t *out_location, + enum MOVE_DIRECTION *out_direction, uint8_t *out_steps, uint8_t out_drops[5]); void @@ -102,6 +106,6 @@ generate_move(const uint8_t in_location, // ------------------------------------------------------------------- // Game driver -enum E_RESULT +enum ACT_RESULT do_ptn(char *ptn); #endif |
