summaryrefslogtreecommitdiff
path: root/src/ctaklm.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 /src/ctaklm.c
parent0a3b2d825077b5e6c5f1cf4a0dcb13fdfffc0be6 (diff)
OBOEs in try_move + logic errors
- Corrected use of static - Implemented next_turn
Diffstat (limited to 'src/ctaklm.c')
-rw-r--r--src/ctaklm.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ctaklm.c b/src/ctaklm.c
index d7fd7c1..885da7a 100644
--- a/src/ctaklm.c
+++ b/src/ctaklm.c
@@ -6,24 +6,23 @@
int main(int argc, char **argv) {
reset_state(5);
- enum ACTION_RESULT res = try_place(0, 0x0001, STONE_FLAT);
- res = try_place(1, 0x0001, STONE_FLAT);
- const uint8_t d[1] = {1};
- res = try_move(1, M_LEFT, 1, d);
+ enum E_RESULT r = try_place(0, C_BLACK, STONE_FLAT);
+ r = try_place(1, C_BLACK, STONE_FLAT);
+ uint8_t drops[5] = {1,0,0,0,0};
+ r = try_move(1, M_LEFT, 1, drops);
uint8_t location;
enum STONE_VARIANT stone;
- enum PTN_PARSE_RESULT pr = parse_place(5, "Cb3", &location, &stone);
+ r = parse_place(5, "Cb3", &location, &stone);
- printf("Place <%d>: stone %d at (%d,%d)\n",pr,stone,location%5,location/5);
+ printf("Place <%d>: stone %d at (%d,%d)\n",r,stone,location%5,location/5);
enum MOVE_DIRECTION direction;
uint8_t steps;
- uint8_t drops[5];
- pr = parse_move(5, "3c2+12", &location, &direction, &steps, drops);
+ r = parse_move(5, "3c2+12", &location, &direction, &steps, drops);
printf("Move <%d>: from (%d,%d) step %d sequence [%d,%d,%d,%d,%d]\n",
- pr,location%5,location/5,
+ r,location%5,location/5,
steps,drops[0],drops[1],drops[2],drops[3],drops[4]);
char buf[10];