in reply to Generating random 6 digit numbers

use strict; my %numb; my @numb = (0..9); for (0..9999) { my $numb; $numb .= $numb[rand @numb] for 0..5; $numb{$numb}++; } my @unique; for (keys %numb) { push @unique,$_ if $numb{$_} == 1; } print scalar @unique, " unique values\n";

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: Generating random 6 digit numbers
by Aristotle (Chancellor) on Aug 25, 2002 at 20:43 UTC
    Is there a reason your variables are all numb? ;-)

    Makeshifts last the longest.