Tic-Tac-Toe-AI-Game

Tic Tac Toe Game

Overview

This project contains two versions of the classic Tic Tac Toe game: a console-based version and a graphical version using JavaFX. The console version allows two players to play Tic Tac Toe in a terminal, while the JavaFX version provides a graphical interface with AI for playing against the computer.

Features

Prerequisites

Setup and Installation

  1. JavaFX SDK: Download the JavaFX SDK from OpenJFX and extract it to a known directory if you plan to run the JavaFX version.
  2. Clone the Repository: Use git clone <repository-url> to clone this repository to your local machine.

Running the Applications

Console Version

  1. Navigate to the directory containing the TicTacToe.java file.
  2. Compile the Java file using javac TicTacToe.java.
  3. Run the compiled class with java TicTacToe.
  4. Follow the on-screen instructions to play the game.

JavaFX Version

  1. Ensure the JavaFX SDK is correctly set up in your IDE or on your system.
  2. Compile the TicTacToeFX.java file, making sure to include the JavaFX libraries in your classpath.
  3. Run the compiled class with the necessary VM options to include the JavaFX modules: ``` –module-path “path/to/javafx-sdk/lib” –add-modules javafx.controls,javafx.fxml

  4. Follow the graphical interface to play against the AI.

How to Play

Console Version

JavaFX Version

Contributing

Contributions to enhance the games, add new features, or improve the AI algorithm are welcome. Please fork the repository, make your changes, and submit a pull request with a detailed description of your improvements.


Created with ❤️ in 2023 by Son Nguyen. All rights reserved.