Skip to content
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

fixed typos + tiger level completed #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ellesuzuki
Copy link

No description provided.

"#{@value}-#{suit}"
#"#{@value}-#{suit}" # 5-hearts
# want form 'H5'
suits_map = {:clubs => 'C', :diamonds => 'D', :spades => 'S', :hearts => 'H'}
Copy link
Member

Choose a reason for hiding this comment

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

in Ruby, it's called a Hash (short for hash-map, I know, but people will know what you mean with hash). Map is typically used for map-reduce (as in over a collection)

Also, instead of suits_map[suit], I'd recommend

suits_map.fetch(:suit)

This way, fetch will will raise an exception if suit is somehow missing.

@jwo
Copy link
Member

jwo commented Nov 24, 2012

Looks good! One more suggestion: write a test for the busted? method --- that's a part of the game's workflow and would be best served under test.

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