{"id":28274304,"url":"https://github.com/aleksandr-ln/card-game-blackjack","last_synced_at":"2025-06-16T05:31:25.686Z","repository":{"id":162017937,"uuid":"587329017","full_name":"Aleksandr-ln/Card-game-Blackjack","owner":"Aleksandr-ln","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-19T11:25:33.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T01:16:55.291Z","etag":null,"topics":["blackjack","card-game","cpp","game-development-cpp"],"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/Aleksandr-ln.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":"2023-01-10T13:58:00.000Z","updated_at":"2025-03-19T12:29:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a30a7e0-fe30-46c2-b128-d897a7f4db69","html_url":"https://github.com/Aleksandr-ln/Card-game-Blackjack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aleksandr-ln/Card-game-Blackjack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleksandr-ln%2FCard-game-Blackjack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleksandr-ln%2FCard-game-Blackjack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleksandr-ln%2FCard-game-Blackjack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleksandr-ln%2FCard-game-Blackjack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aleksandr-ln","download_url":"https://codeload.github.com/Aleksandr-ln/Card-game-Blackjack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleksandr-ln%2FCard-game-Blackjack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260105983,"owners_count":22959576,"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":["blackjack","card-game","cpp","game-development-cpp"],"created_at":"2025-05-21T01:16:55.415Z","updated_at":"2025-06-16T05:31:25.678Z","avatar_url":"https://github.com/Aleksandr-ln.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blackjack Card Game\n\n## Overview\nThis is a simple implementation of the classic card game **Blackjack** written in C++. The program simulates a game where a player competes against a dealer, following standard Blackjack rules.\n\n## Features\n- Representation of a full deck of 52 playing cards using `struct` and `enum`.\n- Shuffling and dealing of cards.\n- Implementation of player and dealer moves.\n- Determination of the game outcome (win, loss, or draw).\n- Console-based interaction for user input.\n\n## Game Rules\n1. The player and dealer are each dealt cards.\n2. The player can choose to **Hit** (take another card) or **Stand** (keep the current hand).\n3. If the player exceeds a total of **21**, they lose automatically (Bust).\n4. The dealer will draw cards until their total is **17** or higher.\n5. The winner is determined based on who has the closest score to **21** without exceeding it.\n6. If both have the same score, the game is a draw.\n\n## How to Run\n1. **Compile the program** using a C++ compiler:\n   ```sh\n   g++ -o blackjack.cpp\n   ```\n2. **Run the executable**:\n   ```sh\n   ./blackjack\n   ```\n\n## Code Structure\n- `enum CardSuit` - Defines the suits of a deck (Clubs, Diamonds, Hearts, Spades).\n- `enum CardRank` - Defines the ranks of cards (2 to Ace).\n- `struct Card` - Represents a card with a rank and suit.\n- `void printCard(const Card \u0026card)` - Prints the value and suit of a card.\n- `void shuffleDeck(std::array\u003cCard, 52\u003e \u0026deck)` - Shuffles the deck randomly.\n- `int getCardValue(const Card \u0026card)` - Returns the value of a card for Blackjack rules.\n- `BlackjackResult playBlackjack(const std::array\u003cCard, 52\u003e \u0026deck)` - Implements the game logic.\n- `int main()` - The entry point where the deck is initialized, shuffled, and the game is started.\n\n## Future Improvements\n- Add support for betting and multiple rounds.\n- Implement AI for a smarter dealer.\n- Add multiplayer functionality.\n\n## License\nThis project is open-source and can be used freely.\n\n---\n**Author:** Oleksandr Onupko\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksandr-ln%2Fcard-game-blackjack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleksandr-ln%2Fcard-game-blackjack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksandr-ln%2Fcard-game-blackjack/lists"}