💡 Inspiration

Artificial intelligence has truly changed our world. From travel navigation to smart home devices, drones to facial recognition software, AI is becoming more applicable by the year.

I wanted to begin my exposure to AI through coding an algorithm that builds the basis for many different types of games, such as chess and Othello.

🔍 What it does

A player can test their Tic-Tac-Toe prowess against an AI, but will inevitably lose over and over again.

⚙️ How it was built

I used Python to code the algorithm and Pygame specifically to code the game display.

🚧 Challenges I ran into

It was hard to know where to begin coding, Although I knew the process in programming the algorithm, I was missing the components to shape my algorithm around. Also, creating a function to determine the winner of the game caused me some trouble, as the recursive functions kept crashing.

✔️ Accomplishments that I'm proud of

  • Being able to code an AI algorithm within the time frame of Hack The Ridge
  • The successful implementation of the adversarial search algorithm minimax

📚 What I learned

Throughout Hack The Ridge, I learned the basics of search algorithms, working with different models, states, and agents to create a functioning AI for Tic-Tac-Toe. Furthermore, it helped me refine my knowledge of python classes and recursive functions, forcing me to think from different perspectives.

🔭 What's next for Tic-Tac-Toe, But You Can't Win!

If I continue with this project, I will change the algorithm slightly to improve the speed of the AI, most likely by implementing an alpha-beta pruning search. Being able to finish this project has inspired me to pursue future AI-based projects, such as "Minesweeper, but the AI does it for you".

Built With

Share this project:

Updates