Please use this for good, not evil. :)
%w=(0..9);srand;do{@c=&r?(&r?(4):(5,&r(5)+1)):(&r?(6,0, 1,1):(&r?(3,7):(3,4)));$t=0;for(1..($c[0]>5?12:($c[0]<4 ?13:($c[0]>4?14:15)))){push@c,r(10)}sub r{int rand(pop ||2)}for(0..$#c){$t+=$_%2?(sort(keys%w),sort(values%w)) [$c[$#c-$_]]:$c[$#c-$_]}}while($t%10);$[=3;print@c,' ', (A,V,M,D)[$c[3]],"\n"

Replies are listed 'Best First'.
Re: generate.pl
by KILNA (Acolyte) on Jan 23, 2002 at 15:48 UTC
    Just wanted to reply to this since I accidentally posted it anonymously so long ago. If anyone bothers to look this up and/org run it, it is quite possibly the world's ugliest random credit card number generator.