User Tools

Site Tools


kurs:lotto2.pl
use strict;
use warnings;

my $range = 45;
my @zahlen;
my $d = 0;
for (my $i = 1; $i<= 6; $i++) {
    my $z = int(rand($range))+1;    
    if (grep {$_ == $z} @zahlen) {
       $d++; 
       redo;
    }
    push (@zahlen, $z);
    print "$i $z\n";
}

print "mehrfach $d\n";
kurs/lotto2.pl.txt · Last modified: 2014/09/10 21:22 (external edit)