Check out the Jupyter Notebook on Google Colab here:
https://colab.research.google.com/drive/1DZ_zJUzhVx_IRU3zdpX8cQdQ7YQBW2qT?usp=sharin
I designed an AI to play the Game Connect Four using min-max search tree with alpha-beta pruning.

The AI uses a combination of two heuristics. First, the number of remaining Four-in-a-Rows left on the board is calculated for each player and subtracted from each other. Then that number is divided by 100 and returned. We’ll call this the Basic Calculate Cost method. It is divided by 100 as a normalizing effect as the returned value is added to the second heuristic. This division was the result of trial and error and produced the best results
The second heuristic involves a poor implementation of Monte Carlo Simulation. Random games are played out from the current board state and the number of wins divided by number of games is returned. We’ll call this the Poor Monte Carlo Simulation. It is ‘poor’ because the number of random playouts is only 11, this is to save time. More efficient playout methods could have been implemented. However, despite the low number of random playouts the returned results proved extremely promising. AI’s only utilizing this Poor Monte Carlo Simulation beat out AI’s using only the Basic Calculate Cost method. AI’s which utilized both cost heuristics proved to be even more successful. The final cost function is:
Cost = Poor Monte Carlo Simulation + Basic Calculate Cost
= (number of wins/11) + ((Remaining 4 in a row P1 – Remaining 4 in a row P2)/100)