From aeaed8da4ee5e58660223bec2d28aacd0cf8276a Mon Sep 17 00:00:00 2001 From: tslil Date: Wed, 30 Dec 2020 17:16:49 -0500 Subject: OBOEs in try_move + logic errors - Corrected use of static - Implemented next_turn --- include/tak.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/tak.c') 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); -- cgit v1.3.1