The inspiration for this project was AlphaZero / AlphaGo by Google! I wanted to create an AI to play Connect 4, but with a twist from AlphaZero. I wanted the AI to be imperfect, to simulate playing against a human player who makes errors and you can win against sometimes! After all, who enjoys losing to a computer every time?

What it does

This AI looks through the next 7 moves and calculates the expected utility of each move by predicting the game's eventual outcome through a machine learning model. Finally, it takes the move leading to the best future, assuming the opponent (the human!) plays optimally.

How we built it

This was built using Tangram and a public dataset of over 350,000 Connect 4 games found on Kaggle.

Challenges we ran into

Some issues I ran into was the model not being intelligent enough (making random moves despite me having 3 in a row), developing the game itself and the rules to ensure if you select a column, it goes in the proper spot, and finally, optimizing it so that the AI acts in an appropriate amount of time.

Accomplishments that we're proud of

Creating this AI in such a short amount of time and it having a decent level of intelligence!

What we learned

How to quickly train, test, and deploy models using Tangram, as well as how to tune a minimax algorithm to make an AI chase a win while preventing a loss!

What's next for BetaZero

Improving the UI and hosting it on a website for others to play against!

Built With

Share this project: