/Tic-Tac-Toe-AI

The classic Tic Tac Toe game, now with three AI levels!

Primary LanguagePython

Tic-Tac-Toe AI

The classic Tic Tac Toe game, with three different AI levels. Play with CPU or watch them fight for your own pleasure!

This project makes use of the following algorithms:

  • minmax (with Recursion)

Application Features

  • Usage: run tictactoe.py and input command "start [user/easy/medium/hard] [user/easy/medium/hard]".
  • Easy difficulty just makes CPU pick a random empty cell to place its mark.
  • Medium difficulty forces the CPU to make a winning move, or block a player's winning move if able.
  • Hard difficulty is impossible to win, thanks to the Minmax algorithm that calculates all possible outcomes for each move and acts accordingly.
  • To watch two bots fight it out, simply write "start hard hard" or "start hard medium" or any combination you want!

This project is part of the JetBrains Academy Python Developer Plan