mrBist / OOP-Assignment

N-Player Java Game based on Tambola

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OOP-Assignment

PROBLEM:

You are required to code a ‘n’ player game. One of the game can be as follows. Let there be one Moderator and ‘n’ Players. The moderator displays 10 random numbers (between 0 – 50) on a display screen with one-minute gap between the numbers. 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. For e.g. if the moderator generates a 20 twice and if a player has one 20. After the player strikes the number, it should not be considered as a match, when 20 appears again on the display screen. 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.

Components Used:

  1. Multithreading
  2. Design patterns: Singleton & Mediator
  3. Exception Handling

About

N-Player Java Game based on Tambola


Languages

Language:Java 100.0%