aboutsummaryrefslogtreecommitdiff
path: root/include/tak.h
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-01-11 01:29:39 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit5d475f9dadcac74bde8262d600e68578e91323c9 (patch)
tree6358f2ceaee1b961b77380bc94fd92c950ea8c85 /include/tak.h
parentb598a3ab9e682a826516b242a710b26e0c22389f (diff)
Close in principle, but there;s a bug in ct1997 &/ pptdb!
Diffstat (limited to 'include/tak.h')
-rw-r--r--include/tak.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/include/tak.h b/include/tak.h
index a398b51..532d91a 100644
--- a/include/tak.h
+++ b/include/tak.h
@@ -1,7 +1,10 @@
+#ifndef TAK_H
+#define TAK_H
+
#include <stdint.h>
enum E_RESULT {ACT_OK, ACT_ILLEGAL, ACT_OVERFLOW,
- PTN_VALID, PTN_INVALID, GAME_END };
+ PTN_VALID, PTN_INVALID, GAME_END };
// -------------------------------------------------------------------
// State management
@@ -10,8 +13,8 @@ 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};
+ 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;
@@ -34,11 +37,11 @@ void next_ply(void);
enum E_RESULT
try_place(const int8_t location, const enum COLOUR colour,
- const enum STONE_VARIANT stone);
+ const enum STONE_VARIANT stone);
enum E_RESULT
try_move(const int8_t location, const enum MOVE_DIRECTION direction,
- const uint8_t steps, const uint8_t drops[5]);
+ const uint8_t steps, const uint8_t drops[5]);
enum WIN_TYPE
check_win(void);
@@ -48,25 +51,26 @@ check_win(void);
enum E_RESULT
parse_place(const uint8_t board_size, char *ptn,
- uint8_t *out_location, enum STONE_VARIANT *out_stone);
+ 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,
- uint8_t *out_steps, uint8_t out_drops[5]);
+ uint8_t *out_location, enum MOVE_DIRECTION *out_direction,
+ uint8_t *out_steps, uint8_t out_drops[5]);
void
generate_place(const uint8_t board_size, const uint8_t in_location,
- const enum STONE_VARIANT in_stone, char out_ptn[4]);
+ const enum STONE_VARIANT in_stone, char out_ptn[4]);
void
generate_move(const uint8_t board_size, const uint8_t in_location,
- const enum MOVE_DIRECTION in_direction,
- const uint8_t in_steps, const uint8_t in_drops[5],
- char out_ptn[10]);
+ const enum MOVE_DIRECTION in_direction,
+ const uint8_t in_steps, const uint8_t in_drops[5],
+ char out_ptn[10]);
// -------------------------------------------------------------------
// Game driver
enum E_RESULT
do_ptn(char *ptn);
+#endif