Skip to content

BlackJack Homework #9

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

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

BlackJack Homework #9

wants to merge 4 commits into from

Conversation

jamlevi
Copy link

@jamlevi jamlevi commented Sep 18, 2012

Better Late Than Never

@@ -1,6 +1,8 @@
require 'rspec'
class Card

# @@FORMATS = (1 => "#{@value}-#{suit}", 2 => "#{suit}#{@value}")
Copy link
Member

Choose a reason for hiding this comment

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

I recommend not leaving commented code in your code.

Also, the use of a class level variable here doesn't make sense (@@). Just use a CONSTANT instead.

@jwo
Copy link
Member

jwo commented Sep 18, 2012

Two things I'd change for either this or future code:

  1. don't leave commented code in your code. Delete away ... and if you want a history: commit, then delete
  2. there's a method called suit --- you could just call "to_s" on a symbol to get it as a string... But also, I would have rather seen this on a Card object itself, and a case statement would be better than a if/else/else
case suit
when :clubs
"C"
when :diamonds
"D"

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