-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.txt
More file actions
93 lines (59 loc) · 3.69 KB
/
rules.txt
File metadata and controls
93 lines (59 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
────────────────────────────────────────────────────────────────────────────────
BLACKJACK
ABOUT
The main goal of Blackjack is to get a hand's value as close to 21 as
possible without going over ("busting"). Each hand starts with two cards. If
the values of these two initial cards add up to 21, that is called a
"blackjack" and is the most valuable hand.
This program allows a single player to play this game with one to seven
hands. Hands are played independently. On each turn, the player can decide
on what to do with each hand (detailed below under "PLAYER OPTIONS").
The game stops once all hands can no longer take any more cards (either by
achieving a total of 21, busting, or by player decision), the dealer
resolves its hand and the winners are determined.
CARD VALUES
Number cards are valued at their number (e.g. 2 of Spades has a value of 2).
Face cards are valued at 10 (e.g. Jack of Diamonds has a value of 10).
Aces are valued at 11 by default, unless this would result in a bust. In
that case, the ace is valued at 1.
Here are sample hands and their values:
╭────╮ ╭────╮ ╭────╮ ╭────╮
│♠ 5│ │♥ A│ │♣ 7│ │♦ J│
╭────╮ ╭────╮ ╭────╮ ╭────╮
│♥ 3│ │♠ 9│ │♣ 6│ │♦ 3│
│ │ │ │ ╭────╮ ╭────╮
╰────╯ ╰────╯ │♠ A│ │♦ 5│
8 20 │ │ │ │
╰────╯ ╰────╯
14 18
PLAYER OPTIONS
On the initial two cards, the player has up to five options: hit, stand,
double down, split and surrender.
Once a hand has more than two cards, only two options are available: hit and
stand.
- HIT: draw a card
- STAND: stop drawing cards
- DOUBLE DOWN: double the bet and draw a card. No more cards can be
drawn for this hand.
- SPLIT: if the two initial cards have the same value, split the hand
into two. A card is drawn for each hand, resulting in two starting
hands. The second hand requires an additional bet. The two hands are
played out independently.
- SURRENDER: forfeit half the bet and stop drawing cards
SPECIAL RULES FOR SPLITTING
A 10-valued card and an ace resulting from a split isn't considered a
blackjack.
- HIT: you can't hit split aces
- SURRENDER: you can't surrender after splitting
AFTER THE PLAYERS HAVE FINISHED
After the players have finished playing, the dealer's hand is resolved.
The dealer draws cards until the hand achieves a total of 17 or higher. If
the dealer has a total of 17 including an ace valued as 11 (a "soft 17"),
the dealer stops drawing cards.
- If the dealer busts, all players who haven't busted win.
- If the dealer does not bust, each remaining bet wins if its hand is
higher than the dealer's hand, and loses otherwise.
- In the case of a tie ("push"), bets are returned without adjustment.
- A blackjack beats any hand that is not a blackjack (even a hand with a
value of 21).
────────────────────────────────────────────────────────────────────────────────