Originally Posted by
Redrobes
I am gonna go and see if I can Perl up your python Elite code.
Code:
my $ELITE = 1; # Set to 1 for Elite names, other for random names
my @seed = ($ELITE == 1) ? (0x5A4A, 0x0248, 0xB753)
: (int(rand(0xffff)), int(rand(0xffff)), int(rand(0xffff)));
sub tweakseed() {
push @seed, ($seed[0] + $seed[1] + $seed[2]) % 0x10000;
shift @seed;
}
my $digraphs = "..lexegezacebisousesarmaindirea.eratenberalavetiedorquanteisrion";
sub name() {
my $longnameflag = $seed[0] & 0x40;
my $name = "";
foreach my $n (0 .. 3) {
my $d = (($seed[2] >> 8) & 0x1f) << 1;
tweakseed();
if ($n < 3 || $longnameflag) {
$name .= substr($digraphs, $d, 2);
}
}
$name =~ s/\.//g;
$name =~ s/^(.)/\U$1/;
return $name;
}