summaryrefslogtreecommitdiff
path: root/include/tak.c
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2020-12-30 17:16:49 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commitaeaed8da4ee5e58660223bec2d28aacd0cf8276a (patch)
tree89f12eb812a66ce807eaca910c92d6b0cae5654d /include/tak.c
parent0a3b2d825077b5e6c5f1cf4a0dcb13fdfffc0be6 (diff)
OBOEs in try_move + logic errors
- Corrected use of static - Implemented next_turn
Diffstat (limited to 'include/tak.c')
-rw-r--r--include/tak.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/tak.c b/include/tak.c
index 85d04d4..1c47aeb 100644
--- a/include/tak.c
+++ b/include/tak.c
@@ -1,7 +1,7 @@
#include "tak.h"
enum E_RESULT
-try_ptn(char *ptn) {
+do_ptn(char *ptn) {
enum E_RESULT res;
uint8_t location;
@@ -11,8 +11,10 @@ try_ptn(char *ptn) {
enum MOVE_DIRECTION direction;
res = parse_move(board_size, ptn, &location,
&direction, &steps, drops);
- if (res == PTN_VALID)
+ if (res == PTN_VALID) {
+ if (turn < 2) return A_ILLEGAL;
res = try_move(location, direction, steps, drops);
+ }
} else {
enum STONE_VARIANT stone;
res = parse_place(board_size, ptn, &location, &stone);