Tic Tac Toe AI banner

Tic Tac Toe AI

5 devlogs
3h 41m 29s

I built an AI-powered Tic Tac Toe game using Python and Pygame, where the computer plays perfectly using the Minimax algorithm. The project includes a clean UI, proper win/tie detection, While building it, I learned how game loops work, how AI dec…

I built an AI-powered Tic Tac Toe game using Python and Pygame, where the computer plays perfectly using the Minimax algorithm. The project includes a clean UI, proper win/tie detection, While building it, I learned how game loops work, how AI decision-making algorithms like Minimax function, and how small bugs (like generator vs list mistakes) can break logic in subtle ways. Shipping the project taught me the importance of testing edge cases, cleaning up complex code, and actually finishing and releasing a project.

Demo Repository

Loading README...

mondalpritam2010987

Shipped this project!

Hours: 0.91
Cookies: 🍪 10
Multiplier: 10.42 cookies/hr

built an AI-powered Tic Tac Toe game using Python and Pygame, where the computer plays perfectly using the Minimax algorithm. The project includes a clean UI, proper win/tie detection, and both a standalone Windows executable and a web-playable version. While building it, I learned how game loops work, how AI decision-making algorithms like Minimax function, and how small bugs (like generator vs list mistakes) can break logic in subtle ways. Shipping the project taught me the importance of testing edge cases, cleaning up complex code, and actually finishing and releasing a project.

mondalpritam2010987

I have updated the repo and now there is a windows .exe file to play the game.
Feedback is highly as it will help decide more features.

Attachment
0
mondalpritam2010987

What I done for now ->
Fully playable 3×3 Tic Tac Toe board
Player can choose to play as X or O
Clean Pygame UI
“Play Again” button to restart the game
❗ The AI can win, but the human can’t — only draw or lose
This version has -
Stable gameplay
Correct win detection
AI behaves exactly as expected
Visual feedback works perfectly

Attachment
Attachment
0