M src/engine.c => src/engine.c +3 -0
@@ 99,6 99,9 @@ int eval_board(Board board, State player)
int max_score = -2;
for (size_t i = 0; i < legal_moves_size; ++i) {
int score = eval_move(board, player, legal_moves[i]);
+ /* if we see a score of 1 we can stop looking */
+ if (score == 1)
+ return 1;
if (score > max_score)
max_score = score;
}
M src/main.c => src/main.c +2 -1
@@ 4,6 4,7 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#define FONT_SIZE 72
#define PIECE_FONT_SIZE 200
@@ 133,7 134,7 @@ int main(void)
SetTargetFPS(60);
/* seed rng */
- srand(GetTime());
+ srand(time(NULL));
while (!WindowShouldClose()) {
State winner = check_winner(board);