Skip to content

Tic-Tac-Toe (or Noughts and Crosses) with a graphical user interface (GUI) using the Java Swing library. This code allows two players to take turns playing the game

Notifications You must be signed in to change notification settings

Proushoth/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Tic-Tac-Toe Java Program Introduction This is a Java program for a simple command-line Tic-Tac-Toe game. The game is played on an 800x800 graphical user interface (GUI) using Java's Swing library. The program allows two players to take turns marking "X" and "O" on a 3x3 grid until one player wins or the game ends in a draw.

Features Graphical user interface (GUI) using Java Swing. Players can take turns to make their moves. The game declares a winner when one player gets three in a row (horizontally, vertically, or diagonally) or ends in a draw if all cells are filled. Prerequisites To run this program, you need to have Java installed on your computer.

How to Play The game starts with "X" as the first player. Players take turns clicking on empty cells to place their symbol. The game will declare a winner if one player gets three symbols in a row horizontally, vertically, or diagonally. If all cells are filled, and there is no winner, the game will end in a draw.

Additional Information The program uses event listeners to handle user actions, such as button clicks. The game logic is implemented in the actionPerformed method. When the game ends, it displays a message declaring the winner or a draw. You can close the game window to exit the program.

About

Tic-Tac-Toe (or Noughts and Crosses) with a graphical user interface (GUI) using the Java Swing library. This code allows two players to take turns playing the game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages