{"id":23647684,"url":"https://github.com/toughyear/multiplayer-game-java","last_synced_at":"2025-08-08T15:40:22.107Z","repository":{"id":170431207,"uuid":"282616675","full_name":"toughyear/multiplayer-game-java","owner":"toughyear","description":"The multiplayer game coded in Java works as - 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. ","archived":false,"fork":false,"pushed_at":"2020-07-26T09:25:33.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T21:09:44.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toughyear.png","metadata":{"files":{"readme":"ReadMe.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-26T09:24:32.000Z","updated_at":"2020-07-26T09:25:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"975d7bf6-ec23-4fbd-859e-f83f606aa6f5","html_url":"https://github.com/toughyear/multiplayer-game-java","commit_stats":null,"previous_names":["toughyear/multiplayer-game-java"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toughyear/multiplayer-game-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toughyear%2Fmultiplayer-game-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toughyear%2Fmultiplayer-game-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toughyear%2Fmultiplayer-game-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toughyear%2Fmultiplayer-game-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toughyear","download_url":"https://codeload.github.com/toughyear/multiplayer-game-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toughyear%2Fmultiplayer-game-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269447306,"owners_count":24418744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-28T14:38:50.987Z","updated_at":"2025-08-08T15:40:22.057Z","avatar_url":"https://github.com/toughyear.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"RAJEEV SINGH NARUKA\n2017A7PS0010P\n---------------------------------------------------\nSUBMISSION FOR OOP ASSIGNMENT\n---------------------------------------------------\n\nEVALUATION CRITERIA\n\n1. MULTI-THREADING\n\u003e This program makes use of multi-threading in Java. There is a moderator thread\n  and N-number of player threads running concurrently.\n\u003e All of them run in parallel, and synchronize with each other using locks, until the game is finished.\n\n---------------------------------------------------\n\n2. GENERICS AND COLLECTIONS\n\u003e This program uses List (implements Collections) and ArrayList\u003cInteger\u003e (uses generics).\n\n---------------------------------------------------\n\n3. ARRAYS\n\u003e This program makes use of a boolean array to keep track of all threads whether they have\n  checked the latest announced number or not.\n\n---------------------------------------------------\n\n4. PROPER EXCEPTION HANDLING\n\u003e Implemented try-catch exception to handle exceptions while dealing with threads\n  from moderator and player classes.\n\u003e Implemented a throwable InterruptedException in the main function of the Game class.\n\n---------------------------------------------------\n\n5. Input/Output (use general libraries and not standard I/O)\n\n\u003e Used java.io.PrintStream to print relevant information in the console.\n\u003e Used ANSI color-coding for better readability.\n\n---------------------------------------------------\n\n6. DESIGN PATTERNS (at least 2)\n\n\u003e Singleton Pattern - This pattern makes sure that only one object is created for the class.\n  This program uses this pattern to restrict creation of gamedata object, as multiple gamedata\n  object is not needed and can lead to undesirable effect. [wiki: https://en.wikipedia.org/wiki/Singleton_pattern] \n\n\u003e Monitor (synchronization) Pattern - This concurrent program uses the Monitor design pattern which \nis a synchronization construct. It allows our player and moderator threads to run mutually exclusive.\nThe threads have the the ability to wait (block) for a certain condition (verifying if the current number\nhas been checked) to become false. [wiki: https://en.wikipedia.org/wiki/Monitor_(synchronization)] \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoughyear%2Fmultiplayer-game-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoughyear%2Fmultiplayer-game-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoughyear%2Fmultiplayer-game-java/lists"}