{"id":15028197,"url":"https://github.com/mohammadmahditaheri/cli-race","last_synced_at":"2026-02-09T23:02:36.947Z","repository":{"id":225731377,"uuid":"766696320","full_name":"mohammadmahditaheri/cli-race","owner":"mohammadmahditaheri","description":"A simple two player cli race game to demonstrate object oriented design in php","archived":false,"fork":false,"pushed_at":"2024-09-01T20:31:57.000Z","size":1429,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T14:29:09.275Z","etag":null,"topics":["oop","oop-in-php","php","php82"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/mohammadmahditaheri.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-03-04T00:03:37.000Z","updated_at":"2024-09-01T20:32:01.000Z","dependencies_parsed_at":"2024-03-22T10:54:52.708Z","dependency_job_id":"0a8f4767-a415-4566-abd6-1227807fed0e","html_url":"https://github.com/mohammadmahditaheri/cli-race","commit_stats":null,"previous_names":["mm-ta/cli-race","mohammadmahditaheri/cli-race"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mohammadmahditaheri/cli-race","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmahditaheri%2Fcli-race","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmahditaheri%2Fcli-race/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmahditaheri%2Fcli-race/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmahditaheri%2Fcli-race/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadmahditaheri","download_url":"https://codeload.github.com/mohammadmahditaheri/cli-race/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmahditaheri%2Fcli-race/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29284741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"ssl_error","status_checked_at":"2026-02-09T21:57:11.537Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["oop","oop-in-php","php","php82"],"created_at":"2024-09-24T20:07:47.293Z","updated_at":"2026-02-09T23:02:31.939Z","avatar_url":"https://github.com/mohammadmahditaheri.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI-Based Two-Player Vehicle Racing Game in PHP\n\nThis project is a simple command-line interface (CLI) based two-player racing game implemented in PHP. Players can choose a vehicle from a list provided in a `vehicles.json` file. Each vehicle has a maximum speed, and the application calculates the time taken by each vehicle to complete a given distance(It's being set as default to 100 kms) based on its speed. The winner is then declared based on the race results.\n\n## Core Features\n\n1. **Vehicle Selection**: Load the list of available vehicles from the `vehicles.json` file and allow two players to select a vehicle each.\n2. **Race Simulation**: Run a race using the selected vehicles.\n3. **Time Calculation**: Calculate the time taken by each vehicle to complete the race based on its speed.\n4. **Winner Declaration**: Determine and display the winner based on the race results.\n5. **Race Statistics**: Display the time taken by each vehicle to finish the race.\n\n## Usage (how to play)\n\n1. clone the project. (make sure to place it where you can run php).\n2. in the root directory of the project execute this command in the terminal\n```bash\nphp ./public/index.php\n```\n3. You will face this:\n```\nWelcome to the CLI Racing Game!\n** Choose your vehicle: **\n1. Car (150 km/h)\n2. Motorcycle (200 km/h)\n3. Bus (100 km/h)\n4. Bicycle (30 km/h)\n5. Jet Ski (92.6 km/h)\n6. Speed Boat (129.64 km/h)\n7. Yacht (37.04 km/h)\n8. Helicopter (259.28 km/h)\n9. Airplane (898.22 km/h)\n10. Hot Air Balloon (9.26 km/h)\nPlayer 1, choose your vehicle (1-10):\n```\n4. choose a number between 1-10\n5. do it again for the player two\n6. The race will begin and the winner and race statistics will appear.\n\np.s: _The speed numbers are being converted to `km/h` for the sake of simplicity in comparison_\n\np.s: _I know that this game may be boring. It's for the sake of OOD and not for entertainment!_ :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadmahditaheri%2Fcli-race","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadmahditaheri%2Fcli-race","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadmahditaheri%2Fcli-race/lists"}