mikmoore at math.carleton.ca
Tue Feb 7 10:04:55 EST 2006
Yes, but in that case you select 7 of the 52 by the "dart" process and then
use the remaining 45. For less than half you keep the selected ones, for
more than half you throw them away and use the remainder. For exactly 1/2,
----- Original Message -----
From: "Mark McDougall" <msmcdoug at iinet.net.au>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Tuesday, February 07, 2006 4:01 AM
Subject: Re: [Coco] Minesweeper
> Neil Morrison wrote:
> > This is MUCH quicker than shifting. In effect, you have 52 flags.
> No, this is exactly the problem as described by the OP.
> If you need 45 random values from 52, this method quickly becomes slower
> and slower as you approach the 45th random value, as it's more and more
> likely that you keep hitting a value already taken.
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco