Skip to content

A Tic Tac Toe game in Python (Tkinter) and Java (Swing) with single-player AI modes: Easy (Random), Medium (Defensive), and Hard (Minimax). Includes a two-player mode for playing with friends, offering engaging gameplay and logical AI strategies for challenging matches.

Notifications You must be signed in to change notification settings

HexCrystal69/Tic_Tac_Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

A cross-platform Tic Tac Toe game implemented in Python (Tkinter) and Java (Swing). The game features single-player AI modes and a two-player mode for playing with friends.

Features

Common Features:

  • Two-Player Mode: Play with a friend on the same device.
  • Single-Player AI Modes:
    • Easy: AI plays randomly.
    • Medium: AI blocks the player or tries to win.
    • Hard: AI uses the Minimax algorithm for optimal moves.

Platforms:

  • Python: Runs using Tkinter for the GUI.
  • Java: Runs using Swing for the GUI.

Installation

Python:

  1. Clone the repository.
  2. Install the required packages:
    pip install tkinter
  3. Run the Python script:
    python TicTacToe.py

Java:

  1. Clone the repository.
  2. Compile the Java code:
    javac TicTacToe.java
  3. Run the Java program:
    java TicTacToe

Usage

  1. Choose the difficulty level for the AI: Easy, Medium, or Hard.
  2. Select whether you want to play with a friend or against the AI.
  3. Play the game and enjoy!
    • If you win, you will be notified with a "You Win!" message.
    • If the AI wins, the message will read "You Lose!".
    • A draw will be notified as "It's a Draw!".

Screenshots

| Python Version (Tkinter)

| Screenshot (45) | Screenshot (46)


| Java Version (Java Swing)

| Screenshot (47) | Screenshot (48)

About

A Tic Tac Toe game in Python (Tkinter) and Java (Swing) with single-player AI modes: Easy (Random), Medium (Defensive), and Hard (Minimax). Includes a two-player mode for playing with friends, offering engaging gameplay and logical AI strategies for challenging matches.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published