Help for this page

Select Code to Download


  1. or download this
    sub pin {
        srand;
        my $pin;
    ...
        }
        return $pin;
    }
    
  2. or download this
    my @counterexamples;
    my %digits = map { $_ => 1 } 0 .. 9;
    for ( 1 .. 10000 ) {
    ...
        or diag +Data::Dumper->Dump( [ \@counterexamples ], ['*bad_pins'] 
    +);
    ok !%digits, '... and all digits should be used'
        or diag sprintf "Unused digits are '%s'", join ', ', sort keys %di
    +gits;
    
  3. or download this
    sub pin {
        return sprintf "%04d" => int rand 10000;
    }