ref: f00468ec15edee73bc7d70444c705e516251f7c4
parent: b67929a37bdca7f7fd1e4671eb66f987db6273de
author: zamfofex <zamfofex@twdb.moe>
date: Fri Apr 26 00:02:05 EDT 2024
fix time management for ’moonfish_no_threads’
--- a/search.c
+++ b/search.c
@@ -212,6 +212,28 @@
int result;
int x, y;
struct moonfish_move *move, moves[32];
+#ifdef moonfish_no_threads
+ int count;
+
+ if (analysis->time >= 0)
+ {+ count = 0;
+
+ for (y = 0 ; y < 8 ; y++)
+ for (x = 0 ; x < 8 ; x++)
+ {+ moonfish_moves(&analysis->chess, moves, (x + 1) + (y + 2) * 10);
+ for (move = moves ; move->piece != moonfish_outside ; move++)
+ {+ moonfish_play(&analysis->chess, move);
+ if (moonfish_validate(&analysis->chess)) count++;
+ moonfish_unplay(&analysis->chess, move);
+ }
+ }
+
+ analysis->time /= count;
+ }
+#endif
j = 0;
--
⑨