pajenerator/pajen.pl

71 lines
1 KiB
Perl
Raw Permalink Normal View History

2024-01-23 00:55:15 +01:00
#!/usr/bin/perl
# Pajeet name generator (pajen.pl)
2024-01-23 01:17:35 +01:00
# Written by ejv2 - 2024
2024-01-23 00:55:15 +01:00
# 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);
}
}