diff options
| author | tslil <tslil@posteo.de> | 2021-01-09 17:16:13 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 81948394f575f682700edee57626f784f6397dcc (patch) | |
| tree | c5e235544655c06a809a2dc94050587144aa15f4 /src/pptdb.c | |
| parent | 08db5599e3a9ba94b26916a88002361606a98353 (diff) | |
Two inputs to model, stacks and flat counts
Diffstat (limited to 'src/pptdb.c')
| -rw-r--r-- | src/pptdb.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/pptdb.c b/src/pptdb.c index e681735..8e8285a 100644 --- a/src/pptdb.c +++ b/src/pptdb.c @@ -17,12 +17,11 @@ write_input(void) { /* fprintf(training_fh,"%d,",current_colour == C_BLACK); */ // Two numbers for flats remaining - /* - * fprintf(training_fh,"%.6f,%.6f,", - * (float)(white_count & 127)/max_flats, - * (float)(black_count & 127)/max_flats); - */ + fprintf(training_fh,"%.8f,%.8f,", + (float)(white_count & 127)/max_flats, + (float)(black_count & 127)/max_flats); + // Top layer of stacks is handled differently to indicate stone type float val; uint16_t mask = 1; for (int k = 0; k < board_size * board_size; k++) { @@ -38,7 +37,7 @@ write_input(void) { } fprintf(training_fh,"%.2f,", val); } - + // Layers underneath for (int depth = 1; depth < max_depth; depth++) { for (int k = 0; k < board_size * board_size; k++) { val = 0; @@ -48,7 +47,6 @@ write_input(void) { mask <<= 1; } - /* * float t; * for (int k = 0; k < board_size * board_size; k++) { @@ -165,19 +163,12 @@ main(int argc, char **argv) { if (training_fh == NULL) exit(EXIT_FAILURE); // Write header - /* fputs("\"Player\",\"White flats\",\"Black flats\",",training_fh); */ + fputs("\"White flats\",\"Black flats\",",training_fh); for (int depth = 0; depth < max_depth; depth++) { for (int k = 0; k < size*size; k++) { fprintf(training_fh,"\"Stack %d %d\",",depth,k); } } - - /* - * for (int k = 0; k < size*size; k++) { - * fprintf(training_fh,"\"BT %d\",",k); - * } - */ - fputs("\"White win\",\"Black win\"\n",training_fh); } else generate=0; |
