Janani-Balasooriya / Java-Beginner-Projects

Explore a variety of simple, hands-on Java projects ideal for beginners. Sharpen your coding skills while creating command-line applications, games, and practical tools in Java. Perfect for those new to programming or looking to learn Java.
24 stars 21 forks source link

Create TicTacToeGame.java #14

Closed Kaloioanness closed 1 year ago

Kaloioanness commented 1 year ago

Project Structure: Main Class (TicTacToeGame) - managing the game's logic, GUI components, player turns, and AI moves. It implements the ActionListener interface to handle button clicks. Grid (2D Array of Buttons): The 3x3 grid is represented by a 2D array of buttons, where each button corresponds to a cell in the Tic-Tac-Toe grid. Game Logic Methods: These methods handle core game logic, including checking for wins, draws, and enabling or disabling buttons based on player moves. The project includes a restart button that allows players to start a new game without closing the application.