diff options
Diffstat (limited to 'src/ctaklm.c')
| -rw-r--r-- | src/ctaklm.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/ctaklm.c b/src/ctaklm.c index 3585bec..f6ccfe8 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -1,16 +1,28 @@ -#include <stdlib.h> #include <stdio.h> #include <state.h> +#include <ptn.h> int main(int argc, char **argv) { - reset_game(); + reset_state(5); enum ACTION_RESULT res = try_place(0, 0x0001, STONE_FLAT); res = try_place(1, 0x0001, STONE_FLAT); - const uint8_t drops[1] = {1}; - res = try_move(1, M_LEFT, 1, drops); + const uint8_t d[1] = {1}; + res = try_move(1, M_LEFT, 1, d); - printf("Result: %d\n",res); - printf("%o %o \n",colours[0],celldat[0]); + uint8_t location; + enum STONE_VARIANT stone; + enum PTN_PARSE_RESULT pr = parse_place(5, "Cb3", &location, &stone); + + printf("Place <%d>: stone %d at (%d,%d)\n",pr,stone,location%5,location/5); + + enum MOVE_DIRECTION direction; + uint8_t steps; + uint8_t drops[5]; + pr = parse_move(5, "c2+", &location, &direction, &steps, drops); + + printf("Move <%d>: from (%d,%d) step %d sequence [%d,%d,%d,%d,%d]\n", + pr,location%5,location/5, + steps,drops[0],drops[1],drops[2],drops[3],drops[4]); } |
