Skip to content

Tic Tac Toe game with GUI using Tkinter, AI option utilizing minimax algorithm and alpha-beta pruning

Notifications You must be signed in to change notification settings

NathanKong06/TicTacToe-Python

Repository files navigation

Introduction

This project contains three implementations of the classic Tic Tac Toe game in Python, utilizing the tkinter library for the graphical user interface (GUI). Each implementation offers a different gameplay experience:

1. 2-Player Tic Tac Toe (tictactoe-two-players.py):

  • Play against a friend locally on the same computer.

2. Tic Tac Toe vs. Random Bot (tictactoe-random.py):

  • Play against a bot that makes random moves.

3. Tic Tac Toe vs. AI using Minimax and Alpha-Beta Pruning (tictactoe-ai.py):

  • Challenge an AI opponent that uses the Minimax algorithm with Alpha-Beta pruning for optimal moves. Good luck trying to beat it.

Dependencies

  • tkinter: Comes natively included with standard installions of Python
  • Pillow: pip install Pillow
  • Random: Built in module in Python

Usage

1. 2-Player Tic Tac Toe

  • Player 1 starts as 'X' and Player 2 starts as 'O'
  • Click on an empty cell to make a move
  • The game will show a win screen when a player wins or a tie screen if a tie occurs
  • Closing the win or tie screen resets the board and tracks the winner's score

2. Tic Tac Toe vs Random Bot

  • You play as 'X' and the bot plays as 'O'
  • Click on an empty cell to make a move

3. Tic Tac Toe vs AI Bot

  • You play as 'X' and the bot plays as 'O'
  • Click on an empty cell to make a move

About

Tic Tac Toe game with GUI using Tkinter, AI option utilizing minimax algorithm and alpha-beta pruning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages