This is a classic Tic-Tac-Toe game implemented in Java, where two players can compete on a 3x3 grid. The project aims to showcase basic concepts of graphical interface, events, game logic, and score tracking.
-
Graphical Interface: Uses the Swing library to create a user-friendly and interactive graphical interface for the game.
-
Alternate Players: "X" and "O" players alternate their moves automatically.
-
Turn Message: Displays which player's turn it is to make a move.
-
Victory Detection: Automatically checks if any player has won by completing a row, column, or diagonal.
-
Draw Message: Displays a message and restarts the game if no more moves are available.
-
Score Tracking: Keeps track of players' scores during matches.
-
Game Reset: Allows resetting the game after a match is concluded.
-
Run the Java program to start the game.
-
Click on empty cells to make your moves alternately as "X" and "O".
-
The game will indicate each player's turn and automatically check for a win.
-
If no one wins and all cells are filled, the game will be declared a draw.
-
Each player's score is updated with each win and draw.
-
Click the "Reset" ("Let´s play again!") button to start a new game.
This project can be used as a foundation for learning basic Java programming and game development concepts. If you wish to contribute:
-
Fork this repository.
-
Clone the fork to your local machine.
-
Explore the code, make improvements, and add new features.
-
Make a pull request to share your changes.
This project was inspired by the interest in learning and teaching Java programming in a practical and enjoyable way. We thank all contributors who have contributed to the development of this Tic-Tac-Toe game.
This project is licensed under the MIT License. See the LICENSE
file for more details.
If you have any questions or suggestions, feel free to get in touch via the issues in this repository.
We hope you have fun playing the Java Tic-Tac-Toe game. This project can also serve as a starting point for creating more complex games and diving deeper into Java programming. Have a great time!