aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-01-12 21:47:58 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commitbea769b801893a6841902b91e06f495ef9622dc1 (patch)
tree7b0f94b7e2fb8039c5a13fb4bba5cd86acadf1aa
parent4ad67ac92de26b12cbf6cd671de689e7d11ebebb (diff)
Have to account for CPS
-rw-r--r--include/ct1975.c7
-rw-r--r--src/ctaklm.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/include/ct1975.c b/include/ct1975.c
index c0256eb..5cb47e9 100644
--- a/include/ct1975.c
+++ b/include/ct1975.c
@@ -99,7 +99,7 @@ ct1975_evaluate_black_win(void) {
char ct1975_ptn[9];
float ct1975_optimal;
-#define BETTER(t,o) ((current_colour == C_BLACK && (t) > (o)) || (current_colour == C_WHITE && (t) < (o)))
+#define BETTER(t,o) ((ply>2 && ((current_colour == C_BLACK && (t) > (o)) || (current_colour == C_WHITE && (t) < (o)))) || (ply<3 && ((current_colour == C_BLACK && (o) > (t)) || (current_colour == C_WHITE && (o) < (t)))))
void
ct1975_generate_ptn(void display_progress(void)) {
@@ -111,7 +111,10 @@ ct1975_generate_ptn(void display_progress(void)) {
black_count_backup = black_count;
// 1.0 is a `certain' black win, 0.0 is a `certain' white win.
- ct1975_optimal = (current_colour == C_BLACK) ? 0.0 : 1.0;
+ if (ply > 2)
+ ct1975_optimal = (current_colour == C_BLACK) ? 0.0 : 1.0;
+ else
+ ct1975_optimal = (current_colour == C_BLACK) ? 0.1 : 0.0;
// Step across the board
for (uint8_t row = 0; row < board_size; row++) {
diff --git a/src/ctaklm.c b/src/ctaklm.c
index 13326f9..aafc0c3 100644
--- a/src/ctaklm.c
+++ b/src/ctaklm.c
@@ -357,7 +357,7 @@ main(int argc, char **argv) {
}
} else {
int r = handle_turn(line);
- if (r == EXIT_SUCCESS) {
+ if (r == EXIT_SUCCESS && won == 0xFF) {
fputs("Thinking [", stdout);
ct1975_generate_ptn(&dot);
printf("] Result: %s (%.3f)\n",