Skip to content

Latest commit

 

History

History
235 lines (152 loc) · 6.53 KB

Military.pod

File metadata and controls

235 lines (152 loc) · 6.53 KB

NAME

Random::Military returns a fictional and fantasy military unit.

VERSION

This document describes Random::Military version 1.0.

SYNOPSIS

use Random::Military qw(random_military random_military_by_location);

my $squad      = random_military('squad');
my $platoon    = random_military('platoon');
my $company    = random_military('company');
my $battallion = random_military('batallion');
my $regiment   = random_military('regiment');
my $brigade    = random_military('brigade');
my $division   = random_military('division');
my $army       = random_military('army');

my $village_military     = random_military_by_location('village');
my $small_town_military  = random_military_by_location('small town');
my $large_town_military  = random_military_by_location('large town');
my $barony_military      = random_military_by_location('barony');
my $county_military      = random_military_by_location('county');
my $duchy_military       = random_military_by_location('duchy');
my $grand_duchy_military = random_military_by_location('grand duchy');
my $kingdom_military     = random_military_by_location('kingdom');

DESCRIPTION

The functions of Random::Military will return a hash with the statistics of the selected military unit. The larger the military, the larger and deeper the hash will be. random_military and random_military_by_location must be imported into your script.

The hash for each unit and any subunits will include the leader of the unit, the amount of each subordinate type, and the total amount of soldiers in the unit. To see the full unit, use your favorite data dumping module.

random_military

random_military('<your option>');

Options

squad

random_military('squad');

The squad option returns a unit of 2 to 8 soldiers with a corporal as the leader.

platoon

random_military('platoon');

The platoon option returns a unit of 2 to 6 squads with a sergeant as the leader.

company

random_military('company');

The company option returns a unit of 2 to 4 platoons with a lieutenant as the leader.

batallion

random_military('batallion');

The batallion option returns a unit of 2 to 4 companies with a captain as the leader.

regiment

random_military('regiment');

The regiment option returns a unit of 2 to 4 batallions with a major as the leader.

brigade

random_military('brigade');

The brigade option returns a unit of 2 to 4 regiments with a colonel as the leader.

division

random_military('division');

The division option returns a unit of 2 to 4 brigades with a general as the leader.

army

random_military('army');

The army option returns a unit of 2 to 4 divisions with a king as the leader.

Samples

The following samples are provided so you can see what data will be returned to you. The data will get deeper as you generate larger miliary units.

squad sample

{
  "unit type"   => "squad",
  "unit leader" => "corporal",
  "soldiers"    => 4,
  "totals"      => { corporal => 1, soldiers => 4, total => 5 },
}

platoon sample

{
  "unit type"   => "platoon",
  "unit leader" => "sergeant",
  "unit"        => [
                     {
                       "unit type"   => "squad",
                       "unit leader" => "corporal",
                       "soldiers"    => 3,
                       "totals"      => { corporal => 1, soldiers => 3, total => 4 },
                     },
                     {
                       "unit type"   => "squad",
                       "unit leader" => "corporal",
                       "soldiers"    => 6,
                       "totals"      => { corporal => 1, soldiers => 6, total => 7 },
                     },
                     {
                       "unit type"   => "squad",
                       "unit leader" => "corporal",
                       "soldiers"    => 5,
                       "totals"      => { corporal => 1, soldiers => 5, total => 6 },
                     },
                     {
                       "unit type"   => "squad",
                       "unit leader" => "corporal",
                       "soldiers"    => 4,
                       "totals"      => { corporal => 1, soldiers => 4, total => 5 },
                     },
                     {
                       "unit type"   => "squad",
                       "unit leader" => "corporal",
                       "soldiers"    => 7,
                       "totals"      => { corporal => 1, soldiers => 7, total => 8 },
                     },
                   ],
  "totals"      => { sergeant => 1, corporal => 5, soldiers => 25, total => 31 },
}

army totals sample

{
  "totals" => {
                soldiers   => 18021,
                corporal   => 3591,
                sergeant   => 898,
                lieutenant => 295,
                captain    => 95,
                major      => 32,
                colonel    => 10,
                general    => 3,
                king       => 1,
                total      => 22946,
              },
}

random_military_by_location

random_military_by_location('<your option>');

random_military_by_location was written for fun even though it mimics random_military.

Options

village

random_military_by_location('village');

The village option returns a squad.

small town

random_military_by_location('small town');

The small town option returns a platoon.

large town

random_military_by_location('large town');

The large town option returns a company.

barony

random_military_by_location('barony');

The barony option returns a battalion.

county

random_military_by_location('county');

The county option returns a regiment.

duchy

random_military_by_location('duchy');

The duchy option returns a brigade.

grand duchy

random_military_by_location('grand duchy');

The grand duchy option returns a division.

kingdom

random_military_by_location('kingdom');

The kingdom option returns an army.

DEPENDENCIES

Random::Military depends on Games::Dice and Exporter.

AUTHOR

Lady Aleena

LICENSE AND COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

Copyright © 2020, Lady Aleena (aleena@cpan.org). All rights reserved.