DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Blackjack setting Ace value (http://www.daniweb.com/forums/thread76314.html)

tripuraneni Apr 24th, 2007 5:52 am
Blackjack setting Ace value
 
hi freinds,
Plz help me how to set the value of ace in Blackjack game.

Cerberus Apr 24th, 2007 6:23 am
Re: Blackjack setting Ace value
 
Wouldn't you just set the value to one higher then King e.g. King = 13, Ace = 14.

masijade Apr 24th, 2007 6:25 am
Re: Blackjack setting Ace value
 
No, because in BlackJack (21) 10 - King are all 10 and an Ace is either 1 or 11.

I would say, when an Ace shows up, total the rest of the cards, then decide how much to assign to the Ace depending on the difference between the current total and 21.

Phaelax Apr 25th, 2007 6:50 pm
Re: Blackjack setting Ace value
 
Remove any Aces from your hand, sum up whats left and if that total is less than 11 then you can make the Ace worth 11 without busting.

if sum(cards-Ace) < 11
    Ace = 11
else
    Ace = 1
endif


All times are GMT -4. The time now is 10:44 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC