{"id":50806985,"url":"https://github.com/mikechiloane/card-game","last_synced_at":"2026-06-13T02:06:16.688Z","repository":{"id":229133460,"uuid":"775519844","full_name":"mikechiloane/card-game","owner":"mikechiloane","description":"Five-card draw is a poker variant where players get 5 cards, swap some, and compete based on hand rankings. This project builds a console app simulating dealing and evaluating hands. Unlike traditional draw, no card swapping is allowed.","archived":false,"fork":false,"pushed_at":"2024-03-21T15:24:40.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-28T03:29:41.093Z","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/mikechiloane.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}},"created_at":"2024-03-21T14:43:16.000Z","updated_at":"2024-03-22T06:02:47.000Z","dependencies_parsed_at":"2024-03-22T08:25:19.681Z","dependency_job_id":"e9603258-d7a6-4972-8c2d-56be4a869ac7","html_url":"https://github.com/mikechiloane/card-game","commit_stats":null,"previous_names":["mikechiloane/card-game"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikechiloane/card-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikechiloane%2Fcard-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikechiloane%2Fcard-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikechiloane%2Fcard-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikechiloane%2Fcard-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikechiloane","download_url":"https://codeload.github.com/mikechiloane/card-game/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikechiloane%2Fcard-game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34269368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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":"2026-06-13T02:06:15.929Z","updated_at":"2026-06-13T02:06:16.684Z","avatar_url":"https://github.com/mikechiloane.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Card Game\n\nThis is a card game project implemented in Java and built with Maven.\n\n# Running and Testing the Card Game\n\nThis explains how to compile, package, run, and test your Java application using the provided shell script.\n\n## Prerequisites\n\n- JDK (Java Development Kit) installed on your system\n- Maven build tool installed on your system\n\n## Usage\n\n1. Clone the repository to your local machine:\n\n    ```bash\n    git clone https://github.com/mikechiloane/card-game.git\n    ```\n\n2. Navigate to the project directory:\n\n    ```bash\n    cd card-game\n    ```\n\n3. Make sure the shell script (`run.sh`) is executable:\n\n    ```bash\n    chmod +x run.sh\n    ```\n\n### Running the Java Program\n\nTo compile, package, and run the Java program, execute the following command:\n\n```bash\n./run.sh\n```\n\n### Running the Tests\n\nTo run the tests, execute the following command:\n\n```bash\n./run.sh test\n```\n\n## Example Output\n\nThe output of the program should look like this:\n\n```\nShuffling ... Shuffling ... Shuffling ...\nYour hand: A♠ 3♣ 5♥ 9♦ K♦\nYou have: High Card\n```\n\n## Code Design Explanation\n\nThe provided code design already offers some flexibility and extensibility, but it can be further improved to\naccommodate the mentioned requirements:\n\n### 1. Replacing the Shuffling Algorithm:\n\nCurrently, the `FiveCardDraw` class accepts a `Shuffler` interface which allows different shuffling algorithms to be\nplugged in. To replace the shuffling algorithm with a more realistic one, you can simply create a new class implementing\nthe `Shuffler` interface and inject it into the `FiveCardDraw` constructor.\n\nFor example:\n\n```java\npublic class RealisticDeckShuffler implements Shuffler {\n    @Override\n    public void shuffleDeck(Deck deck) {\n        // Implement realistic shuffling algorithm\n    }\n}\n```\n\n### Then, inject the new shuffler into the class:\n\n```java\npublic class FiveCardDraw { \n    private final Deck deck;\n    private final Shuffler shuffler;\n\n    public FiveCardDraw(Deck deck, Shuffler shuffler) {\n        this.deck = deck;\n        this.shuffler = shuffler;\n    }\n}\n```\n\n### 2. Adding a New Game Variant:\n\nTo add a new game variant, you can create a new class implementing the `CardGame` interface and inject it into the `game`\nvariable in the Main class.\n\nFor example:\n\n```java\npublic class TexasHoldem implements CardGame {\n    @Override\n    public void run() {\n        // Implement Texas Hold'em game logic\n    }\n}\n```\n\n### Then, inject the new game variant into the Main class:\n\n```java\npublic class Main {\n    public static void main(String[] args) {\n        CardGame game = new TexasHoldem();\n        game.run();\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikechiloane%2Fcard-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikechiloane%2Fcard-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikechiloane%2Fcard-game/lists"}