71 lines
1 KiB
Perl
71 lines
1 KiB
Perl
|
#!/usr/bin/perl
|
||
|
# Pajeet name generator (pajen.pl)
|
||
|
# Written by Ethan Marshall - 2024
|
||
|
# Material from https://desu-usergeneratedcontent.xyz/g/image/1705/80/1705808467048.png
|
||
|
|
||
|
use strict;
|
||
|
use diagnostics;
|
||
|
use warnings;
|
||
|
|
||
|
use Getopt::Long;
|
||
|
|
||
|
# Generated names consist of a prefix followed by a suffix
|
||
|
our @prefixes = (
|
||
|
"Pa",
|
||
|
"Ra",
|
||
|
"Ab",
|
||
|
"A",
|
||
|
"Na",
|
||
|
"Vi",
|
||
|
"Pra",
|
||
|
"Ku",
|
||
|
"Gi",
|
||
|
"Ha",
|
||
|
"San",
|
||
|
"Bel"
|
||
|
);
|
||
|
|
||
|
our @suffixes = (
|
||
|
"jeet",
|
||
|
"kesh",
|
||
|
"hul",
|
||
|
"jeesh",
|
||
|
"jesh",
|
||
|
"mit",
|
||
|
"mit",
|
||
|
"hesh",
|
||
|
"raj",
|
||
|
"nil",
|
||
|
"jith",
|
||
|
"tik"
|
||
|
);
|
||
|
|
||
|
sub fatal {
|
||
|
printf("%s\n", $_[0]);
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
sub usage {
|
||
|
fatal("Usage: pajen [-n count] [-ihu]")
|
||
|
}
|
||
|
|
||
|
# Command line options
|
||
|
my $count = 1;
|
||
|
my $infinite = '';
|
||
|
GetOptions(
|
||
|
'number=i' => \$count,
|
||
|
"infinite" => \$infinite,
|
||
|
"help|usage" => sub { usage() }
|
||
|
) or usage();
|
||
|
|
||
|
for (my $i = 0; $i < $count || $infinite; $i++) {
|
||
|
my $prefix = int(rand(@prefixes));
|
||
|
my $suffix = int(rand(@suffixes));
|
||
|
|
||
|
printf("%s%s\n", $prefixes[$prefix], $suffixes[$suffix]);
|
||
|
|
||
|
if ($infinite) {
|
||
|
(<stdin> eq "q\n") && exit(0);
|
||
|
}
|
||
|
}
|