#!/usr/bin/perl use strict; use warnings; my @begriffe = qw(eins zwei drei vier fuenf sechs sieben acht neun zehn); my $anzahlKaertchen = 200; # <-- max. 200 bitte! my %alleKaertchen; my $i = 1; while ($i <= $anzahlKaertchen) { my @vals = (0..9); my @kaertchen; for my $j (0..5) { my $rand = int(rand()*@vals); $kaertchen[$j] = $vals[$rand]; splice(@vals,$rand,1); } my $kaertchenID = join ("", sort @kaertchen); next if $alleKaertchen{$kaertchenID}; $alleKaertchen{$kaertchenID} = 1; print "Kaertchen Nr. " . $i . ":\n"; print "\t" . $begriffe[$_] . "\n" for @kaertchen; $i++; }