{"id":24494797,"url":"https://github.com/thisisnotjustin/pongtex","last_synced_at":"2026-03-02T14:39:59.657Z","repository":{"id":269253806,"uuid":"906864913","full_name":"ThisIsNotJustin/pongtex","owner":"ThisIsNotJustin","description":"Ping Pong Game utilizing a mutex for mutual exclusion and synchronization","archived":false,"fork":false,"pushed_at":"2024-12-22T06:25:01.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T01:47:03.133Z","etag":null,"topics":["c","embedded-systems","software-engineering"],"latest_commit_sha":null,"homepage":"","language":"C","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/ThisIsNotJustin.png","metadata":{"files":{"readme":"README.md","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":"2024-12-22T06:13:13.000Z","updated_at":"2025-01-16T01:02:30.000Z","dependencies_parsed_at":"2024-12-22T07:22:48.861Z","dependency_job_id":"b6312fb6-2c49-4b2f-a9b4-1a4941ea9f69","html_url":"https://github.com/ThisIsNotJustin/pongtex","commit_stats":null,"previous_names":["thisisnotjustin/pongtex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fpongtex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fpongtex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fpongtex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fpongtex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThisIsNotJustin","download_url":"https://codeload.github.com/ThisIsNotJustin/pongtex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253176443,"owners_count":21866142,"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","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":["c","embedded-systems","software-engineering"],"created_at":"2025-01-21T20:17:16.224Z","updated_at":"2025-11-08T01:03:44.006Z","avatar_url":"https://github.com/ThisIsNotJustin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PongTex\n\n## Ping Pong Terminal Game utilizing a Mutex\nThis is a simple ping pong game written in C that uses mutexes for mutual exclusion between two players (Ping and Pong) to ensure they are only able to hit the ping pong ball during their respective turn. The game runs for 10 seconds before concluding, counting the number of rallies.\n\n## Introduction\n\nThe game simulates a two-player ping pong match. Player 1 (Ping) and Player 2 (Pong) take turns hitting the ball back and forth. The game is synchronized using a custom mutex implementation to ensure that only one player can hit the ball at a time, avoiding race conditions. The game will run for 10 seconds, and the rally count will be displayed at the end.\n\n## Game Overview\n- Duration: The game runs for 10 seconds before it automatically ends\n- Objective: Players (Ping and Pong) take turns hitting the ball.\n- Synchronization: A mutex is used to ensure that only one player can hit the ball at a time\n- Game State: The game maintains a shared state that tracks the ball's position, rally count, and if the game is over\n\n## How to Run\n### Clone the Repository\n```bash\ngit clone https://github.com/ThisIsNotJustin/pongtex.git\ncd pongtex\n```\n\n### Compile the Code\n```bash\ngcc -c threads/thread.c -I./threads -I./mutex -o build/thread.o\ngcc -c pingpong/pingpong.c -I./pingpong -I./mutex -I./threads -o build/pingpong.o\ngcc -c mutex/mutex.c -o build/mutex.o -I$(xcrun --show-sdk-path)/usr/include  \ngcc -g build/main.o build/pingpong.o build/thread.o build/mutex.o -o build/pingpong_game -lpthread\n```\n\n### Run the Game!\n```bash\n./build/pingpong_game\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisnotjustin%2Fpongtex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisisnotjustin%2Fpongtex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisnotjustin%2Fpongtex/lists"}