{"id":23756895,"url":"https://github.com/tedyoung/blackjack-r2ha-2022","last_synced_at":"2025-09-18T00:32:47.310Z","repository":{"id":59268776,"uuid":"536345894","full_name":"tedyoung/blackjack-r2ha-2022","owner":"tedyoung","description":"Starter project for the Refactoring to Hexagonal Architecture (R2HA) course.","archived":false,"fork":false,"pushed_at":"2023-05-17T02:42:18.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":42,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-05T13:11:56.891Z","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/tedyoung.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":"2022-09-13T23:46:26.000Z","updated_at":"2023-03-08T05:12:16.000Z","dependencies_parsed_at":"2024-11-21T07:30:28.665Z","dependency_job_id":"76f95f7a-c4dd-421b-a04c-bc626c4fdf39","html_url":"https://github.com/tedyoung/blackjack-r2ha-2022","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Fblackjack-r2ha-2022","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Fblackjack-r2ha-2022/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Fblackjack-r2ha-2022/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Fblackjack-r2ha-2022/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tedyoung","download_url":"https://codeload.github.com/tedyoung/blackjack-r2ha-2022/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233433728,"owners_count":18675606,"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":[],"created_at":"2024-12-31T19:26:18.213Z","updated_at":"2025-09-18T00:32:41.886Z","avatar_url":"https://github.com/tedyoung.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Refactoring (Blackjack) to Hexagonal Architecture\n\nThis is the starter code base for the \"Refactoring to Hexagonal Architecture\"\ncourse.\n\n# Requirements\n\nYou **must have** the following already set up and running on your machine:\n\n* Java 17 (or later)\n  * Ensure that this is the default Java runtime by typing `java -version`\n    at the command line, and you should see something like:\n    ```\n    openjdk version \"17.0.4.1\" 2022-08-12\n    ```\n* git 2.36 (or later)\n* IntelliJ IDEA 2022.3.2 (or later), either the _Community_ or _Ultimate_ Edition\n  * or Eclipse (if you must, though all course examples will use IntelliJ IDEA)\n\n# Setting Up the Project\n\nBefore opening up the project using your development environment,\nmake sure that you can build the project from the command-line by running:\n\n### macOS/Linux:\n```sh\n./mvnw clean test\n```\n\n### Windows\n\n```cmd\nmvnw clean test\n```\n\nOnce the project compiles from the command-line, open it in your development\nenvironment and ensure that you can run all of the unit tests -- if everything\nis set up properly, they will all pass.\n\n## Running and Playing the Game\n\nTo run the game, it works best if you run it in a real terminal window and not\ninside the IDE (which may not recognize the \"ANSI\" messages used to change\ncolors and move the cursor around). To do this, use Maven to build and package\nthe JAR and then you can run it:\n\n### macOS/Linux:\n```sh\n./mvnw clean package\n```\n\n### Windows\n\n```cmd\nmvnw clean package\n```\n\nThis will download dependencies, compile the code, run the tests, and then\npackage it into a JAR file that it will put in the `target` directory.\nTo run it, do the following at the command-line in the project's directory:\n\n### macOS/Linux:\n\n```sh\njava -jar target/blackjack-1.0.2.jar\n```\n\n### Windows\n\n```\njava -jar target\\blackjack-1.0.2.jar\n```\n\n# The Game of Blackjack\n\nWhen running in the terminal, the game will look something like this:\n\n\u003cimg src=\"docs/blackjack-welcome.png\" width=\"50%\"/\u003e\n\nfollowed by the game itself, which starts with the \"initial deal\" of two cards\neach to the Dealer (top row) and you, the Player (bottom row):\n\n\u003cimg src=\"docs/blackjack-initial-deal.png\" width=\"35%\"/\u003e\n\n## Rules of Blackjack\n\nPlayers play against the Dealer, not each other. The goal of the game is to get\na hand with a score as close to 21 without going over, as well as beating the\nscore of the Dealer's hand. The score of the hand is the sum of the point\nvalues of its cards. If a Player's hand score is over 21, the Player loses\n(\"busts\").\n\nBlackjack uses a standard deck of 52 playing cards. Each card has a rank:\nAce (A), 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack (J), Queen (Q), or King (K).\nThe card's rank determines its scoring value: numbered cards 2-10 are worth\ntheir number; face cards (Jack, Queen, King) are worth 10 points; Aces are\nworth 1 point or 11 points, whichever would bring the hand value closer to\n21 without exceeding it.\n\nEach round proceeds as follows:\n\n### Initial Deal\n\n* The dealer shuffles the deck and deals two cards \"face up\" (with the Rank and\n  Suit of the card showing) to each player. The dealer deals their cards with\n  one card \"face down\" (with only the back showing, known as a \"hole\" card)\n  and one card \"face up\".\n\n### Player's Turn\n\n* The dealer asks the first player whether they want to \"hit\" (get another\n  card from the deck) or \"stand\" (not get any more cards).\n* If they choose to stand, their turn is over and the game moves on to the next\n  player, if any. If not, it's the dealer's turn.\n* If the player hits, the dealer deals them a card from the deck, face up, and\n  their hand score changes based on the additional card.\n* If this causes their score to go over 21, they have \"busted\" and immediately\n  lose the round and play continues with the next player.\n* If they haven't busted, they continue to have the option to hit or stand\n  again.\n\n### Dealer's Turn\n\nOnce all players have either busted or stood, it's the dealer's turn to play.\nThey turn their face-down card over so the card's Rank and Suit are shown.\nThey then hit until their score is 17 or higher at which point they must stand.\nThe dealer cannot decide to hit or stand, if their hand's score is 16 or lower,\nthey must hit, and at 17 or higher, they must stand.\n\nIf the dealer busts, any players who did not bust earlier automatically win the\nround. Otherwise, each player wins if they have a strictly higher score than\nthe dealer, or loses if they have a strictly lower score, and \"pushes\" (ties)\nif they have the same score.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftedyoung%2Fblackjack-r2ha-2022","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftedyoung%2Fblackjack-r2ha-2022","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftedyoung%2Fblackjack-r2ha-2022/lists"}