robinamasio/blackjack — pull request #1 by robinamasio (2014-10-07 04:11:31+00:00)
Title: dealing & prompting

I went a little further with this change set than I intended. This
change set addresses the following user stories:

“As a dealer, I want to initially deal out two cards to the current
player, So that we can begin the game”

“As a player, I want to be prompted to hit or stand, So that I know
when I have to act”

“As a player, I want to know my current best possible score, So that I
can decide whether to hit or stand”

“As a player, I want to hit, So that I can increase my score”

This required the addition of:

- a basic CSS reset & clear fix, and some basic CSS styling to
categorize the messages on the screen
- additional attributes for cards: numeric values and a flag to denote
an ace (“value” now stores the numeric value, while “level” stores a
displayable name like “2” or “Jack”)
- a deal() function in the Deck collection which deals a specified
number of cards into a buffer hand
- a Hand collection which includes a getScore() function that
calculates the total points in the hand, accounting for aces
- templates for the dealing of a single new card, and the player
controls for “Hit” and “Stand”
- handlers for all controls in MainView

There is still no mechanism for standing, for knowing when the player
has busted, or passing control to the dealer.