banner



Video Game Engine Multithreading Design Patterns

Multiplayer-Tambola-Game-using-Multithreading

neelabhsinha / Multiplayer-Tambola-Game-using-Multithreading Go PK Goto Github PK

1 1 0 1.5 MB

This repository contains a multithreaded application based on 'n' player Tambola game developed using Observer Design Pattern, Singleton Design Pattern and Multi-threading in Java.

License: MIT License

Java 100.00%
multiplayer-tambola-game java multithreading collections-framework design-patterns observer-pattern singleton-pattern

Multiplayer-Tambola-Game-using-Multithreading's Introduction

Multiplayer-Tambola-Game-using-Multithreading

This repository contains a multithreaded application based on 'n' player Tambola game developed using Observer Design Pattern, Singleton Design Pattern and Multi-threading in Java.

Problem Formulation -

Let there be one Moderator and 'n' Players. The moderator displays 10 random numbers (between 0 – 50) on a display screen. Each player is given a card containing 10 random numbers (between 0 - 50). As the number is displayed, the player strikes the number on his card if it matches with the one on the screen. The player who strikes three numbers first will be announced as a winner and the moderator stops generating numbers if a player wins before all the 10 numbers are generated. The numbers generated by the moderator and the player can be redundant. The moderator generates 10 numbers and stores it in an array list of integers. When the moderator is generating the number, the players should not read the array list. The moderator should generate the next number only after all the players have read the previously generated number. The array list should not be read by two players at the same time.

Design Approach -

  • Observer Design Pattern is used as the skeleton of the application. In this case, as per the observer pattern, moderator is the subject and players are the observers. The change in state is generation of a new number and update by the observers is checking the number and striking it off, if present
  • Singleton Design Pattern is used in Moderator class because only one moderator is needed to run the game
  • Table is the shared data and GameController is the class that contains the main function and runs the game
  • Inter-thread communication between the threads take place through appropriate use of locks over the shared data and wait and notifyAll() methods

Concepts used - Design Patterns, Object Oriented Programming, Collections Framework of Java, Multithreading, Java Object Model

For More Details, open the explanation.pdf file and the Java files. The code is properly commented to explain what is happening at each instant, and conceptual explanation is given in explanation.pdf file

Steps to exeute -

  • Make sure to have JDK and/or JRE (as per requirement) installed
  • Execute the Following Commands -
                      $ git clone https://github.com/neelabhsinha/Multiplayer-Tambola-Game-using-Multithreading.git $ cd Multiplayer-Tambola-Game-using-Multithreading.git'                                          
  • If you are using Eclipse, open the project and run the GameController.java class. For any other IDE as well, compile all the classes and run the GameController.java class

Contributors

neelabhsinha avatar

Stargazers

 avatar

Watchers

Neelabh Sinha 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.

  • Laravel photo Laravel

    A PHP framework for web artisans

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

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recently View Projects

  • Multiplayer-Tambola-Game-using-Multithreading photo Multiplayer-Tambola-Game-using-Multithreading

    this repository contains a multithreaded application based on 'n' player tambola game developed using observer design pattern, singleton design pattern and multi-threading in java.

  • alex4me.github.io photo alex4me.github.io

    .

  • Hackerrank-Ruby photo Hackerrank-Ruby

    hackerrank ruby challenges.

  • leaflet-search-control photo leaflet-search-control

    a simple boilerplate for building your own leaflet search control.

  • react-server-boilerplate photo react-server-boilerplate

    React server side rendering boilerplate

Video Game Engine Multithreading Design Patterns

Source: https://githubhelp.com/neelabhsinha/Multiplayer-Tambola-Game-using-Multithreading

Posted by: burnhamromay1946.blogspot.com

0 Response to "Video Game Engine Multithreading Design Patterns"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel