My homework is to write a Martian essay (see below) between 729 and 810 words, inclusive. Your task is to write a program that will generate the essay.
History
Around the turn of the 20th century, spiritualist Catherine-Elise Müller allegedly communicated with Martians. During somnambulatory trances, she would write out Martian scripts. Psychologist Théodore Flourney discovered her Martian writings were very similar to her native French, and in his book "From India to the Planet Mars", he documented Catherine's Martian alphabet.
The following is loosely based on that alphabet with an extended mythos.
Problem Description
The Martian language has 21 letters, shown here next to each Latin equivalent:
Unfortunately, there's no Unicode for Martian (despite Mars being part of the universe), so we're stuck using Latin characters.
Whereas in English our phonemes break out into two major types (consonants/vowels) which we loosely map to letters, Martian has three letter types:
- The vowels: a e i m n o u
- The hard consonants: b c d g k p t
- The soft consonants: f h l r s v z
In addition to this, the Martian language contains a single punctuation mark--the period.
A Martian word is a set of 3 to 9 letters. All Martian words have at least one vowel, one hard consonant, and one soft consonant (in any arrangement). For example, fng
, cdaz
, vpi
, and pascal
are Martian words.
A Martian sentence is a set of 3 to 9 Martian words delimited by spaces and followed by a period.
A Martian paragraph is a set of 3 to 9 Martian sentences delimited by spaces and followed by a newline.
A Martian essay is a collection of Martian paragraphs that contains no contiguous word repetitions.
A contiguous word repetition is any construct S S where S is a contiguous set of words. Note that this definition ignores sentence and paragraph boundaries.
Examples
Please note: There's a single trailing newline following each example (since all Martian paragraphs end in a newline)
Not Martian essay
lorem ipsum dolor sit amet. quis nostrud exercitation ullamco laboris.
...for many reasons. This example is to illustrate some miscellaneous rules:
- lorem is not a Martian word because it has no hard consonants.
- amet is not a Martian word because it has no soft consonants. (
m
is a Martian vowel). - quis is not a Martian word because it has no hard consonants
- quis is not a Martian word because q is not a Martian letter
- exercitation is not a Martian word because it has more than 9 letters
- exercitation is not a Martian word because x is not a Martian letter
Martian essay
fng cdaz vpi. pascal broke basic. popplers taste great.
...because it is a Martian paragraph. The Martian paragraph contains three Martian sentences.
Not Martian essay
fng cdaz vpi. pascal broke basic. free pascal rules.
...since free pascal rules.
is not a Martian sentence, because neither free
nor rules
are Martian words, because they do not have any hard consonants.
Martian essay
fng cdaz vpi. pascal broke basic. popplers taste great. cdaz vpi fng. basic breaks pascal. popplers punch hard. fng cdaz vpi.
...which contains two Martian paragraphs. The sentence fng cdaz vpi.
appears twice, but that's perfectly fine.
Not Martian essay
popplers taste fng. cdaz vpi pascal. broke fng cdaz vpi. pascal broke omicron planets. basic scares goats. vpi piv vpi.
...because the construct fng. cdaz vpi pascal. broke fng cdaz vpi. [nl] pascal broke
is a contiguous word repetition.
Challenge
Your challenge is to write a function or program that accepts no input, which produces as its output my homework; that is, your program should generate a Martian essay between 729 and 810 words (inclusive). Keep in mind, your program's output must be a valid Martian essay, but you don't have to generate it randomly or different each time. Anything you do to generate a valid Martian essay counts.
I've written a C++ program to check essays that you're allowed to use.
This is code golf. Shortest code in bytes wins. Standard loopholes disallowed.