Skip to content

About

Java Console Tic Tac Toe Game

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🎮 Tic Tac Toe (Java Console Game)

A simple 2-player Tic Tac Toe game built using Java. This project is a great way to understand basic programming concepts like arrays, loops, conditionals, and method design.


🚀 Features

  • 🧑‍🤝‍🧑 Two-player gameplay (Player X vs Player O)
  • ✅ Input validation (prevents overwriting moves)
  • 🧠 Win detection (rows, columns, diagonals)
  • 🤝 Draw detection
  • 🖥️ Clean console-based UI

🛠️ Tech Used

  • Java (Core Java)
  • Scanner for user input
  • Arrays for board representation

📂 Project Structure

TicTacToe.java

▶️ How to Run

  1. Clone the repository:
git clone https://github.com/your-username/tic-tac-toe-java.git
  1. Navigate to the project folder:
cd tic-tac-toe-java
  1. Compile the Java file:
javac TicTacToe.java
  1. Run the program:
java TicTacToe

🎯 How to Play

  • The game is played on a 3x3 grid.
  • Players take turns entering row and column values.
  • Example input:
0 0  → Top-left corner
1 1  → Center
2 2  → Bottom-right
  • First player to align 3 marks (row/column/diagonal) wins.
  • If all 9 moves are filled with no winner → Draw.

💡 Concepts Practiced

  • 2D Arrays
  • Loops and Conditionals
  • Method Decomposition
  • Game Logic Design
  • Basic Input Handling

🔮 Future Improvements

  • Add GUI (Java Swing / JavaFX)
  • Add Single Player Mode (AI)
  • Improve UI with better formatting
  • Add replay option

🙌 Contributing

Feel free to fork this repo, improve it, and create a pull request!


📬 Contact

If you have any suggestions or feedback, feel free to reach out!


⭐ If you like this project, consider giving it a star!

About

Java Console Tic Tac Toe Game

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages