Added threading, optimizations

This commit is contained in:
2022-04-18 22:27:16 -04:00
parent cbdf377c86
commit 66195867eb
6 changed files with 385 additions and 147 deletions
+5 -2
View File
@@ -1,5 +1,7 @@
#pragma once
#include <mutex>
#include "SDL2/SDL.h"
#include "board.hpp"
@@ -18,8 +20,9 @@ private:
void process_click(int x, int y);
void do_ai_move();
int minimax(Board current_board, int depth, int a, int b, bool maximizing);
int board_heuristic(Board current_board);
static int minimax(Board current_board, int depth, int max_depth, int a, int b, bool maximizing);
static void minimax_evaluate(std::mutex& mut_result_check, Board current_board, int x, int y, int depth, int max_depth, int& best_move_weight, int& a, int& b, bool& a_eject, bool& b_eject, bool maximizing);
static int board_heuristic(Board current_board);
SDL_Window* window;
SDL_Surface* surface;