- The Blackjack Game is a simple web-based game where a player tries to draw cards whose total value is as close as possible to 21 without going over. This game simulates a single-player experience against the rules of blackjack (not against a dealer).
-
The goal is to get a sum of 21 with your cards.
-
An Ace (A) is worth 11 points.
-
Jack (J), Queen (Q), and King (K) are worth 10 points.
-
All other cards (2–10) are worth their face value.
-
You can draw new cards to try to improve your score.
-
If your total goes over 21, you lose the game.
-
If you reach exactly 21, you win – Blackjack!
-
You can reset the game at any time.
-
Generates random cards using getRandomCard() function.
-
Displays current cards and total sum.
-
Shows messages like:
-
"Do you want to draw a new card?"
-
"You've got Blackjack!"
-
"You're out of the game!"
-
START GAME – starts a new game with 2 cards.
-
NEW CARD – draws a new card if you're still playing.
-
RESET GAME – resets the game state.