Old stuff/Perl/svn/scrabble/trunk/tests/Benchmarks/generate_echantillon.pl
(Deskargatu)
#!/usr/bin/perl -w
# g�n�re al�atoirement un array de mots � chercher ( 50 existants + 50 inexistants )
#
my $nonexistant = "ZFDSFSD";
my @echantillon = ();
my @words;
push @echantillon, ($nonexistant) x 50;
srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
open(DICCO,"<../..//api/dico/Complet.txt") or die "impossible d'ouvrir le dictionnaire\n";
while(<DICCO>) {
chomp;
push @words,$_;
}
close(DICCO);
for my $i (1..50) {
push @echantillon, $words[int rand(364370)];
}
print "taille de l'�chantillon : ", $#echantillon+1,"\n";
$,="\n";
#print @echantillon;