#!/usr/bin/perl

print "Content-type: TEXT/HTML\n\n";

@firsts = (dark, blood, night, shadow, black, death, dragon, hell, grave, crimson, raven, mage, iron, flame, skull, bone, dread, wolf, demon, doom, deep, cyber, storm, thunder, storm, hawk, ice, fire, shatter, winter, inferno, soul, steel, wraith, venom, viper, serpent, rage, thrash, gun, pain, mist, grim);
@seconds = (blade, shadow, wave, claw, soul, fang, dragon, shade, bane, lord, wolf, sword, dagger, master, raven, mage, wind, flame, knight, fist, talon, scythe, demon, thunder, storm, crusher, axe, hammer, hawk, forge, blaze, fire, slayer, scar, shroud, reaper, wraith, spawn, stone, fury, snake, gun, fall, fell, walker, rider, tooth, born, blood);
@places = (mountain, lair, keep, castle, island);

until (($first ne $second) and ($second ne $third) and ($third ne $fourth) and ($second ne $fourth) and ($fourth ne $fifth)) {
$first = uc($firsts[rand($#firsts + 1)]);
$second = uc($seconds[rand($#seconds + 1)]);
$third = uc($firsts[rand($#firsts + 1)]);
$fourth = uc($seconds[rand($#seconds + 1)]);
$fifth = uc($firsts[rand($#firsts + 1)]);
}
$place = uc($places[rand($#places + 1)]);

$fourthminuse = $fourth;
if ((substr $fourthminuse, -1) eq 'E')
{
    chop $fourthminuse;
}

@titles = (
    "$first$second: THE $fourth CHRONICLES",
    "$first$second: THE ${fourthminuse}ENING",
    "$first$second: TALES OF THE $third",
    "$first$second OF $third$fourth $place",
    "$first$second: $fourth of the $third",
    "$first$second: $fourth of the $third$first $second$fourth",
    "$first$second: $third of the $fourth$fifth",
    "$first ${second}s",
    "$first${second}s",
    "$first$second SON OF $third$fourth",
    "$first$second $third$fourth",
    "THE $first\'s $second"
    );

print '
<html>
<head>
<meta http-equiv="Refresh" content="10;">
</head>
<body style="background-color: black;">
<span style="font-size: 80px; font-family: Herculanum; color: red;">';


if (rand(10) > 6)
    {
    print $titles[rand($#titles + 1)];
    }
else
    {
    print "$first$second";
    }
print '</span>
</body>';