mohakapt / Minimax

The source code for the Tic-Tac-Toe playing AI that I created for the Minimax video on my YouTube channel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advanced Tic-Tac-Toe AI: A Journey from Charmander to Charizard 🐲

Project Cover

Welcome to this unique exploration of the Minimax algorithm, presented through the lens of a Tic-Tac-Toe playing program. This project was crafted as a supplementary resource for an upcoming YouTube video on my channel, where we dive deep into the intricacies of game theory and AI algorithms, using the world of Pokémon as a fun metaphor.

Table of Contents

Features

  • Minimax Algorithm: The backbone of our AI, enabling it to make optimal decisions at every turn.

  • Alpha Beta Pruning: A refinement to the Minimax algorithm that helps the program make decisions faster.

  • Bit Boards: A space-efficient method to represent the Tic-Tac-Toe board using binary representation. (Note: While bitboards are commonly used in board games like chess, a direct link for tic-tac-toe might not exist, so I'm leaving it without a link.)

  • Winning Combinations: Utilizes binary operations to efficiently check for winning conditions. This rapid evaluation ensures a faster gameplay experience.

  • Prolong When Losing Strategy: Delays the opponent's victory even when losing seems inevitable.

  • Transposition Table: Optimizes searches by remembering past states.

  • Basic Strategy: When the search tree becomes too large to be explored by Minimax in a reasonable time, this strategy helps the AI play good moves quickly. While these moves might not always be the best, they're generally very competitive.

  • Scalability: Our AI can play Tic-Tac-Toe on any board size.

Tech Stack

  • Language: Kotlin
  • Algorithm: Minimax
  • Optimizations: Alpha Beta Pruning, Bit Boards, Transposition Table

Contributions

Feel free to fork this project, submit PRs, and suggest any improvements or features you think might enhance the project.

Acknowledgements

A big shoutout to my subscribers and the community for motivating me to create this project. I hope you find it useful and learn something new from it. If you have any questions, feel free to reach out to me on Twitter.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

The source code for the Tic-Tac-Toe playing AI that I created for the Minimax video on my YouTube channel.

License:MIT License


Languages

Language:Kotlin 63.7%Language:Java 36.3%