Skip to content

FelicityRC/blackjack-project

Repository files navigation

♠ ♥ BLACKJACK ♣ ♦

Task Breakdown

Write code that simulates a hand of blackjack cards. The goal of the game is to get a hand that's worth as close to 21 points as possible. If the player's hand goes over 21 points then they have lost.

The player is initially dealt two cards. They may choose to 'hit' (draw a card) or 'stand' (stop drawing cards). If they 'hit' then the new card's value is added to the initial hand of cards. If the total hand exceeds 21 then the player has 'bust' and loses.

A full description of the game can be found here.

Scenarios

  • When dealt opening hand, player has 2 cards.
  • When player clicks hit they receive another card.
  • When player clicks stand they receive no further cards and score is evaluated against the dealer's score.
  • When player's hand is 21 or less then it is valid.
  • When player's hand is 22 or more then player is bust.
  • When player has a king and an ace, their score is 21.
  • When player has a king, queen and an ace, their score is 21.
  • When player has a nine, an ace and another ace, their score is 21.

To Run Locally

  • Fork then clone this repository.

  • run npm i

  • run npm t

  • Locate HTML file to open in local browser.

Initial Steps Taken

  • Read through task outline, example scenarios and blackjack rules.
  • Create a new GitHub repo for the tech assessment.
  • Initialise with a README.md, package.json and .gitignore file.
  • Plan layout and styling for user interface.
  • Link relevant file sources to HTML skeleton.
  • Summarise necessary functionality for game play.

Link to my Blackjack GitHub Pages here


I chose to create this game without a framework and thoroughly enjoyed utilising my DOM manipulation skills with Vanilla JS, HTML, CSS and Jest. Please see NOTES.md file for breakdown of planning, thoughts and predictions.


blackjack-project-winning-hand-example

Releases

No releases published

Packages

No packages published