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
inCard
- Override
Equals
inHand
Card
should know (calculate) its own valueenum
s 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.
enum
s makes this simplePlayer
should know its own hand value- Just "ask"
Hand
what its value is
- Just "ask"
Dealer
should know what eachPlayer
s hand is- Just "ask"
Player
what its value is
- Just "ask"
- 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 useenum
sisBlackjack()
is breathtakingly complex. Usingenum
s 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?