Giter Club home page Giter Club logo

tictactoe-java-project's Introduction

forthebadgeforthebadge forthebadge forthebadge forthebadge

Tic Tac Toe

Tic-tac-toe has been a part of almost everyoneโ€™s childhood. While the game of tic-tac-toe is really old, dating back to ancient Egyptians at around 1300 B.C., the underlying principles of the game have endured the test of time. The game seems simple enough. Two opponents, one using X and one using O, use a 3 x 3 grid to mark their symbols. The first one to get all three of his/her symbols in a row, whether itโ€™s diagonal, horizontal, or vertical, wins the game.


Overview

single player demo

This project is a simple Tic-Tac-Toe online game developed as a final project for the java course. The game is developed using java and javafx utilizing socket programming, multi-threading and JSON data transmission to allow for a multiplayer online game with other features such as ingame Chat and much more.


Table of Contents


๐Ÿ•น๏ธ Main Features

Server-Side

  • Live list of players status and score.
  • Load and logs monitoring through a simple GUI.
  • Start and stop the server with a simple click of a button.
  • Passwords are encrypted before being saved in the database.

Client-Side

  • Play in single mode vs. computer in two levels of difficulty, implemented using minimax algorithm.
  • A live list of the status and score of other players in the game.
  • Chat with the opponent inside the game.
  • Save the game to continue playing it later.
  • User-friendly GUI.

๐Ÿ’ก Game Features

  • A score metrics for each player that is calculated upon winning or losing.
  • Play with your friends in multiplayer mode (online).
  • Playing again with the same player.
  • Quit the game in the middle, but it will result in loosing the game.

๐ŸŽฎ Demo

Server-side Interface

server gui gif

You can start and stop the server from the GUI, as well as view the server logs, the database and a live players list.

Multiplayer Mode

multiplayer gif

Two players can challenge each other and play together online, and they can also chat with each other during the game.

Saving and Loading

save gif

The players can save the game to continue playing at another time.

For the full demo video refer to the following link: Demo Video


๐Ÿ’ป How To Use

Clone the project in your working directory.

git clone https://github.com/ahmedmumdouh/TicTacToe-Java-Project.git

or download the zipped file and unzip it in your working directory.

Database Setup

  • Import SQL schema file in any MySQL Server ( Recommended: phpMyAdmin ) or implement SQl statements manually in mySQL Shell as described in tictactoedb.sql in DBSchema directory.
  • Edit DBconfig.java file in Database Package to fill your database username ,password ,port number ,and database server url .

Run The Server

Using File Explorer : Navigate to the ServerSide folder then inside dist folder double click ServerSide.jar

Using the Terminal : Navigate to the ServerSide/dist directory and run the following command:

java -jar ServerSide.jar

Using The executable file: Double-click the ServerSide.jar file found in the bin directory

โš ๏ธNote that the server and the client run on port 7777.

Run The Client

Using File Explorer : Navigate to the ClientSide folder then inside dist folder double click ClientSide.jar

Using the Terminal : Navigate to the ClientSide/dist directory and run the following command:

java -jar ClientSide.jar

Using The executable file: Double-click the ClientSide.jar file found in the bin directory


๐Ÿ“‹ Dependencies


๐Ÿšซ Limitations

  • A potential shortcoming could appear when the database goes down while the server is running.
  • The reliability of the Client-Server communication is about 90%; sometimes the requests from the client are not caught by the server.

๐Ÿ“ˆ Possible Improvements

  • Implement a notification system to notify players about others signning in/out.
  • To allow the player to share his game result on his social media accounts.

๐Ÿ‘จโ€๐Ÿ’ป About Us

We are a team of software enginnering students at ITI intake 41, Smart Village branch, Open-source application track.

๐Ÿ“ž Contacts

You can find us on:

Linkedin

GitHub

tictactoe-java-project's People

Contributors

hossamkhalil01 avatar ahmedmumdouh avatar ayahamedd avatar ahmedmamdouh996 avatar sarahouf 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.