Skip to content

A simple two-player console-based Tic-Tac-Toe game written in Java. Includes input validation, win detection, and a turn-based system. Players take turns entering their moves, and the game announces the winner or a draw. Ideal for beginners learning Java basics and game logic.

License

Notifications You must be signed in to change notification settings

nurulashraf/java-tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Java Tic-Tac-Toe

A simple two-player console-based Tic-Tac-Toe game written in Java. The game includes input validation, win detection, and a turn-based system. Players take turns entering their moves, and the game announces the winner or a draw. Ideal for beginners learning Java basics and game logic.

Features

  • Two-player turn-based gameplay
  • Input validation to prevent invalid moves
  • Automatic win and draw detection
  • Simple console-based UI

Installation

  1. Clone the repository:
    git clone https://github.com/nurulashraf/java-tic-tac-toe.git
  2. Navigate to the project directory:
    cd java-tic-tac-toe
  3. Compile the Java code:
    javac src/TicTacToe.java
  4. Run the game:
    java -cp src tictactoe.TicTacToe

Usage

  • Run the program and follow the on-screen instructions.
  • Players take turns inputting row and column numbers (0-2) to place their mark (X or O).
  • The game will announce the winner or a draw when applicable.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A simple two-player console-based Tic-Tac-Toe game written in Java. Includes input validation, win detection, and a turn-based system. Players take turns entering their moves, and the game announces the winner or a draw. Ideal for beginners learning Java basics and game logic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages