Coder Social home page Coder Social logo

mishkatit / tic-tac-toe-using-java Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17 KB

This repo contains a Java-based Tic Tac Toe game featuring a graphical user interface (GUI) for two players.

Home Page: https://github.com/MishkatIT/tic-tac-toe-using-java

License: MIT License

Java 100.00%
board-game graphical-user-interface grid-game java-application java-game java-gui java-gui-application java-project multiplayer-game tic-tac-toe

tic-tac-toe-using-java's Introduction

Tic Tac Toe Game

Overview

This Java-based Tic Tac Toe game provides a graphical user interface (GUI) for two players to engage in the classic Tic Tac Toe experience. Players take turns marking the cells of a 3x3 grid, aiming to achieve three in a row either horizontally, vertically, or diagonally.

How to Play

  1. Run the Game:

    • Compile the Java files using a Java compiler:
      javac tic_tac_toe/*.java
    • Run the main class:
      java tic_tac_toe.Main
  2. Enter Player Names:

    • Upon launching the game, players are prompted to enter their names.
    • The names are obtained through input dialogs, ensuring non-empty entries.
  3. Gameplay:

    • Players click on the grid cells to make their moves.
    • The game alternates turns between Player 1 (X) and Player 2 (O).
  4. Winning and Draw:

    • The game declares a winner when a player achieves three in a row.
    • If all cells are filled without a winner, the game recognizes a draw.
  5. Play Again:

    • After each game, players are prompted to play again or exit the application.

Features

  • Graphical User Interface (GUI):
    • The game employs Java Swing for a user-friendly and visually appealing interface.
  • Dynamic Turn Indicator:
    • A status label at the bottom dynamically indicates whose turn it is (X or O).
  • Winner Declaration:
    • The game declares the winner and prompts for a new game or exit.
  • Draw Handling:
    • A draw is recognized when all cells are filled without a winner.

How to Contribute

Contributions to enhance features, fix issues, or optimize code are welcome. Fork the repository, make your changes, and submit a pull request.

Contributors

  • [Mishkatul_Islam]

Enjoy playing Tic Tac Toe!

tic-tac-toe-using-java's People

Contributors

mishkatit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.