Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 27th, 2004, 10:09 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Blackjack] Shuffling

The shuffling of the decks will be shuffled randomly or it will simulate some specific shuffling method (in the final version of the blackjacklib.php)?
For example:
Quote:
A common shuffle used by casinos is the "zone Shuffle". Here, the cards are broken into piles, and then the shuffling is only performed between the piles.

Reply With Quote
  #2  
Old January 27th, 2004, 02:13 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Blackjack] RE: Shuffling

The cards will be shuffled randomly as in the testing lib (i.e. the whole deck will be shuffled together, but not necessarily with shuffle()).

Does it matter?

Reply With Quote
  #3  
Old January 28th, 2004, 07:11 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Blackjack] RE: Shuffling

Thanks.

Reply With Quote
  #4  
Old January 28th, 2004, 07:17 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Blackjack] RE: Shuffling

There are probability theories depending on the shuffling methods. For example see Knuth: The art of computer programming. Vol 2. pg p145-148.
He explains for a certain shuffling method that not all the permutation of the cards will occure.

Reply With Quote
  #5  
Old January 28th, 2004, 07:21 AM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Blackjack] RE: Shuffling

Well, what I have in mind is:

php Code:
Original - php Code
  1.  
  2. $input=array(1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,...  );
  3. $output=array();
  4. $size=sizeof($input);
  5. $last=$size-1;
  6.  
  7. while (sizeof($output)<$size) {
  8.     do {
  9.         $which=mt_rand(0, $last);
  10.     } while ($input[$which]==-1);
  11.     $output[]=$input[$which];
  12.     $input[$which]=-1;
  13. }

It's slow, but very random

Reply With Quote
  #6  
Old January 28th, 2004, 08:06 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Blackjack] RE: Shuffling

The cards will be random, and practically any of the permutations could appear.
This means that no shuffling prediction algoritm should be used.
Thanks for the info.

Reply With Quote
  #7  
Old January 28th, 2004, 09:29 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Blackjack] RE: Shuffling

But will you use the same shuffled deck for everyone ?
Or everyone will get a different one?

Reply With Quote
  #8  
Old January 28th, 2004, 09:35 AM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Blackjack] RE: Shuffling

Yup, as the rules say, every script will get exactly the same conditions.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [Blackjack] Shuffling


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT