aboutsummaryrefslogtreecommitdiff
path: root/include/tak.h
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2020-12-30 18:39:20 -0500
committertslil <tslil@posteo.de>2020-12-30 18:48:36 -0500
commitf2dc7f730cdd0e52a402ac1d5db057803a88c400 (patch)
tree078c92cc29467654dfa803f915ca22477bf6cf4e /include/tak.h
parent45ca44aab3684ae0b29cfd8b6ae0ea658e8e0574 (diff)
Corrected PTN move parsing
Diffstat (limited to 'include/tak.h')
-rw-r--r--include/tak.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/tak.h b/include/tak.h
index c703943..d161640 100644
--- a/include/tak.h
+++ b/include/tak.h
@@ -16,6 +16,12 @@ enum MOVE_DIRECTION { M_UP, M_DOWN, M_LEFT, M_RIGHT };
typedef uint8_t data_t;
typedef uint16_t colour_stack_t;
+#define NUM_SHIFT 4
+#define STONE_MASK 0b00000011
+#define STONE_AT(l) (celldat[(l)] & STONE_MASK)
+#define COUNT_AT(l) (celldat[(l)] >> NUM_SHIFT)
+#define THE_COORDS(x,y) ((x)+(y)*board_size)
+
uint8_t board_size;
data_t celldat[36];
colour_stack_t colours[36];