Created
February 3, 2019 05:01
-
-
Save phenaproxima/a6bb1dc0a61ff28d2f2023dca78c8106 to your computer and use it in GitHub Desktop.
A Tamarian ipsum generator. Temba, his arms wide!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// This ipsum generator is adapted from code at | |
// https://hackernoon.com/creating-a-lorem-ipsum-generator-with-node-and-express-9e1af0b31c86 | |
// | |
// Tamarian phrases from http://memory-alpha.wikia.com/wiki/Tamarian_language | |
// | |
class DarmokIpsum | |
{ | |
constructor () | |
{ | |
this.sentences = [ | |
"The beast at Tanagra", | |
"Children of Tama", | |
"Chenza at court, the court of silence", | |
"Darmok and Jalad at Tanagra", | |
"Darmok and Jalad on the ocean", | |
"Darmok on the ocean", | |
"Picard and Dathon at El-Adrel", | |
"Kadir beneath Mo Moteh", | |
"Kailash, when it rises", | |
"Kiazi's children, their faces wet", | |
"Kira at Bashi", | |
"Kiteo, his eyes closed", | |
"Mirab, with sails unfurled", | |
"Rai and Jiri at Lungha", | |
"Rai of Lowani", | |
"Lowani under two moons", | |
"Jiri of Ubaya", | |
"Ubaya of crossroads, at Lungha", | |
"Lungha, her sky grey", | |
"The river Temarc in winter", | |
"Shaka, when the walls fell", | |
"Sokath, his eyes uncovered", | |
"Temba, at rest", | |
"Temba, his arms open", | |
"Uzani, his army with fists closed", | |
"Uzani, his army with fists open", | |
"Zima at Anzo", | |
"Zima and Bakor", | |
"Zinda, his face black, his eyes red", | |
]; | |
this.charactersPerParagraph = 350; | |
} | |
sentence () | |
{ | |
const i = Math.floor(Math.random() * this.sentences.length); | |
return this.sentences[i]; | |
} | |
paragraph () | |
{ | |
let p = ''; | |
while (p.length < this.charactersPerParagraph) | |
{ | |
p = p.concat(this.sentence() + '. '); | |
} | |
return p.trim(); | |
} | |
paragraphs (n) | |
{ | |
const p = []; | |
while (p.length < n) | |
{ | |
p.push(this.paragraph()); | |
} | |
return p; | |
} | |
} | |
console.log( new Darmok().paragraphs(3).join("\n\n") ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment