We wanted to make an AI that could beat us at a game.

What it does

There are two aspects to our project: There was producing the game itself, where we would code a GUI along with the necessary back-end to make the game run. Alongside the game itself, there was the AI that would play the game.

How we built it

We used the Pygame module to create a GUI for the game. Then we coded the AI using the MiniMax algorithm with alpha-beta pruning to pick the best possible move per turn.

Challenges we ran into

The biggest challenge we had was creating the game tree that the AI would use to make the best possible moves. We understood that we needed a recursive algorithm to create each node (each board state) and that our AI would need to choose the best possible move based on what moves we thought would produce the best chance at winning.

Accomplishments that we're proud of

We're proud that we tried! As this is the first hackathon for most of our teammates, we're proud that we were able to create the gameboard with PyGame and a start to our game tree.

What we learned

We learned that this was quite an ambitious project for 24 hours but in terms of code, some cool things we learned about were the MiniMax algorithm (a way to tell the AI which moves were better than others) and alpha-beta pruning (a way to save computational time by pruning off parts of the game tree)

What's next for Connect 4 - AI

Completing the project!

Built With

Share this project: