Skip to content

ankitbista483/Tic-tac-RL

Repository files navigation

Tic-Tac-Toe with Q-Learning AI

A simple Tic-Tac-Toe game implemented in Python using Tkinter for the GUI and Q-Learning for an AI opponent.

🚀 Features

Human vs. AI Mode (AI uses Q-learning)

Graphical User Interface (GUI) built with Tkinter

AI Learns from Past Games (Q-table-based learning)

📦 Installation

Prerequisites

Ensure you have Python installed. You can download it from python.org.

Clone the repository and navigate to the project directory:

git clone https://github.com/ankitbista483/Tic-tac-RL.git
cd Tic-tac-RL

Install Dependencies

pip install -r requirements.txt

▶️ Usage

Run the game with:

python main.py

Run the game with Tkinter:

python play_game_gui.py

🎮 How to Play

Run the script using python main.py.

Click on the cells to make a move.

The AI will take its turn if playing against the computer.

The game announces the winner or a draw.

🧠 How the AI Works

The AI is implemented using Q-learning, a reinforcement learning algorithm. It learns from past games by updating a Q-table, which stores the best moves for different board states.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages