xxxxxxxxxx
212
var input, button, reset, greeting;
function setup() {
removeElements();
// create canvas
createCanvas(650, 725);
background(20);
button = createButton('Click to Converse with the Cosmos!');
button.position(200, 300);
button.mousePressed(cosmosReply);
}
function draw() {
}
//The Cosmos will talk back
function cosmosReply() {
removeElements();
var grammar = tracery.createGrammar(grammarSource);
grammar.addModifiers(tracery.baseEngModifiers);
var output = grammar.flatten("#origin#");
background(20);
textSize(18);
fill(255);
text(output, 25, 200, width-50, height-40);
button = createButton('Back');
button.position(275, 450);
button.mousePressed(setup);
}
var grammarSource = {
"origin": [
"Our #posturings#, our imagined #selfImportance#, the #delusion# that we have some #privileged# position in the #Universe#, are #challenged# by this point of pale light. Our #planet# is a #lonely# speck in the #great# #enveloping# cosmic dark. In our #obscurity#, in all this #vastness#, there is no #hint# that #help# will come from elsewhere to save us from ourselves."
],
"posturings": [
"posturings", "putting on airs", "playacting",
"displaying",
"flaunting",
"showiness",
"exhibitions",
"struttings",
"brandishing",
"flourishing"
],
"selfImportance": [
"self-importance",
"vanity",
"pride",
"ego",
"presumptions",
"arrogance",
"self-glory",
"pretentions",
"selfishness"
],
"delusion": [
"delusion",
"conceit",
"fantasy",
"figment",
"fancy",
"dream",
"imagination",
"illusion",
"notion"
],
"privileged": [
"privleged",
"deserved",
"conceded",
"entitled",
"expected",
"claimed",
"rightful",
"authorized",
"legitimate",
"valid",
"licensed",
"certified"
],
"Universe": [
"universe",
"cosmos",
"macrocosm",
"firmament"
],
"challenged": [
"challenged",
"dared",
"provoked",
"taunted",
"confronted",
"defy",
"interrogated"
],
"planet": [
"planet",
"world",
"sphere",
"orb",
"globe"
],
"lonely": [
"lonely",
"solitary",
"isolated",
"detatched",
"segregated",
"lonesome",
"abandoned",
"single",
"remote",
"deserted"
],
"obscurity": [
"obscurity",
"dimness",
"dimness",
"ambiguity",
"uncertainty",
"unknowingness",
"darkness"
],
"vastness": [
"vastness",
"expanse",
"greatness",
"immenseness",
"hugeness",
"enormousness",
"immensity"
],
"great": [
"great",
"grand",
"vast",
"immense",
"terrible",
"enormous",
"considerable",
"extreme",
"numerous",
"voluminous",
"abundant",
"huge",
"ample"
],
"enveloping": [
"enveloping",
"blanketing",
"swathing",
"surrounding",
"encompassing",
"obscuring",
"enclosing",
"embracing",
"enshrouding",
"overlaying",
"concealing",
"enfolding",
"engulfing",
"cloaking"
],
"hint": [
"hint",
"clue",
"sign",
"idea",
"inkling",
"tip",
"pointer",
"token",
"impression",
"implication",
"evidence",
"allusion"
],
"help": [
"help",
"advice",
"support",
"service",
"succor",
"remedy",
"utility",
"cooperation",
"benefit",
"guidance",
"aid",
"hand",
"comfort"
]
}