A Java-based 5×5 Tic Tac Toe game developed using Java Swing, JDBC, and MySQL. TicArena AI Edition features secure user authentication, persistent player statistics, a leaderboard system, and a smart AI opponent capable of detecting winning opportunities and blocking player threats.
- User Registration System
- Secure Login Functionality
- MySQL Database Integration
- Persistent User Records
- 5×5 Tic Tac Toe Board
- Turn-Based Gameplay
- Win Detection System
- Draw Detection System
- Restart Game Functionality
- Back-to-Lobby Navigation
The AI follows a decision-making strategy:
- Checks for a winning move and plays it immediately.
- Detects and blocks potential player wins.
- Chooses a valid move when no immediate threat exists.
This creates a challenging gameplay experience while maintaining efficient performance.
- Win Tracking
- Loss Tracking
- Draw Tracking
- Score Calculation
- Dynamic Leaderboard
- Persistent Statistics Stored in MySQL
- Java
- Java Swing
- JDBC
- MySQL
- Git
- GitHub
| Column | Description |
|---|---|
| id | Unique User ID |
| username | Player Username |
| password | User Password |
| score | Total Score |
| wins | Number of Wins |
| losses | Number of Losses |
| draws | Number of Draws |
| created_at | Account Creation Time |
TicArena
│
├── gui
│ ├── WelcomeFrame
│ ├── LoginFrame
│ ├── RegisterFrame
│ ├── LobbyFrame
│ ├── GameFrame
│ └── LeaderboardFrame
│
├── database
│ ├── DBConnection
│ └── UserDAO
│
└── main
└── Main
- Clone the repository:
git clone <repository-url>- Create the MySQL database.
CREATE DATABASE ticarena;- Configure database credentials in:
src/database/DBConnection.java
- Compile the project.
javac -cp "lib/*" -d bin src/database/*.java src/gui/*.java src/main/*.java- Run the application.
java -cp "bin;lib/*" main.MainThis project helped strengthen understanding of:
- Object-Oriented Programming (OOP)
- Java Swing GUI Development
- JDBC Database Connectivity
- SQL Query Handling
- Event-Driven Programming
- Game Logic Design
- Git & GitHub Version Control
- Multiple AI Difficulty Levels
- Online Multiplayer Support
- Friend Match System
- Player Profiles
- Sound Effects and Animations
- Advanced Analytics Dashboard
Md Azhan Sarfaraz B.Tech Computer Science & Engineering Passionate about Software Development, Artificial Intelligence, and Problem Solving.





