Skip to content

Conversation

abutler3
Copy link

@abutler3 abutler3 commented Mar 2, 2013

I did run into an issue with the Tiger assignment. My tests are passing, but when I run it in IRB, when the player doesn't bust, instead of the array of cards, I see nil. Any issues about why?

Got into the class late so I might need to tackle Eagle later

@jwo
Copy link
Member

jwo commented Mar 2, 2013

hmmm, I ran your code in IRB and saw what I expected:

>> require './blackjack'
=> true
>> game = Game.new
=> {:player_cards=>[8C, 5C], :player_value=>13, :dealer_cards=>[JS, QS], :dealer_value=>20, :winner=>nil}
>> game.hit
=> nil
>> game
=> {:player_cards=>[8C, 5C, 4S], :player_value=>17, :dealer_cards=>[JS, QS], :dealer_value=>20, :winner=>nil}
>> game.hit
=> nil
>> game
=> {:player_cards=>[8C, 5C, 4S, 2H], :player_value=>19, :dealer_cards=>[JS, QS], :dealer_value=>20, :winner=>nil}
>> game.hit
=> :dealer
>> game
=> {:player_cards=>[8C, 5C, 4S, 2H, QC], :player_value=>29, :dealer_cards=>[JS, QS], :dealer_value=>20, :winner=>:dealer}

I think it looks right on. what were you seeing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a cool wait to solve the 6H instead of 6-hearts problem. I hadn't considered it

I want to make sure you know how to turn :clubs into C though:

suit = :clubs
suit.to_s.upcase.chars.first
=> "C"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants