-
Notifications
You must be signed in to change notification settings - Fork 2
/
Misc.pm
65 lines (58 loc) · 3.24 KB
/
Misc.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package Random::Misc;
use v5.10.0;
use strict;
use warnings;
use Exporter qw(import);
use Fancy::Rand qw(fancy_rand);
our $VERSION = '1.000';
our @EXPORT_OK = qw(
random_misc
random_emotion
random_filesize_unit
random_game
random_group
random_mental_condition
random_non
random_relationship
random_sexual_orientation
random_shadow
random_sign
random_zstuff
);
my %misc = (
'emotions' => [qw(joy sorrow trust fear love hate indifference)],
'filesize units' => [qw(bit nibble byte kilobyte megabyte gigabyte terabyte petabyte exabyte zettabyte yottabyte)],
'games' => [map("$_ game", ('board', 'card', 'role-playing', 'video'))],
'groups' => [qw(group band cabal tribe caravan army)],
'mental conditions' => [
map("${_}active", qw(hypo hyper)),
map("$_ psychosis", qw(hallucinatory delusional)),
'addiction', 'amnesia', 'anxiety', 'catatonia', 'dementia', 'fugue', 'manic', 'melancholy',
'obsessive-compulsive', 'panic', 'paranoia', 'schizophrenia', 'split personality'
],
'non' => ['', 'non-'],
'relationships' => [qw(single dating attached engaged married divorced widowed)],
'sexual orientations' => [qw(heterosexual heteroflexible bisexual homoflexible homosexual pansexual polysexual asexual)],
'shadows' => [qw(umbra penumbra antumbra)],
'signs' => [qw(+ -)],
'zstuffs' => [qw(thing doodad doohickey gizmo widget thingamabob stuff)],
);
sub random_misc {
my ($user_misc, $user_additions) = @_;
my $misc = fancy_rand(\%misc, $user_misc, { caller => 'random_misc', additions => $user_additions ? $user_additions : undef });
return $misc;
}
sub random_emotion { my $user_addition = shift; random_misc('emotions' , $user_addition) }
sub random_filesize_unit { my $user_addition = shift; random_misc('filesize units' , $user_addition) }
sub random_game { my $user_addition = shift; random_misc('games' , $user_addition) }
sub random_group { my $user_addition = shift; random_misc('groups' , $user_addition) }
sub random_mental_condition { my $user_addition = shift; random_misc('mental conditions' , $user_addition) }
sub random_non { my $user_addition = shift; random_misc('non' , $user_addition) }
sub random_relationship { my $user_addition = shift; random_misc('relationships' , $user_addition) }
sub random_sexual_orientation { my $user_addition = shift; random_misc('sexual orientations', $user_addition) }
sub random_shadow { my $user_addition = shift; random_misc('shadows' , $user_addition) }
sub random_sign { my $user_addition = shift; random_misc('signs' , $user_addition) }
sub random_zstuff { my $user_addition = shift; random_misc('zstuffs' , $user_addition) }
# This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See https://dev.perl.org/licenses/artistic.html.
# Copyright © 2020, Lady Aleena (aleena@cpan.org). All rights reserved.
1;