forked from techreturners/lm-code-kata-scala-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc3d0f6
commit 331c40f
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
Can you beat the dealer at 21 | ||
====================================== | ||
|
||
#### Model the game | ||
* create a single deck of playing cards | ||
* two players (called Sam and the Dealer) who will play against each other | ||
* each player is given two cards from the top of a shuffled deck of cards | ||
|
||
#### Rules to implement | ||
* determine score of a hand[1] | ||
* check if either player has blackjack (21) with their initial hand and wins the game | ||
* if neither player has blackjack then Sam can start drawing cards from the top of the deck | ||
* Sam should stop drawing cards from the deck if their total reaches 17 or higher | ||
* Sam has lost the game if their total is higher than 21 | ||
* when Sam has stopped drawing cards the Dealer can start drawing cards from the top of the deck | ||
* the Dealer should stop drawing cards when their total is higher than Sam. | ||
* the Dealer has lost the game if their total is higher than 21 | ||
* determine which player wins the game | ||
|
||
[1] Numbered cards are their point value. Jack, Queen and King count as 10 and Ace counts as 11. |