-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've finished panda level! #30
base: master
Are you sure you want to change the base?
Conversation
@@ -75,6 +81,7 @@ def initialize | |||
|
|||
def hit | |||
@player_hand.hit!(@deck) | |||
stand if @player_hand.value > 21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a detail of blackjack, but you'll also want to stand if you're exactly 21 as well.
Looks great -- let me know if my thoughts on the game.stand make sense or not. |
end | ||
|
||
def value | ||
@cards.inject(0) {|sum, card| sum += card.value } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with inject here.
This is a great progression in your programming --- I think it worked really well, and is one of the reasons to use Nice job on this! |
No description provided.