diff options
| author | tslil <tslil@posteo.de> | 2021-01-11 01:29:39 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 5d475f9dadcac74bde8262d600e68578e91323c9 (patch) | |
| tree | 6358f2ceaee1b961b77380bc94fd92c950ea8c85 /src | |
| parent | b598a3ab9e682a826516b242a710b26e0c22389f (diff) | |
Close in principle, but there;s a bug in ct1997 &/ pptdb!
Diffstat (limited to 'src')
| -rw-r--r-- | src/ctaklm.c | 3 | ||||
| -rw-r--r-- | src/pptdb.c | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/ctaklm.c b/src/ctaklm.c index 3d4310c..346b5a5 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -4,6 +4,7 @@ #include <linenoise.h> #include <tak.h> +#include <ct1973.h> const char *blk = "\033[41m", *wht = "\033[44m"; const char *rev = "\033[7m", *und = "\033[4m", *rst = "\033[0m"; @@ -310,6 +311,8 @@ main(int argc, char **argv) { print_board(); } else if (!strncmp(line,"info",5)) { print_info(); + } else if (!strncmp(line,"eval",5)) { + printf("Valuation: %.6f\n", evaluate_black_win()); } else if (!strncmp(line,"log",3)) { puts(gamelog); } else if (!strncmp(line,"load",4)) { diff --git a/src/pptdb.c b/src/pptdb.c index 8e8285a..9722780 100644 --- a/src/pptdb.c +++ b/src/pptdb.c @@ -39,12 +39,12 @@ write_input(void) { } // Layers underneath for (int depth = 1; depth < max_depth; depth++) { + mask <<= 1; for (int k = 0; k < board_size * board_size; k++) { val = 0; if (COUNT_AT(k)>depth) val = (colours[k] & mask) ? +0.50 : -0.50; fprintf(training_fh,"%.2f,", val); } - mask <<= 1; } /* @@ -89,6 +89,11 @@ parse_line(const char *pt, const ssize_t read) { r = try_place(THE_COORDS(col,row), current_colour, stone); if (r != ACT_OK) return r; + + char buf[20]; + generate_place(board_size, THE_COORDS(col,row), stone, buf); + puts(buf); + } else if (pt[idx] == 'M') { // M [A-F][1-6] [A-F][1-6]( [1-6])+, idx+=2; @@ -119,7 +124,14 @@ parse_line(const char *pt, const ssize_t read) { if (COUNT_AT(k)>1) heights[COUNT_AT(k)]+=1; } } + + char buf[20]; + generate_move(board_size, THE_COORDS(s_col, s_row), dir, steps, drops, buf); + puts(buf); } + + if (current_colour == C_BLACK && ply > 15) puts("Here"); + // Generate training data, not too early in the game if (generate && current_colour == C_BLACK && ply > 15) { write_input(); |
