shithub: moonfish

Download patch

ref: 35703d9178edd9dd21cbf5055cb0e07f30019c5e
parent: cf91f3a454e5640d6d35b55b4bdd1e3ba1818755
author: zamfofex <zamfofex@twdb.moe>
date: Tue Nov 14 16:55:57 EST 2023

fix time management

--- a/main.c
+++ b/main.c
@@ -74,8 +74,6 @@
 						fprintf(stderr, "%s: malformed 'go' command\n", argv[0]);
 						return 1;
 					}
-					
-					break;
 				}
 			}
 			
--- a/search.c
+++ b/search.c
@@ -214,18 +214,17 @@
 	int i;
 	int score;
 	
-	d = (our_time - their_time) / 4;
+	d = our_time * 6 / 5 - their_time;
 	if (d < 0) d = 0;
-	if (d > 20) d = 20;
 	
 	i = 3;
 	t = time(NULL);
 	score = moonfish_best_move_depth(ctx, best_move, i);
-	t = time(NULL) - t + 4;
+	t = time(NULL) - t + 1;
 	
 	for (;;)
 	{
-		t *= 32;
+		t *= 24;
 		if (t > d) break;
 		i++;
 		if (i >= 8) break;
--