Blackjack setting Ace value

Reply

Join Date: Apr 2007
Posts: 1
Reputation: tripuraneni is an unknown quantity at this point 
Solved Threads: 0
tripuraneni tripuraneni is offline Offline
Newbie Poster

Blackjack setting Ace value

 
0
  #1
Apr 24th, 2007
hi freinds,
Plz help me how to set the value of ace in Blackjack game.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 162
Reputation: Cerberus is an unknown quantity at this point 
Solved Threads: 14
Cerberus Cerberus is offline Offline
Junior Poster

Re: Blackjack setting Ace value

 
0
  #2
Apr 24th, 2007
Wouldn't you just set the value to one higher then King e.g. King = 13, Ace = 14.
Last edited by Cerberus; Apr 24th, 2007 at 6:23 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,277
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 242
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Blackjack setting Ace value

 
0
  #3
Apr 24th, 2007
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.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 762
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: Blackjack setting Ace value

 
0
  #4
Apr 25th, 2007
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.

  1. if sum(cards-Ace) < 11
  2. Ace = 11
  3. else
  4. Ace = 1
  5. endif
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC