Giter Site home page Giter Site logo

tictactoe's Introduction

TicTacToe

Java Tic-Tac-Toe Game

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.

Implemented Features

  1. Graphical Interface: Uses the Swing library to create a user-friendly and interactive graphical interface for the game.

  2. Alternate Players: "X" and "O" players alternate their moves automatically.

  3. Turn Message: Displays which player's turn it is to make a move.

  4. Victory Detection: Automatically checks if any player has won by completing a row, column, or diagonal.

  5. Draw Message: Displays a message and restarts the game if no more moves are available.

  6. Score Tracking: Keeps track of players' scores during matches.

  7. Game Reset: Allows resetting the game after a match is concluded.

How to Play

  1. Run the Java program to start the game.

  2. Click on empty cells to make your moves alternately as "X" and "O".

  3. The game will indicate each player's turn and automatically check for a win.

  4. If no one wins and all cells are filled, the game will be declared a draw.

  5. Each player's score is updated with each win and draw.

  6. Click the "Reset" ("Let´s play again!") button to start a new game.

How to Contribute

This project can be used as a foundation for learning basic Java programming and game development concepts. If you wish to contribute:

  1. Fork this repository.

  2. Clone the fork to your local machine.

  3. Explore the code, make improvements, and add new features.

  4. Make a pull request to share your changes.

Acknowledgments

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.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

If you have any questions or suggestions, feel free to get in touch via the issues in this repository.

Enjoy the Game!

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!

tictactoe's People

Contributors

camicerqueira 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.