From 0e81096d5ecb6027814e7aae10b461e774f96407 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sat, 21 Jan 2023 19:30:45 +0100 Subject: might as well enable size 6 Same network architecture, same training principle. Predictably this is too slow. Also statically allocate state in driver programmes. --- include/tps.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/tps.c') diff --git a/include/tps.c b/include/tps.c index ad0fe21..eaf2a49 100644 --- a/include/tps.c +++ b/include/tps.c @@ -76,7 +76,7 @@ enum TPS_RESULT load_tps(tak_state_p state, char *tps) { break; } default: { - const int l = THE_COORDS(state->board_size, col, row); + const int l = THE_COORDS(state->board_size, col, row); uint8_t num_read = 0, reading = 1; // Read in a stack of colours, optionally terminated by an S // or C to change the top stone type @@ -121,7 +121,7 @@ enum TPS_RESULT load_tps(tak_state_p state, char *tps) { } case 'S': { // Have we already read a stone type? - if (STONE_AT(state, l) != STONE_FLAT) + if (STONE_AT(state, l) != STONE_FLAT) return TPS_INVALID; state->celldat[l] |= STONE_STANDING; tps++; @@ -129,7 +129,7 @@ enum TPS_RESULT load_tps(tak_state_p state, char *tps) { break; } case 'C': { - if (STONE_AT(state, l) != STONE_FLAT) + if (STONE_AT(state, l) != STONE_FLAT) return TPS_INVALID; state->celldat[l] |= STONE_CAPSTONE; tps++; @@ -207,8 +207,8 @@ void generate_tps(tak_state_p state, char *out_tps) { for (int8_t row = state->board_size - 1; row >= 0; row--) { for (int8_t col = 0; col < state->board_size; col++) { - const int8_t l = THE_COORDS(state->board_size, col, row); - const uint8_t count = COUNT_AT(state, l); + const int8_t l = THE_COORDS(state->board_size, col, row); + const uint8_t count = COUNT_AT(state, l); if (count) { colour_stack_t c = state->colours[l], s = 1 << (count - 1); for (int k = 0; k < count; k++, s >>= 1, out_tps++) { -- cgit v1.2.3