
Tic-Tac-Toe using minimax algorithm – Java
This project is a Java-based implementation of the classic Tic-Tac-Toe game. It allows users to play either against another player or against the computer, which uses the Minimax algorithm to make intelligent decisions.
Table Of Content
Overview
Tic-Tac-Toe is a two-player strategy game where players take turns placing Xs and Os on a 3×3 grid. The objective is to be the first to align three of your symbols in a row—horizontally, vertically, or diagonally.
Minimax Algorithm
When playing against the computer, the game uses the Minimax algorithm to determine its moves. Minimax is a decision-making algorithm that explores all possible future moves to find the most optimal one. It assumes both players play perfectly and chooses moves that minimize the possible loss or maximize the potential gain.
Development
The project was developed using NetBeans, a popular Integrated Development Environment (IDE) for Java applications. The code is written in Java, following standard conventions to ensure readability and maintainability.
How to Run the Game
- Clone the repository to your local machine.
- Open the project in NetBeans.
- Compile the code if necessary.
- Run the main class to start the game.