shithub: moonfish

Download patch

ref: 5fa35da9ac1115571a862eea4e08c72cd5eda4bb
parent: d21a86fe75905c8e2cd2f154bb55f9539e1f6a6f
author: zamfofex <zamfofex@twdb.moe>
date: Sun Nov 19 04:18:42 EST 2023

return early when only one move is available

--- a/search.c
+++ b/search.c
@@ -109,6 +109,12 @@
 		while (moves->piece != moonfish_outside) moves++;
 	}
 	
+	if (moves - move_array == 1)
+	{
+		*best_move = *move_array;
+		return 0;
+	}
+	
 	moves = move_array;
 	i = 0;
 	for (;;)
--