#!/usr/bin/env python
# -*- python-mode -*-
# -*- coding: UTF-8 -*-
###########################################################################
######################## Random latin hexameters #########################
###########################################################################
##
## o author: Richard Everson (R.M.Everson@exeter.ac.uk)
## o created: 2011-04-12 23:16:46+00:40

from random import choice
from string import upper, capitalize, join


wordtable = [
    ['turbida', 'ignea', 'pessima', 'horrida', 'aspera', 'martia', 'barbara', 'lurida', 'effera'],
    ['fata', 'signa', 'damna', 'bella', 'vincla', 'sistra', 'castra', 'scorta', 'tela'],
    ['sequi', 'foris', 'pati', 'tuis', 'domi', 'patet', 'puto', 'palam', 'ferunt'],
    ['praemonstrant', 'proritant', 'promittunt', 'portendunt', 'producunt',
     'monstrabunt', 'causabunt', 'praenarrant', 'promulgant'],
    ['tempora', 'pocula', 'praelia', 'verbera', 'lumina', 'faedera', 'agmina',
     'crimina', 'sidera'],
    ['dura', 'saepe', 'quaedam', 'acerba', 'prava', 'multa', 'dira', 'nigra',
     'saeva']
    ]

h = " ".join([ choice(word) for word in wordtable ]).upper().capitalize()

print """Content-Type: text/html



<html>
<head>
<title>Random Latin Hexameters</title>
</head>
<body>

<h2>Random Latin Hexameters</h2>

<blockquote>
     <font size="5" color="blue"> %s <font color="black" size="3">
</blockquote>
""" % h

print """
<p>
This is a randomly generated latin hexameter generated using tables dating back to the 1700s.   There are nine possible choices for each of the six words, making a possible 531441 hexameters.
</p>

<p>
Reload the page to get another one
</p>
</html>
"""

