Skip to main content
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.kadvice from @h.j.k in your previous post
  • enum use especially
  • Override Equals in Card
  • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
  • enums makes this simple
  • Player should know its own hand value
    • Just "ask" Hand what its value is
  • Dealer should know what each Players hand is
    • Just "ask" Player what its value is
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed. But on the other hand the dealer is also playing. But he gets to play using different rules doesn't he?


I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.k in your previous post
  • enum use especially
  • Override Equals in Card
  • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
  • enums makes this simple
  • Player should know its own hand value
    • Just "ask" Hand what its value is
  • Dealer should know what each Players hand is
    • Just "ask" Player what its value is
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed. But on the other hand the dealer is also playing. But he gets to play using different rules doesn't he?


I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.k in your previous post
  • enum use especially
  • Override Equals in Card
  • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
  • enums makes this simple
  • Player should know its own hand value
    • Just "ask" Hand what its value is
  • Dealer should know what each Players hand is
    • Just "ask" Player what its value is
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed. But on the other hand the dealer is also playing. But he gets to play using different rules doesn't he?


added 177 characters in body
Source Link
radarbob
  • 7.9k
  • 20
  • 34

I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.k in your previous post
    • enum use especially
    • Override Equals in Card
    • Override Equals in Hand
  • enum use especially
  • Override Equals in Card
  • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
  • enums makes this simple
  • Player should know its own hand value
    • Just "ask" enumHands makes this simple what its value is
  • Dealer should know what each Players hand is
    • Just "ask" Player what its value is
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed. But on the other hand the dealer is also playing. But he gets to play using different rules doesn't he?


I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.k in your previous post
    • enum use especially
    • Override Equals in Card
    • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
    • enums makes this simple
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed


I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.k in your previous post
  • enum use especially
  • Override Equals in Card
  • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
  • enums makes this simple
  • Player should know its own hand value
    • Just "ask" Hand what its value is
  • Dealer should know what each Players hand is
    • Just "ask" Player what its value is
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed. But on the other hand the dealer is also playing. But he gets to play using different rules doesn't he?


Source Link
radarbob
  • 7.9k
  • 20
  • 34

I would love suggestions on how to make this game better ...

  • Follow the advice from @h.j.k in your previous post
    • enum use especially
    • Override Equals in Card
    • Override Equals in Hand
  • Card should know (calculate) its own value
    • enums makes this simple
  • Hand should know (calculate) its own value
    • just "ask" each card what its value is and add them up!
    • knows if the value is blackjack, busted, 21, etc. These are all just different scores.
    • enums makes this simple
  • The user prompt string suggests that capital letters should be entered, but the code only checks for lower case.
  • cardValue() is not necessary if you use enums
  • isBlackjack() is breathtakingly complex. Using enums will fantastically simplify this code.

... and also approaches about the missing features.

do the basics right - the stuff above; then code based on these will be easier.


But I think the idea of "dealer" and "player" are very different concepts

Agreed