Re: A83:Black Jack


[Prev][Next][Index][Thread]

Re: A83:Black Jack




In a message dated 10/10/99 12:13:18 PM Central Daylight Time, 
lairfight@softhome.net writes:

> > I dont know what kind of deck you have, but in a normal deck of cards 
there 
> is
>  > 52 cards..
>  > Anyway, I think this method (useing a virtual deck of cards) is the best 
> way, if
>  > you want to do a _real_ simulation of Black Jack. A good BJ player keeps 
> track
>  > of what cards is already played, and makes his choices from that.
>  > you can also have double, triple or more decks.
>  > and useing a deck automatically solves the double ace of spades thing.. (
> wich
>  > actually is possible, if you play BJ with a double (or more) deck)
>  
>  > //Olle
>  
>  
>  52 + 2 jokers = 54.
>  
>  Anyway, here's a good routine (in c-inspired pseudo code) to shuffle a 
deck:
>  
>  deck[0] = 0;
>  for(i=1; i<52; i++)
>  {
>    j = random number in the range 0 to i;
>    deck[i] = deck[j]; deck[j] = i;
>  }

Yes, I drew the number 54 from the back of my mind somewhere, but 52 is 
right... and this C code, how does it keep track of the suits? Is my idea for 
storing the bits a good one, or is there another method...?

Jason_K


Follow-Ups: