On Wed, Nov 21, 2007 at 10:23:22PM -0500, nevthederanged@... wrote:
> If a program like this exists, surely someone here knows of it: I'm looking
> for a program or web app where I can enter values for cards in a deck and have
> them dealt randomly one at a time, while keeping track of the deck contents.
I wrote a program a couple of years back to simulate card draws for a
CCG I was playing. The perl to draw a card from the deck was:-
sub get_next_card {
my $deck=shift;
return splice(@$deck,rand(@$deck),1)
}
$deck is an (possibly ordered) array of cards.
TTFN
--
Roger. Home| http://www.sandman.uklinux.net/
Master of Peng Shui. (Ancient oriental art of Penguin Arranging)
Work|Independent Sys Consultant | http://www.computer-surgery.co.uk/
New key Fpr: 72AF 0ACC 9A53 E59F B1B6 DC14 1983 A13E 5C3D 3CEB