Over on the M20 boards, they are discussing a Tiny Dungeons Project.

Part of it mentions the critters.pl script greywulf hosted on the old m20 site. I couldn't find the original, but I found my modified script for M20 (my other post has it modified for Action!).

CODE:

#!/usr/bin/perl
srand(time ^ $$ ^ unpack "%L*", 'ps axww | gzip');
$usage="usage: $0 number maxhd\n";
$ARGV[0]=~/^(\d+)$/ && ($numb = $1) || die $usage;
$ARGV[1]=~/^(\d+)$/ && ($maxhd = $1) || die $usage;
%rule = (
'W','VF YF YF YXF YXF YXYF B',
'B','PB YNF YNXF YNXF YNXYF YXYNF',
'P','a ambi ante circum cis co de dis ob per prae se sine sub',
'Y','Ca Ce Ci Co Cu Cy Da De Di Do Dy',
'X','Ce Ci Co o',
'V','a e i o u',
'F','Ca Ca Ca Cae Cos Com Cus Cus Cus Cus Cus Cium Cium Ces',
'C','b b c c ch ch d d d g g l l m m n n p p ph r r r s s s t t th th v x z Rr sH Ll',
'D','b b c c ch ch d d g g l l m m n n p p ph r r r s s s t t t th th v x z Rr sH Ll h qu gn pt',
'R','b b c c c ch ch g g p p ph t t th th',
'L','c ch p g f',
'H','c ch cl m n p ph pl pr qu t th',
'N','n c l r'
);

for (1..$numb) { print &parse('W'), " : ", &stats, "\n"; }

sub parse {
$_=pop(@_);
/[^A-Z]/ && return $_;
@TMP=split(/\s+/, $rule{$_});
$_=splice(@TMP, rand @TMP, 1);
for (split('')) { print &parse($_); }
}

sub stats {
$tst = int(rand()*13)+1;
$hd = int(rand()*$maxhd)+1;
$hp = int($hd*4.5)+int(rand()*4*$hd);
$ac = 10+$hd+int(rand()*5);
$tohit = $hd+int(rand()*4);
$dmg = int(rand()*2)+1 . 'd' . (int(rand()*6)+1)*2 . (rand>0.6?'+':'-') . (int(rand()*4)+2);
%weapon = ( '1' => 'Bite',
'2' => 'Claw',
'3' => 'Talon',
'4' => 'Gore',
'5' => 'Slap',
'6' => 'Slam',
'7' => 'Sting',
'8' => 'Tentacle',
'9' => 'Weapon',
'10' => 'Weapon',
'11' => 'Weapon',
'12' => 'Weapon',
'13' => 'Weapon',);
$type = $weapon{$tst};
#    $type = (rand>0.6?"By weapon":"Natural");

return "HD$hd (${hp}hp), AC$ac, $type +$tohit ($dmg)";
}