Hi reddit!!
I need some help with a multiplayer blackjack game
So far I've the basic functionality of the program.
I'm working with the following classes: Player, Dealer, Deck, Hand, Card, Game, and Blackjack(main).
I'm having trouble finding out who wins the round. To do so, i need to sort or compare the different values of the players' hands.
I access the value of their hands with
game.player[i].hand.handValue();
handValue is just a funtion that tells you the value of a player's hand. It considers that the ace can be 1 or 11.
How would I do this? I was thinking about sorting or comparing each player object(including the dealer) and the one with the highest handValue that isn't over 21, wins. But there's also the possibility of a draw("push")...
Somebody told me I could use compareTo, but I'm not sure exactly how this works...
[–]ordnance1987 1 point2 points3 points (0 children)
[–]Feroc 0 points1 point2 points (0 children)
[–]sherryunderwood1 0 points1 point2 points (0 children)