diff options
| author | tslil clingman <tslil@posteo.de> | 2023-01-21 19:30:45 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 0e81096d5ecb6027814e7aae10b461e774f96407 (patch) | |
| tree | 6cedfe4b3fad3770a5210f5e5d5ad205c17f4b0f /include/tps.c | |
| parent | cb2b78ced27fc7996ed11c3450f69138d7d1b61f (diff) | |
might as well enable size 6
Same network architecture, same training principle. Predictably this is
too slow.
Also statically allocate state in driver programmes.
Diffstat (limited to 'include/tps.c')
| -rw-r--r-- | include/tps.c | 10 |
1 files changed, 5 insertions, 5 deletions
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++) { |
