/TicTacToe-AI

A simple AI for TicTacToe with Alpha-Beta pruning and binary encoding for the board

Primary LanguageJavaBSD 2-Clause "Simplified" LicenseBSD-2-Clause

TicTacToeAI

License Made With Love Java CI with Maven Coverity Quality Gate Status CodeFactor Codacy Badge DeepSource Language grade: Java BCH compliance GuardRails badge

This is a simple AI for TicTacToe. There is no real challenge in constructing an AI for a game like TicTacToe. The purpose of this project was the binary encoding of the board and an as efficient as possible MiniMax. The algorithm is implemented with and without Alpha-Beta pruning.

Results with MiniMax on my machine:

MiniMax runtime results

Alpha-Beta:

Alpha-Beta runtime results

My machine:
Debian 11
Intel i5-8250U @ 1.60 GHz
8 GB DDR4-2400 SDRAM