Talk About Network

Google





Programming > Assembly Language > Re: I pee in th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 20 Topic 5075 of 5194
Post > Topic >>

Re: I pee in the open

by Robert Redelmeier <redelm@[EMAIL PROTECTED] > Jul 21, 2008 at 03:01 AM

H. Peter Anvin <hpa@[EMAIL PROTECTED]
> wrote in part:
> Well, there are a few different problems:
> 
> a. 52 out of 52 cards;
> b. 5 out of 52 cards;
> c. 5 out of 5 cards.
> 
> I described (a), pretty much.
> 
> (b) uses the same algorithm as (a), you just stop after 
>      5 iterations instead of 52.

Except if the order of the 5 doesn't matter, that algorithm
should be a random draw.  This is one way to do card.sims:
draw truly random 52*rand() but track cards already drawn (4
16bit words if space is short) and redraw repeats.  Works fine
(few redraws) until the decks get short, which few games allow.


-- Robert
 




 20 Posts in Topic:
Re: I pee in the open
"Alexei A. Frounze&q  2008-07-14 01:15:57 
Re: I pee in the open
"Rod Pemberton"  2008-07-14 05:39:09 
Re: I pee in the open
"Wolfgang Kern"  2008-07-14 13:18:06 
Re: I pee in the open
"H. Peter Anvin"  2008-07-14 13:03:34 
Re: I pee in the open
"Wolfgang Kern"  2008-07-14 22:50:38 
Re: I pee in the open
Phil Carmody <thefatph  2008-07-15 03:25:24 
Re: I pee in the open
"Rod Pemberton"  2008-07-15 05:01:34 
Re: I pee in the open
"Wolfgang Kern"  2008-07-15 11:43:35 
Re: I pee in the open
"Rod Pemberton"  2008-07-15 08:39:19 
Re: I pee in the open
"Wolfgang Kern"  2008-07-15 18:56:35 
Re: I pee in the open
"H. Peter Anvin"  2008-07-18 14:07:16 
Re: I pee in the open
"Rod Pemberton"  2008-07-19 04:13:29 
Re: I pee in the open
"H. Peter Anvin"  2008-07-19 19:18:14 
Re: I pee in the open
"Rod Pemberton"  2008-07-20 14:45:57 
Re: I pee in the open
Robert Redelmeier <red  2008-07-21 03:01:16 
Re: I pee in the open
"Rod Pemberton"  2008-07-21 04:18:57 
Re: I pee in the open
Robert Redelmeier <red  2008-07-22 23:14:35 
Re: I pee in the open
"Rod Pemberton"  2008-07-22 22:31:27 
Re: I pee in the open
Robert Redelmeier <red  2008-07-23 18:21:47 
Re: I pee in the open
"Rod Pemberton"  2008-07-23 18:41:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 16:25:00 PST 2009.