All pastes #542959 Raw Edit

nessie

public text v1 · immutable
·published 2007-06-05 23:52 UTC
rendered paste body
#!/usr/bin/perl -w
use strict;

print "Content-type: text/plain\n\n";

my @card = qw(2 3 4 5 6 7 8 9 T J Q K A);
my @suite = qw(h c d s);
my @num = (1 ... 52);


## Randomize
my @test; my $r; my $i;
for ($i=0; $i<52; $i++) {
	$r = int(rand(scalar(@num)));
	print scalar(@num)." ";
	push (@test, $num[$r]);
	delete $num[$r];
}

print "\n";
foreach(@test) {print $_ . " ";}
print "\n";

foreach(@test) { print $card[($_-1)%13] . $suite[int(($_-1)/13)] . " "; }