// Returns an array of traces, each different from the one preceding it unless retrace() maxes out attempts.\n\nwindow.traceArray = function(symbol, num){\n\tvar output = [];\n\toutput.push( trace(symbol) );\n\n\tfor (var i = 1; i < num; i++) {\n\t\toutput.push( retrace(symbol, output[i-1]) );\n\t};\n\n\treturn output;\n}
<table><tr><td>\nNo matter which path you choose, the hallway continues unfurling before you, with its [[absent shadows and windows of bent glass.]]\n</td></tr></table>
<table><tr><td>\n[[ding!]]\n</td></tr></table>
<table><tr><td>\n<<trace "page17">>\n\n<center>[[BACKWARD|p16]] | [[FORWARD|p18]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page18">>\n\n<center>[[BACKWARD|p17]] | [[FORWARD|p20]]</center>\n</td></tr></table>
Aidan\nTyler\nStefano\nBuckley\nKai\nFynn\nCameron\nBrady\nLuke\nChristian\nHayley\nMadison\nBrie\nCiara\nJordan\nMegan\nNicole\nAmanda\nAshley
<table><tr><td>\nThe doors open. You are now on the roof of the building, beyond which is nothing but the sea, flat as milk, and upon its surface islands in the shape of\n\n[[secrets|islands][$horizon = "furtive"]]\n[[<<print $walk>>|islands][$horizon = "ambiguous"]]\n[[clouds|islands][$horizon = "inscrutable"]]\n[[prisons|islands][$horizon = "carceral"]]\n[[orchids|islands][$horizon = "violet"]]\n</td></tr></table>
<table><tr><td>\n<center>\nSELECT A STORY\n<P></P>\n- <<if visited("THE DREAM")>>THE DREAM (after Dara Wier)<<else>>[[THE DREAM (after Dara Wier)|THE DREAM]]<<endif>> -\n<P></P>\n- <<if visited("SO ARE THE DAYS")>>SO ARE THE DAYS<<else>>[[SO ARE THE DAYS]]<<endif>> -\n<P></P>\n- <<if visited("THE BOOK OF SAND")>>THE BOOK OF SAND<<else>>[[THE BOOK OF SAND]]<<endif>> -\n<p></p>\n- <<if visited("A STRANGER WHOSE NAME I DON'T KNOW")>>A STRANGER WHOSE NAME I DON'T KNOW<<else>>[[A STRANGER WHOSE NAME I DON'T KNOW]]<<endif>> -\n\n<p></p>\n<p></p>\n\n</center>\n</td></tr></table>
<<if $key is false>><table><tr><td>\n''Throne room''\nYou feel the winged bulls watching you as you enter a long, narrow room with a throne at one end. On the walls are painted reliefs depicting a procession of figures approaching a king. As you approach the throne, the painting on its base becomes clearer: a king in his chariot, crushing the bodies of slain enemies. \n\n<p></p>\n<<replace "A king is here.">>"WHO ARE YOU?"<<endreplace>>\n\n<<replace "A general is here.">>"GO NOW. GO!"<<endreplace>>\n\n<<replace "A governor is here.">>"WHERE HAVE YOU COME FROM?"<<endreplace>>\n\n<<replace "A diviner is here.">>"GO NOW. GO!"<<endreplace>>\n\n<<replace "A scribe is here.">>"WHY HAVE YOU COME HERE?"<<endreplace>>\n\n<<replace "A scholar is here.">>"GO NOW. GO!"<<endreplace>>\n\n<p></p>\nYou can go [[south|monastery]] from here.\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Throne room''\nYou feel the winged bulls watching you as you enter a long, narrow room with a throne at one end. On the walls are painted reliefs depicting a procession of figures approaching a king. As you approach the throne, the painting on its base becomes clearer: a king in his chariot, crushing the bodies of slain enemies. \n\nThe sound of your own breathing seems to echo off the walls.\n\n<p></p>\nYou can go [[south|monastery]] from here.\n\n</td></tr></table>\n<<endif>>
<table><tr><td>\n[[19]]\n</td></tr></table>
So Are the Days
<table><tr><td>\n“Very well. This way, please!” Dr. Tasaka steps aside, revealing an [[elevator.]] “Have a nice journey, and remember: oral hygiene is an important aspect of your overall health!” \n</td></tr></table>
String.prototype.contains = function(substring){\n\tif (substring.constructor === Array){\n\t\tfor (var i = 0; i < substring.length; i++){\n\t\t\tif(this.contains(substring[i])){\n\t\t\t\treturn substring[i]; // Non-empty string evaluates to true\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t} else {\n\t\treturn this.indexOf(substring) > 0;\n\t}\n}
Griffin\nTyrell\nSterling\nSloane\nWinston\nKenyon\nClayton\nAtwater
<table><tr><td>\n<<trace "page10">>\n\n<center>[[BACKWARD|p9]] | [[FORWARD|p11]]</center>\n</td></tr></table>
<table><tr><td>\nAll summer long, the residents of Crestview were haunted by a vague but persistent sense of <<print either("loss","foreboding")>> that they were never able to fully articulate. \n\n<center>[[BACKWARD|p10]] | [[FORWARD|p12]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page12">>\n\n<center>[[BACKWARD|p11]] | [[FORWARD|p13]]</center>\n</td></tr></table>
window.grammar = function(rule){\n\treturn tale.get(rule).text.split('\sn');\n}
<table><tr><td>\n<<trace "page14">>\n\n<center>[[BACKWARD|p13]] | [[FORWARD|p15]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page15">>\n\n<center>[[BACKWARD|p14]] | [[FORWARD|p16]]</center>\n</td></tr></table>
<table><tr><td>\nThe hot wind seemed to curdle the waves. Everyone was nostalgic and preoccupied, forever on the verge of remembering something. \n\n<center>[[BACKWARD|p15]] | [[FORWARD|p17]]</center>\n</td></tr></table>
Jordan\nMegan\nNicole\nAmanda\nAshley
Aidan\nTyler\nStefano\nBuckley\nKai
<<if $key is false>><table><tr><td>\n''Pavilion''\nFlowers, vines, and interlocking stars in paint and gilt cover the columns and ceiling of this room. A large, mirrored niche casts slivers of light across the many carpets laid across the floor. Within the niche, a small fountain trickles.\n\n<p></p>\n<<replace "A poet is here.">>"IF YOU FOLLOW A MIRAGE..."<<endreplace>>\n\n<<replace "A servant is here.">>"THE DESERT WILL SWALLOW YOU."<<endreplace>>\n\n<<replace "An ambassador is here.">>"IF YOU INSIST ON GOING..."<<endreplace>>\n\n<<replace "A scholar is here.">>"I’LL WAIT FOR YOU HERE."<<endreplace>>\n\n<<replace "A musician is here.">>"WHO ARE YOU?"<<endreplace>>\n\n<<replace "A vizier is here.">>"WHY ARE YOU HERE?"<<endreplace>>\n\n<<replace "An entertainer is here.">>"GO NOW. GO!"<<endreplace>>\n\n<<replace "An artist is here.">>"THIS THIRST DRIVES ME MAD."<<endreplace>>\n\n<<replace "A courtier is here.">>"I KNOW NOT WHAT IT WILL MAKE ME DO."<<endreplace>>\n\n<p></p>\nYou can go [[west|saloon]] from here.\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Pavilion''\nFlowers, vines, and interlocking stars in paint and gilt cover the columns and ceiling of this room. A large, mirrored niche casts slivers of light across the many carpets laid across the floor. Within the niche, a small fountain trickles.\n\nThe sound of the fountain reminds you of rain.\n\n<p></p>\nYou can go [[west|saloon]] from here.\n\n</td></tr></table>\n<<endif>>
Fynn\nCameron\nBrady\nLuke\nChristian
<table><tr><td>\nand [[this way again...]]\nor [[that way...|this way again...]]\nor [[another way altogether...|this way again...]]\n</td></tr></table>\n
<table><tr><td>\nspread out across it are 32 perfectly round, white, [[moons.]]\n</td></tr></table>
<table><tr><td>\n[[4]]\n</td></tr></table>
<<traceryInit>>
<table><tr><td>\n[[183]]\n</td></tr></table>
Aidan\nTyler\nStefano\nBuckley\nKai\nFynn\nCameron\nBrady\nLuke\nChristian
<table><tr><td>\nand you go \n\n[[this way]]\nor [[that way]]\n</td></tr></table>\n
<table><tr><td>\n e e e e e e e . e e e, e e e e e e e .\n\n e e e e e e e , e ee e : e e . e e , e e e ee e e . e, e e e e e e e e e e e e . e e e e e e e e e e . \n\n e e e : e e e e e ; a e , ; e e e , e-- e e e e e e e e . e , e e .\n\n e e e ’ e , e e . e e e , e- e e . e e, e e e , e e e , e e e .\n\n\n\n\n\n<center>[ [[-|ch3-1]] + [[-|ch3-3]] [[-|ch3-4]] [[-|ch3-5]] [[-|ch3-6]] [[-|ch3-7]] [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\nT e e e e et e e . e e t e, e e t t e e e e t e t.\n\n e t e e e e te e t , t e ee t e : e e . e te , t e e t e ee t e e . e, e t t e e t e e e e e e e t t e e t . T e e e t e t e t e t e e e e . \n\nT e t e e : e t t e e te e ; a e , ; e e e , e-- t t ete e e e t e tte e . t e , e e t .\n\n e e t e ’ et, t e e . e e te , e- e t t e t t. e e, e t e e , t t e e e , te t t e e t .\n\n\n\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] + [[-|ch3-4]] [[-|ch3-5]] [[-|ch3-6]] [[-|ch3-7]] [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\n ; . , .\n\n , : . , . , . . \n\n : ; , ; , -- . , .\n\n ’ , . , - . , , , .\n\n\n<CENTER><<if visited("THE DREAM", "SO ARE THE DAYS", "A STRANGER WHOSE NAME I DON'T KNOW")>>[[THE END|epilogue]]<<else>>[[THE END|menu]]<<endif>></CENTER>\n\n\n<center>[ + [[-|ch3-2]] [[-|ch3-3]] [[-|ch3-4]] [[-|ch3-5]] [[-|ch3-6]] [[-|ch3-7]] [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\nT e e as on e a in o e a anet en i e an oons. e a a ea ti i e, o e on ine to t e o n s o is a a e eans o en ant ent.\n\nIn o e to a e e i e o e inte estin , t e een too a o e : a so e ess. One a te noon, t e in a e on t e een it e o e . In a a e, e t t ei o ies into a n e ie es an a ea ie e sent to a i e ent oon. T e ie es a n ist e on t e st an si ent na s a e o se e a ea s. \n\nT en a io s t in a ene : o ea oot t e e s o te a e ; o ea in e , a an ; o ea e e a , a a e--an so on an so o t nti a o ete o as o e o ea one o t e s atte e i s. An on t ose oons, i e e an to o is .\n\n ean i e on t e in ’s anet, no ant o ani a as e e o n a ain. O eans e a o ate , on e- i o ests t ne to st. One one, a i in eat es ie , nti on t e in e aine , an soon a te t at e ie too.\n\n\n\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] [[-|ch3-3]] [[-|ch3-4]] [[-|ch3-5]] + [[-|ch3-7]] [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<<if !tale.grammar>>\n\t<<if tracery>>\n\t\t<<set tale.grammar = tracery.createGrammar(tale.story.data)>>\n\t\t<<print console.log("grammar: ", tale.grammar)>>\n\t<<else>>\n\t\t<<print console.log("grammar instantiation failed")>>\n\t<<endif>>\n<<endif>>
<table><tr><td>\nT e e a e a e a a et e e a . e a a ea t e, e e t t e a a e ea e a t e t.\n\n e t a e e e e te e t , t e ee t a e : a e e . e a te , t e a e t e ee t e e . a a e, e t t e e t a e e e a a ea e e e t t a e e t . T e e e a t e t e t a e t a a e e e a ea . \n\nT e a t a e e : ea t t e e te a e ; ea e , a a ; ea e e a , a a e--a a t t a ete a e ea e t e atte e . A t e , e e a t .\n\n ea e t e ’ a et, a t a a a e e a a . ea e a ate , e- e t t e t t. e e, a eat e e , t t e e a e , a a te t at e e t .\n\n\n\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] [[-|ch3-3]] + [[-|ch3-5]] [[-|ch3-6]] [[-|ch3-7]] [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\nT e e a o e a i o e a a et e i e a oo . e a a ea ti i e, o e o i e to t e o o i a a e ea o e a t e t.\n\nI o e to a e e i e o e i te e ti , t e ee too a o e : a o e e . O e a te oo , t e i a e o t e ee it e o e . I a a e, e t t ei o ie i to a e ie e a a ea ie e e t to a i e e t oo . T e ie e a i t e o t e t a i e t a a e o e e a ea . \n\nT e a io t i a e e : o ea oot t e e o te a e ; o ea i e , a a ; o ea e e a , a a e--a o o a o o t ti a o ete o a o e o ea o e o t e atte e i . A o t o e oo , i e e a to o i .\n\n ea i e o t e i ’ a et, o a t o a i a a e e o a ai . O ea e a o ate , o e- i o e t t e to t. O e o e, a i i eat e ie , ti o t e i e ai e , a oo a te t at e ie too.\n\n\n\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] [[-|ch3-3]] [[-|ch3-4]] + [[-|ch3-6]] [[-|ch3-7]] [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\nits [[restless silence...]]\n</td></tr></table>
<table><tr><td>\nThere was once a in who ruled a lanet encircled man moons. He had a eauti ul wi e, who he con ined to the rounds o his alace means o enchantment.\n\nIn order to ma e her li e more interestin , the ueen too a lo er: a sorceress. One a ternoon, the in came u on the ueen with her lo er. In a ra e, he cut their odies into a hundred ieces and had each iece sent to a di erent moon. The ieces la undistur ed on the dust and silent lunar sur ace or se eral ears. \n\nThen a curious thin ha ened: rom each oot there s routed a le ; rom each in er, a hand; rom each e e all, a ace--and so on and so orth until a com lete od was ormed rom each one o the scattered lim s. And on those moons, li e e an to lourish.\n\nMeanwhile on the in ’s lanet, no lant or animal was e er orn a ain. Oceans e a orated, once-humid orests turned to dust. One one, all li in creatures died, until onl the in remained, and soon a ter that he died too.\n\n\n\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] [[-|ch3-3]] [[-|ch3-4]] [[-|ch3-5]] [[-|ch3-6]] [[-|ch3-7]] + [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\nThere was once a king who ruled a planet encircled by many moons. He had a beautiful wife, who he confined to the grounds of his palace by means of enchantment.\n\nIn order to make her life more interesting, the queen took a lover: a sorceress. One afternoon, the king came upon the queen with her lover. In a rage, he cut their bodies into a hundred pieces and had each piece sent to a different moon. The pieces lay undisturbed on the dusty and silent lunar surface for several years. \n\nThen a curious thing happened: from each foot there sprouted a leg; from each finger, a hand; from each eyeball, a face--and so on and so forth until a complete body was formed from each one of the scattered limbs. And on those moons, life began to flourish.\n\nMeanwhile on the king’s planet, no plant or animal was ever born again. Oceans evaporated, once-humid forests turned to dust. One by one, all living creatures died, until only the king remained, and soon after that he died too.\n\n\n<CENTER><<if visited("THE DREAM", "SO ARE THE DAYS", "A STRANGER WHOSE NAME I DON'T KNOW")>>[[THE END|epilogue]]<<else>>[[THE END|menu]]<<endif>></CENTER>\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] [[-|ch3-3]] [[-|ch3-4]] [[-|ch3-5]] [[-|ch3-6]] [[-|ch3-7]] [[-|ch3-8]] +]</center>\n</td></tr></table>\n
<table><tr><td>\nAs the elevator ascends, you realize that you are hungry. \n\nIt is not the type of hunger that can be satisfied by a sandwich and a coke and a bag of chips; rather, it is an appetite of a slightly more existential sort, and it seems like the higher you go the more [[ravenous]] you get. \n</td></tr></table>
<table><tr><td>\nAnd by the end of the year, Crestview had all but disappeared, destroyed first by the fires, then washed away by the winter rains. For as we all know, few things in this world are more relentless than water making its way to the sea. \n\n<center><<if visited("THE DREAM", "THE BOOK OF SAND", "A STRANGER WHOSE NAME I DON'T KNOW")>>[[THE END|epilogue]]<<else>>[[THE END|menu]]<<endif>></center>\n</td></tr></table>
<table><tr><td>\nThe following day the entire block of <<print either("4","5","6","7","8","9","10")>>th and <<print either("Elm","Cedar","Birch","Alder","Pine","Oak")>> was set on fire.\n\n<center>[[BACKWARD|p20]] | [[FORWARD|p22]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page20">>\n\n<center>[[BACKWARD|p18]] | [[FORWARD|p21]]</center>\n</td></tr></table>
// This is a slightly modified version of Leon Arnott's cyclinglink macro.\n\nversion.extensions.tracelinkMacro = {\n\tmajor: 0,\n\tminor: 1,\n\trevision: 0\n};\nmacros.tracelink = {\n\thandler: function(a, b, c) {\n\t\tvar rl = "traceLink";\n\n\t\tfunction toggleText(w) {\n\t\t\tw.classList.remove("traceLinkInit");\n\t\t\tw.classList.toggle(rl + "Enabled");\n\t\t\tw.classList.toggle(rl + "Disabled");\n\t\t\tw.style.display = ((w.style.display == "none") ? "inline" : "none")\n\t\t}\n\t\tswitch (c[c.length - 1]) {\n\t\t\tcase "end":\n\t\t\t\tvar end = true;\n\t\t\t\tc.pop();\n\t\t\t\tbreak;\n\t\t\tcase "out":\n\t\t\t\tvar out = true;\n\t\t\t\tc.pop();\n\t\t\t\tbreak\n\t\t}\n\t\tvar v = "";\n\t\tif (c.length && c[0][0] == "$") {\n\t\t\tv = c[0].slice(1);\n\t\t\tc.shift()\n\t\t}\n\t\tvar h = state.history[0].variables;\n\t\tif (out && h[v] === "") {\n\t\t\treturn\n\t\t}\n\t\tvar l = Wikifier.createInternalLink(a, null);\n\t\tl.className = "internalLink cyclingLink";\n\t\tl.setAttribute("data-cycle", 0);\n\n\t\t// Prebake a bunch of traces and use those as our links to cycle through.\n\t\tc = traceArray(c[0], 64);\n\n\t\tfor (var i = 0; i < c.length; i++) {\n\t\t\tvar on = (i == Math.max(c.indexOf(h[v]), 0));\n\t\t\tvar d = insertElement(null, "span", null, "traceLinkInit traceLink" + ((on) ? "En" : "Dis") + "abled");\n\t\t\tif (on) {\n\t\t\t\th[v] = c[i];\n\t\t\t\tl.setAttribute("data-cycle", i)\n\t\t\t} else {\n\t\t\t\td.style.display = "none"\n\t\t\t}\n\t\t\tinsertText(d, c[i]);\n\t\t\tif (on && end && i == c.length - 1) {\n\t\t\t\tl.parentNode.replaceChild(d, l)\n\t\t\t} else {\n\t\t\t\tl.appendChild(d)\n\t\t\t}\n\t\t}\n\t\tl.onclick = function() {\n\t\t\tvar t = this.childNodes;\n\t\t\tvar u = this.getAttribute("data-cycle") - 0;\n\t\t\tvar m = t.length;\n\t\t\ttoggleText(t[u]);\n\t\t\tu = (u + 1);\n\t\t\tif (!(out && u == m)) {\n\t\t\t\tu %= m;\n\t\t\t\tif (v) {\n\t\t\t\t\th[v] = c[u]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\th[v] = ""\n\t\t\t}\n\t\t\tif ((end || out) && u == m - (end ? 1 : 0)) {\n\t\t\t\tif (end) {\n\t\t\t\t\tvar n = this.removeChild(t[u]);\n\t\t\t\t\tn.className = rl + "End";\n\t\t\t\t\tn.style.display = "inline";\n\t\t\t\t\tthis.parentNode.replaceChild(n, this)\n\t\t\t\t} else {\n\t\t\t\t\tthis.parentNode.removeChild(this);\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttoggleText(t[u]);\n\t\t\tthis.setAttribute("data-cycle", u)\n\t\t}\n\t}\n};
<table><tr><td>\n<<trace "page22">>\n\n<center>[[BACKWARD|p21]] | [[FORWARD|p23]]</center>\n</td></tr></table>
<table><tr><td>\nThis hunger, it has a name\n\nand its name is [[you forgot what its name is.|hunger][$hunger = "you forgot"]]\nand its name is [[what does it matter what its name is?|hunger][$hunger = "is insignificant"]]\nand its name is [[seriously who cares?|hunger][$hunger = "is insignificant"]]\nand its name is [[any name will do.|hunger][$hunger = "is anything"]]\nand its name is [[ok fine, death.|hunger][$hunger = "is death"]]\nand Its name is [[desire.|hunger][$hunger = "is desire"]]\nand Its name is [[capitalism.|hunger][$hunger = "is capitalism"]]\nand its name is [[nothing.|hunger][$hunger = "is nothing"]]\n</td></tr></table>
jquery:on\nhash:off\nbookmark:off\nmodernizr:off\nundo:on\nobfuscate:off\nexitprompt:off\nblankcss:on\n
<table><tr><td>\n//So Are the Days// was created on Hawaiian land. To learn more about ongoing land struggles in Hawai'i, visit [[Pu'uhonua o Pu'uhuluhulu|https://www.puuhuluhulu.com/learn]] and [[KAHEA: The Hawaiian-Environmental Alliance|http://kahea.org/issues/sacred-summits]]. The [[Hawai'i People's Fund|https://www.hawaiipeoplesfund.org/]] supports progressive, grassroots organizations in Hawai'i. \n\n//So Are the Days// is a back-garden entry in the [[2020 Spring Thing Festival of Interactive Fiction|https://www.springthing.net/2020/]]. It is part of the [[Orange Juice Public Library's|http://ojpl.org/]] division of [[Games and Such|http://ojpl.org/games.html]].\n\nIt was created in [[Twine 1.4.2|https://twinery.org/]], and uses [[Twinecery|https://github.com/mrfb/twinecery]], Matthew R. F. Balousek's Twine adaptation of GalaxyKate's [[Tracery|http://www.tracery.io/]] text generation tool. It also uses L's [[Replace macro set|https://www.glorioustrainwrecks.com/node/5462]]. Backgrounds were created using Adam Le Doux's [[Bitsy Game Maker|https://ledoux.itch.io/bitsy]]; font is Star Perv from [[Anna Anthropy's World of Fonts|https://w.itch.io/world-of-fonts]].\n\nThank you to beta testers Genevieve Manset and Sadie Rosen.\n\nYou can find more of my work at [[lavieenmeow.blog|https://lavieenmeow.blog]].\n\n<p></p>\n</td></tr></table>
<table><tr><td>\n<center><img src="title3.gif" width="450" alt="So Are the Days in old school NES font">\n<p></p>\n4 stories about sand\nby Dawn Sueoka\n\n<p></p>\n[[NEW GAME|menu]]\n\n<p></p>\n//cw: mental health, passing references to alcohol and drug use\n\nThis game has no sound effects.//</center>\n</td></tr></table>
<table><tr><td>\n<center>“While he mused on the effect of the flowing sands, he was seized from time to time by hallucinations in which he himself began to move with the flow.” \n\n--Kobo Abe, //The Woman in the Dunes//\n\n[[START|ch2]]</center>\n\n</td></tr></table>
<table><tr><td>\nIt is the most beautiful thing you’ve ever seen.\n\nAnd you think to yourself, [[well,]]\n</td></tr></table>
<table><tr><td>\nAs you move through the water, you think about this building, with its [[infinite hallways and empty rooms,]] \n</td></tr></table>
window.tracery = {\n utilities : {}\n};\n\n(function () {/**\n * @author Kate Compton\n */\n\nfunction inQuotes(s) {\n return '"' + s + '"';\n};\n\nfunction parseAction(action) {\n return action;\n};\n\n// tag format\n// a thing to expand, plus actions\n\nfunction parseTag(tag) {\n var errors = [];\n var prefxns = [];\n var postfxns = [];\n\n var lvl = 0;\n var start = 0;\n\n var inPre = true;\n\n var symbol,\n mods;\n\n function nonAction(end) {\n if (start !== end) {\n var section = tag.substring(start, end);\n if (!inPre) {\n errors.push("multiple possible expansion symbols in tag!" + tag);\n } else {\n inPre = false;\n var split = section.split(".");\n symbol = split[0];\n mods = split.slice(1, split.length);\n }\n\n }\n start = end;\n };\n\n for (var i = 0; i < tag.length; i++) {\n var c = tag.charAt(i);\n\n switch(c) {\n case '[':\n if (lvl === 0) {\n nonAction(i);\n }\n\n lvl++;\n break;\n case ']':\n lvl--;\n if (lvl === 0) {\n var section = tag.substring(start + 1, i);\n if (inPre)\n prefxns.push(parseAction(section));\n else\n postfxns.push(parseAction(section));\n start = i + 1;\n }\n break;\n\n default:\n if (lvl === 0) {\n\n }\n break;\n\n }\n }\n nonAction(i);\n\n if (lvl > 0) {\n var error = "Too many '[' in rule " + inQuotes(tag);\n errors.push(error);\n\n }\n\n if (lvl < 0) {\n var error = "Too many ']' in rule " + inQuotes(tag);\n errors.push(error);\n\n }\n\n return {\n preActions : prefxns,\n postActions : postfxns,\n symbol : symbol,\n mods : mods,\n raw : tag,\n errors : errors,\n };\n};\n\n// Split a rule into sections\nfunction parseRule(rule) {\n var sections = [];\n var errors = [];\n if (!( typeof rule == 'string' || rule instanceof String)) {\n errors.push("Cannot parse non-string rule " + rule);\n sections.errors = errors;\n return sections;\n }\n\n if (rule.length === 0) {\n return [];\n }\n\n var lvl = 0;\n var start = 0;\n var inTag = false;\n\n function createSection(end) {\n var section = rule.substring(start, end);\n if (section.length > 0) {\n if (inTag)\n sections.push(parseTag(section));\n else\n sections.push(section);\n }\n inTag = !inTag;\n start = end + 1;\n\n }\n\n for (var i = 0; i < rule.length; i++) {\n var c = rule.charAt(i);\n\n switch(c) {\n case '[':\n lvl++;\n break;\n case ']':\n lvl--;\n break;\n case '#':\n if (lvl === 0) {\n createSection(i);\n }\n break;\n default:\n break;\n\n }\n\n }\n\n if (lvl > 0) {\n var error = "Too many '[' in rule " + inQuotes(rule);\n errors.push(error);\n\n }\n\n if (lvl < 0) {\n var error = "Too many ']' in rule " + inQuotes(rule);\n errors.push(error);\n\n }\n\n if (inTag) {\n var error = "Odd number of '#' in rule " + inQuotes(rule);\n errors.push(error);\n }\n\n createSection(rule.length);\n sections.errors = errors;\n return sections;\n};\n\nfunction testParse(rule, shouldFail) {\n console.log("-------");\n console.log("Test parse rule: " + inQuotes(rule) + " " + shouldFail);\n var parsed = parseRule(rule);\n if (parsed.errors && parsed.errors.length > 0) {\n for (var i = 0; i < parsed.errors.length; i++) {\n console.log(parsed.errors[i]);\n }\n }\n \n\n}\n\nfunction testParseTag(tag, shouldFail) {\n console.log("-------");\n console.log("Test parse tag: " + inQuotes(tag) + " " + shouldFail);\n var parsed = parseTag(tag);\n if (parsed.errors && parsed.errors.length > 0) {\n for (var i = 0; i < parsed.errors.length; i++) {\n console.log(parsed.errors[i]);\n }\n }\n}\n\ntracery.testParse = testParse;\ntracery.testParseTag = testParseTag;\ntracery.parseRule = parseRule;\ntracery.parseTag = parseTag;\n\n\nfunction spacer(size) {\n var s = "";\n for (var i = 0; i < size * 3; i++) {\n s += " ";\n }\n return s;\n}\n\n/* Simple JavaScript Inheritance\n * By John Resig http://ejohn.org/\n * MIT Licensed.\n */\n\nfunction extend(destination, source) {\n for (var k in source) {\n if (source.hasOwnProperty(k)) {\n destination[k] = source[k];\n }\n }\n return destination;\n}\n\n// Inspired by base2 and Prototype\n(function() {\n var initializing = false,\n fnTest = /xyz/.test(function() { xyz;\n }) ? /\sb_super\sb/ : /.*/;\n\n // The base Class implementation (does nothing)\n this.Class = function() {\n };\n\n // Create a new Class that inherits from this class\n Class.extend = function(prop) {\n var _super = this.prototype;\n\n // Instantiate a base class (but only create the instance,\n // don't run the init constructor)\n initializing = true;\n var prototype = new this();\n initializing = false;\n\n // Copy the properties over onto the new prototype\n for (var name in prop) {\n // Check if we're overwriting an existing function\n prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? (function(name, fn) {\n return function() {\n var tmp = this._super;\n\n // Add a new ._super() method that is the same method\n // but on the super-class\n this._super = _super[name];\n\n // The method only need to be bound temporarily, so we\n // remove it when we're done executing\n var ret = fn.apply(this, arguments);\n this._super = tmp;\n\n return ret;\n };\n })(name, prop[name]) : prop[name];\n }\n\n // The dummy class constructor\n function Class() {\n // All construction is actually done in the init method\n if (!initializing && this.init)\n this.init.apply(this, arguments);\n }\n\n // Populate our constructed prototype object\n Class.prototype = prototype;\n\n // Enforce the constructor to be what we expect\n Class.prototype.constructor = Class;\n\n // And make this class extendable\n Class.extend = arguments.callee;\n\n return Class;\n };\n})();\n\n/**\n * @author Kate\n */\n\nvar Rule = function(raw) {\n this.raw = raw;\n this.sections = parseRule(raw);\n\n};\n\nRule.prototype.getParsed = function() {\n if (!this.sections)\n this.sections = parseRule(raw);\n\n return this.sections;\n};\n\nRule.prototype.toString = function() {\n return this.raw;\n};\n\nRule.prototype.toJSONString = function() {\n return this.raw;\n};\n\n/**\n * @author Kate\n */\n\nvar RuleWeighting = Object.freeze({\n RED : 0,\n GREEN : 1,\n BLUE : 2\n});\n\nvar RuleSet = function(rules) {\n // is the rules obj an array? A RuleSet, or a string?\n if (rules.constructor === Array) {\n // make a copy\n rules = rules.slice(0, rules.length);\n } else if (rules.prototype === RuleSet) {\n // clone\n } else if ( typeof rules == 'string' || rules instanceof String) {\n var args = Array.prototype.slice.call(arguments);\n rules = args;\n } else {\n console.log(rules);\n throw ("creating ruleset with unknown object type!");\n }\n\n // create rules and their use counts\n\n this.rules = rules;\n this.parseAll();\n\n this.uses = [];\n this.startUses = [];\n this.totalUses = 0;\n for (var i = 0; i < this.rules.length; i++) {\n this.uses[i] = 0;\n this.startUses[i] = this.uses[i];\n this.totalUses += this.uses[i];\n }\n\n};\n\n//========================================================\n// Iterating over rules\n\nRuleSet.prototype.parseAll = function(fxn) {\n for (var i = 0; i < this.rules.length; i++) {\n if (this.rules[i].prototype !== Rule)\n this.rules[i] = new Rule(this.rules[i]);\n }\n\n};\n\n//========================================================\n// Iterating over rules\n\nRuleSet.prototype.mapRules = function(fxn) {\n return this.rules.map(function(rule, index) {\n return fxn(rule, index);\n });\n};\n\nRuleSet.prototype.applyToRules = function(fxn) {\n for (var i = 0; i < this.rules.length; i++) {\n fxn(this.rules[i], i);\n }\n};\n//========================================================\nRuleSet.prototype.get = function() {\n var index = this.getIndex();\n\n return this.rules[index];\n};\n\nRuleSet.prototype.getRandomIndex = function() {\n return Math.floor(this.uses.length * Math.random());\n};\n\nRuleSet.prototype.getIndex = function() {\n // Weighted distribution\n // Imagine a bar of length 1, how to divide the length\n // s.t. a random dist will result in the dist we want?\n\n var index = this.getRandomIndex();\n // What if the uses determine the chance of rerolling?\n\n var median = this.totalUses / this.uses.length;\n\n var count = 0;\n while (this.uses[index] > median && count < 20) {\n index = this.getRandomIndex();\n count++;\n }\n\n // reroll more likely if index is too much higher\n\n return index;\n};\n\nRuleSet.prototype.decayUses = function(pct) {\n this.totalUses = 0;\n for (var i = 0; i < this.uses; i++) {\n\n this.uses[index] *= 1 - pct;\n this.totalUses += this.uses[index];\n }\n};\n\nRuleSet.prototype.testRandom = function() {\n console.log("Test random");\n var counts = [];\n for (var i = 0; i < this.uses.length; i++) {\n counts[i] = 0;\n }\n\n var testCount = 10 * this.uses.length;\n for (var i = 0; i < testCount; i++) {\n\n var index = this.getIndex();\n this.uses[index] += 1;\n\n counts[index]++;\n this.decayUses(.1);\n }\n\n for (var i = 0; i < this.uses.length; i++) {\n console.log(i + ":\st" + counts[i] + " \st" + this.uses[i]);\n }\n};\n\nRuleSet.prototype.getSaveRules = function() {\n var jsonRules = this.rules.map(function(rule) {\n return rule.toJSONString();\n });\n\n return jsonRules;\n};\n\n/**\n * @author Kate Compton\n */\n\nvar Action = function(node, raw) {\n\n this.node = node;\n this.grammar = node.grammar;\n this.raw = raw;\n\n};\n\nAction.prototype.activate = function() {\n\n var node = this.node;\n node.actions.push(this);\n\n // replace any hashtags\n this.amended = this.grammar.flatten(this.raw);\n\n var parsed = parseTag(this.amended);\n var subActionRaw = parsed.preActions;\n if (subActionRaw && subActionRaw.length > 0) {\n this.subactions = subActionRaw.map(function(action) {\n return new Action(node, action);\n });\n\n }\n\n if (parsed.symbol) {\n var split = parsed.symbol.split(":");\n\n if (split.length === 2) {\n this.push = {\n symbol : split[0],\n\n // split into multiple rules\n rules : split[1].split(","),\n };\n // push\n node.grammar.pushRules(this.push.symbol, this.push.rules);\n\n } else\n throw ("Unknown action: " + parsed.symbol);\n }\n\n if (this.subactions) {\n for (var i = 0; i < this.subactions.length; i++) {\n this.subactions[i].activate();\n }\n }\n\n};\n\nAction.prototype.deactivate = function() {\n if (this.subactions) {\n for (var i = 0; i < this.subactions.length; i++) {\n this.subactions[i].deactivate();\n }\n }\n\n if (this.push) {\n this.node.grammar.popRules(this.push.symbol, this.push.rules);\n }\n};\n\n/**\n * @author Kate Compton\n */\n\nvar isConsonant = function(c) {\n c = c.toLowerCase();\n switch(c) {\n case 'a':\n return false;\n case 'e':\n return false;\n case 'i':\n return false;\n case 'o':\n return false;\n case 'u':\n return false;\n\n }\n return true;\n};\n\nfunction endsWithConY(s) {\n if (s.charAt(s.length - 1) === 'y') {\n return isConsonant(s.charAt(s.length - 2));\n }\n return false;\n};\n\nvar universalModifiers = {\n capitalizeAll : function(s) {\n return s.replace(/(?:^|\ss)\sS/g, function(a) {\n return a.toUpperCase();\n });\n\n },\n\n capitalize : function(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n\n },\n\n inQuotes : function(s) {\n return '"' + s + '"';\n },\n\n comma : function(s) {\n var last = s.charAt(s.length - 1);\n if (last === ",")\n return s;\n if (last === ".")\n return s;\n if (last === "?")\n return s;\n if (last === "!")\n return s;\n return s + ",";\n },\n\n beeSpeak : function(s) {\n // s = s.replace("s", "zzz");\n\n s = s.replace(/s/, 'zzz');\n return s;\n },\n\n a : function(s) {\n if (!isConsonant(s.charAt()))\n return "an " + s;\n return "a " + s;\n\n },\n\n s : function(s) {\n\n var last = s.charAt(s.length - 1);\n\n switch(last) {\n case 'y':\n\n // rays, convoys\n if (!isConsonant(s.charAt(s.length - 2))) {\n return s + "s";\n }\n // harpies, cries\n else {\n return s.slice(0, s.length - 1) + "ies";\n }\n break;\n\n // oxen, boxen, foxen\n case 'x':\n return s.slice(0, s.length - 1) + "en";\n case 'z':\n return s.slice(0, s.length - 1) + "es";\n case 'h':\n return s.slice(0, s.length - 1) + "es";\n\n default:\n return s + "s";\n };\n\n },\n\n ed : function(s) {\n\n var index = s.indexOf(" ");\n var s = s;\n var rest = "";\n if (index > 0) {\n rest = s.substring(index, s.length);\n s = s.substring(0, index);\n\n }\n\n var last = s.charAt(s.length - 1);\n\n switch(last) {\n case 'y':\n\n // rays, convoys\n if (isConsonant(s.charAt(s.length - 2))) {\n return s.slice(0, s.length - 1) + "ied" + rest;\n\n }\n // harpies, cries\n else {\n return s + "ed" + rest;\n }\n break;\n case 'e':\n return s + "d" + rest;\n\n break;\n\n default:\n return s + "ed" + rest;\n };\n }\n};\n/**\n * @author Kate Compton\n */\n\n// A tracery expansion node\nvar nodeCount = 0;\n\nvar ExpansionNode = Class.extend({\n init : function() {\n this.depth = 0;\n this.id = nodeCount;\n nodeCount++;\n this.childText = "[[UNEXPANDED]]";\n },\n\n setParent : function(parent) {\n if (parent) {\n this.depth = parent.depth + 1;\n this.parent = parent;\n this.grammar = parent.grammar;\n }\n },\n\n expand : function() {\n // do nothing\n return "???";\n },\n\n expandChildren : function() {\n\n if (this.children) {\n this.childText = "";\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].expand();\n this.childText += this.children[i].finalText;\n }\n this.finalText = this.childText;\n }\n\n },\n\n createChildrenFromSections : function(sections) {\n var root = this;\n this.children = sections.map(function(section) {\n\n if ( typeof section == 'string' || section instanceof String) {\n // Plaintext\n return new TextNode(root, section);\n } else {\n return new TagNode(root, section);\n }\n });\n }\n});\n\nvar RootNode = ExpansionNode.extend({\n init : function(grammar, rawRule) {\n this._super();\n this.grammar = grammar;\n this.parsedRule = parseRule(rawRule);\n },\n\n expand : function() {\n var root = this;\n this.createChildrenFromSections(this.parsedRule);\n\n // expand the children\n this.expandChildren();\n },\n});\n\nvar TagNode = ExpansionNode.extend({\n init : function(parent, parsedTag) {\n this._super();\n\n if (!(parsedTag !== null && typeof parsedTag === 'object')) {\n if ( typeof parsedTag == 'string' || parsedTag instanceof String) {\n console.warn("Can't make tagNode from unparsed string!");\n parsedTag = parseTag(parsedTag);\n\n } else {\n console.log("Unknown tagNode input: ", parsedTag);\n throw ("Can't make tagNode from strange tag!");\n\n }\n }\n\n this.setParent(parent);\n $.extend(this, parsedTag);\n },\n\n expand : function() {\n if (tracery.outputExpansionTrace)\n console.log(r.sections);\n\n this.rule = this.grammar.getRule(this.symbol);\n\n this.actions = [];\n\n // Parse the rule if it hasn't been already\n this.createChildrenFromSections(this.rule.getParsed());\n\n // Do any pre-expansion actions!\n for (var i = 0; i < this.preActions.length; i++) {\n var action = new Action(this, this.preActions[i]);\n action.activate();\n }\n\n // Map each child section to a node\n if (!this.rule.sections)\n console.log(this.rule);\n\n this.expandChildren();\n\n for (var i = 0; i < this.actions.length; i++) {\n\n this.actions[i].deactivate();\n }\n\n this.finalText = this.childText;\n for (var i = 0; i < this.mods.length; i++) {\n this.finalText = this.grammar.applyMod(this.mods[i], this.finalText);\n }\n\n },\n\n toLabel : function() {\n return this.symbol;\n },\n toString : function() {\n return "TagNode '" + this.symbol + "' mods:" + this.mods + ", preactions:" + this.preActions + ", postactions" + this.postActions;\n }\n});\n\nvar TextNode = ExpansionNode.extend({\n isLeaf : true,\n init : function(parent, text) {\n this._super();\n\n this.setParent(parent);\n\n this.text = text;\n\n this.finalText = text;\n },\n expand : function() {\n // do nothing\n },\n\n toLabel : function() {\n return this.text;\n }\n});\n\n/**\n * @author Kate Compton\n */\n\nfunction Symbol(grammar, key) {\n this.grammar = grammar;\n this.key = key;\n this.currentRules = undefined;\n this.ruleSets = [];\n\n};\n\nSymbol.prototype.loadFrom = function(rules) {\n\n rules = this.wrapRules(rules);\n this.baseRules = rules;\n\n this.ruleSets.push(rules);\n this.currentRules = this.ruleSets[this.ruleSets.length - 1];\n\n};\n\n//========================================================\n// Iterating over rules\n\nSymbol.prototype.mapRules = function(fxn) {\n\n return this.currentRules.mapRules(fxn);\n};\n\nSymbol.prototype.applyToRules = function(fxn) {\n this.currentRules.applyToRules(fxn);\n};\n\n//==================================================\n// Rule pushpops\nSymbol.prototype.wrapRules = function(rules) {\n if (rules.prototype !== RuleSet) {\n if (Array.isArray(rules)) {\n return new RuleSet(rules);\n } else if ( typeof rules == 'string' || rules instanceof String) {\n return new RuleSet(rules);\n } else {\n throw ("Unknown rules type: " + rules);\n }\n }\n // already a ruleset\n return rules;\n};\n\nSymbol.prototype.pushRules = function(rules) {\n rules = this.wrapRules(rules);\n this.ruleSets.push(rules);\n this.currentRules = this.ruleSets[this.ruleSets.length - 1];\n};\n\nSymbol.prototype.popRules = function() {\n var exRules = this.ruleSets.pop();\n\n if (this.ruleSets.length === 0) {\n //console.warn("No more rules for " + this + "!");\n }\n this.currentRules = this.ruleSets[this.ruleSets.length - 1];\n};\n\n// Clear everything and set the rules\nSymbol.prototype.setRules = function(rules) {\n\n rules = this.wrapRules(rules);\n this.ruleSets = [rules];\n this.currentRules = rules;\n\n};\n\nSymbol.prototype.addRule = function(rule) {\n this.currentRules.addRule(seed);\n};\n\n//========================================================\n// selection\n\nSymbol.prototype.select = function() {\n this.isSelected = true;\n\n};\n\nSymbol.prototype.deselect = function() {\n this.isSelected = false;\n};\n\n//==================================================\n// Getters\n\nSymbol.prototype.getRule = function(seed) {\n return this.currentRules.get(seed);\n};\n\n//==================================================\n\nSymbol.prototype.toString = function() {\n return this.key + ": " + this.currentRules + "(overlaying " + (this.ruleSets.length - 1) + ")";\n};\nSymbol.prototype.toJSON = function() {\n\n var rules = this.baseRules.rules.map(function(rule) {\n return '"' + rule.raw + '"';\n });\n return '"' + this.key + '"' + ": [" + rules.join(", ") + "]";\n};\n\nSymbol.prototype.toHTML = function(useSpans) {\n var keySpan = '"' + this.key + '"';\n if (useSpans)\n keySpan = "<span class='symbol symbol_" + this.key + "'>" + keySpan + "</span>";\n\n var rules = this.baseRules.rules.map(function(rule) {\n var s = '"' + rule.raw + '"';\n if (useSpans)\n s = "<span class='rule'>" + s + "</span>";\n return s;\n });\n return keySpan + ": [" + rules.join(", ") + "]";\n};\n\n/**\n * @author Kate Compton\n */\n\nfunction Grammar() {\n this.clear();\n};\n\nGrammar.prototype.clear = function() {\n // Symbol library\n this.symbols = {};\n \n this.errors = [];\n \n // Modifier library\n this.modifiers = {};\n\n // add the universal mods\n for (var mod in universalModifiers) {\n if (universalModifiers.hasOwnProperty(mod))\n this.modifiers[mod] = universalModifiers[mod];\n }\n};\n//========================================================\n// Loading\n\nGrammar.prototype.loadFrom = function(obj) {\n var symbolSrc;\n\n this.clear();\n\n if (obj.symbols !== undefined) {\n symbolSrc = obj.symbols;\n } else {\n symbolSrc = obj;\n }\n\n // get all json keys\n var keys = Object.keys(symbolSrc);\n\n this.symbolNames = [];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n this.symbolNames.push(key);\n\n this.symbols[key] = new Symbol(this, key);\n this.symbols[key].loadFrom(symbolSrc[key]);\n }\n\n};\n\nGrammar.prototype.toHTML = function(useSpans) {\n // get all json keys\n var keys = Object.keys(this.symbols);\n\n this.symbolNames = [];\n\n var lines = [];\n\n var count = 0;\n for (var i = 0; i < keys.length; i++) {\n\n var key = keys[i];\n var symbol = this.symbols[key];\n\n if (symbol && symbol.baseRules) {\n\n lines.push(" " + this.symbols[key].toHTML(useSpans));\n\n }\n };\n\n var s;\n s = lines.join(",</p><p>");\n s = "{<p>" + s + "</p>}";\n return s;\n};\n\nGrammar.prototype.toJSON = function() {\n // get all json keys\n var keys = Object.keys(this.symbols);\n\n this.symbolNames = [];\n\n var lines = [];\n\n var count = 0;\n for (var i = 0; i < keys.length; i++) {\n\n var key = keys[i];\n var symbol = this.symbols[key];\n\n if (symbol && symbol.baseRules) {\n\n lines.push(" " + this.symbols[key].toJSON());\n\n }\n };\n\n var s;\n s = lines.join(",\sn");\n s = "{\sn" + s + "\sn}";\n return s;\n};\n\n//========================================================\n// selection\n\nGrammar.prototype.select = function() {\n this.isSelected = true;\n};\n\nGrammar.prototype.deselect = function() {\n this.isSelected = false;\n};\n\n//========================================================\n// Iterating over symbols\n\nGrammar.prototype.mapSymbols = function(fxn) {\n var symbols = this.symbols;\n return this.symbolNames.map(function(name) {\n return fxn(symbols[name], name);\n });\n};\n\nGrammar.prototype.applyToSymbols = function(fxn) {\n for (var i = 0; i < this.symbolNames.length; i++) {\n var key = this.symbolNames[i];\n fxn(this.symbols[key], key);\n }\n};\n\n//========================================================\nGrammar.prototype.addOrGetSymbol = function(key) {\n if (this.symbols[key] === undefined)\n this.symbols[key] = new Symbol(key);\n\n return this.symbols[key];\n};\n\nGrammar.prototype.pushRules = function(key, rules) {\n var symbol = this.addOrGetSymbol(key);\n symbol.pushRules(rules);\n};\n\nGrammar.prototype.popRules = function(key, rules) {\n var symbol = this.addOrGetSymbol(key);\n var popped = symbol.popRules();\n\n if (symbol.ruleSets.length === 0) {\n // remove symbol\n this.symbols[key] = undefined;\n }\n};\n\nGrammar.prototype.applyMod = function(modName, text) {\n if (!this.modifiers[modName]) {\n console.log(this.modifiers);\n throw ("Unknown mod: " + modName);\n }\n return this.modifiers[modName](text);\n};\n\n//============================================================\nGrammar.prototype.getRule = function(key, seed) {\n var symbol = this.symbols[key];\n if (symbol === undefined) {\n var r = new Rule("{{" + key + "}}");\n\n r.error = "Missing symbol " + key;\n return r;\n }\n\n var rule = symbol.getRule();\n if (rule === undefined) {\n var r = new Rule("[" + key + "]");\n console.log(r.sections);\n r.error = "Symbol " + key + " has no rule";\n return r;\n }\n\n return rule;\n};\n\n//============================================================\n// Expansions\nGrammar.prototype.expand = function(raw) {\n\n // Start a new tree\n var root = new RootNode(this, raw);\n\n root.expand();\n\n return root;\n};\n\nGrammar.prototype.flatten = function(raw) {\n\n // Start a new tree\n var root = new RootNode(this, raw);\n\n root.expand();\n\n return root.childText;\n};\n\n//===============\n\nGrammar.prototype.analyze = function() {\n this.symbolNames = [];\n for (var name in this.symbols) {\n if (this.symbols.hasOwnProperty(name)) {\n this.symbolNames.push(name);\n }\n }\n\n // parse every rule\n\n for (var i = 0; i < this.symbolNames.length; i++) {\n var key = this.symbolNames[i];\n var symbol = this.symbols[key];\n // parse all\n for (var j = 0; j < symbol.baseRules.length; j++) {\n var rule = symbol.baseRules[j];\n rule.parsed = tracery.parse(rule.raw);\n // console.log(rule);\n\n }\n }\n\n};\n\nGrammar.prototype.selectSymbol = function(key) {\n console.log(this);\n var symbol = this.get(key);\n};\n/**\n * @author Kate Compton\n\n */\n\ntracery.createGrammar = function(obj) {\n var grammar = new Grammar();\n grammar.loadFrom(obj);\n return grammar;\n};\n\ntracery.test = function() {\n\n console.log("==========================================");\n console.log("test tracery");\n\n // good\n tracery.testParse("", false);\n tracery.testParse("fooo", false);\n tracery.testParse("####", false);\n tracery.testParse("#[]#[]##", false);\n tracery.testParse("#someSymbol# and #someOtherSymbol#", false);\n tracery.testParse("#someOtherSymbol.cap.pluralize#", false);\n tracery.testParse("#[#do some things#]symbol.mod[someotherthings[and a function]]#", false);\n tracery.testParse("#[fxn][fxn][fxn[subfxn]]symbol[[fxn]]#", false);\n tracery.testParse("#[fxn][#fxn#][fxn[#subfxn#]]symbol[[fxn]]#", false);\n tracery.testParse("#hero# ate some #color# #animal.s#", false);\n tracery.testParseTag("[action]symbol.mod1.mod2[postAction]", false);\n\n // bad\n tracery.testParse("#someSymbol# and #someOtherSymbol", true);\n tracery.testParse("#[fxn][fxn][fxn[subfxn]]symbol[fxn]]#", true);\n\n // bad\n tracery.testParseTag("stuff[action]symbol.mod1.mod2[postAction]", true);\n tracery.testParseTag("[action]symbol.mod1.mod2[postAction]stuff", true);\n\n tracery.testParse("#hero# ate some #color# #animal.s#", true);\n tracery.testParse("#[#setPronouns#][#setOccupation#][hero:#name#]story#", true);\n\n};\n \n})();
[[names1]] publicly accused [[names2]] of being the arsonist, causing everyone in Crestview to take sides.
<table><tr><td>\nand you think about your teeth\nand your hunger whose name <<print $hunger>>\nand you look up at the [[purple sky:]]\n</td></tr></table>
<<if $key is false>><table><tr><td>\n''Summer palace''\nYou notice the [[dragons]] first: muscular and golden, they twist around the lacquered columns supporting the bamboo roof. \n\n<p></p>\n<<replace "A lama is here.">>"I’LL TELL ALL..."<<endreplace>>\n\n<<replace "A shaman is here.">>"ONLY ONE PATH IS TRUE."<<endreplace>>\n\n<<replace "A priest is here.">>"THUS YOU WILL BE ABLE TO CONTINUE YOUR SEARCH."<<endreplace>>\n\n<<replace "A general is here.">>"WHO ARE YOU?"<<endreplace>>\n\n<<replace "A messenger is here.">>"WHERE HAVE YOU COME FROM?"<<endreplace>>\n\n<<replace "An empress is here.">>"WHY ARE YOU HERE?"<<endreplace>>\n\n<<replace "A dancer is here.">>"HELP ME TO TAKE THE STATUE OUT FROM THE SANDS."<<endreplace>>\n\n<<replace "A traveler is here.">>"THIS THIRST DRIVES ME MAD."<<endreplace>>\n\n<p></p>\nYou can go [[north|caldarium]] from here.\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Summer palace''\nYou notice the dragons first: muscular and golden, they twist around the lacquered columns supporting the bamboo roof. \n\nA cold wind rattles the beams.\n\n<p></p>\nYou can go [[north|caldarium]] from here.\n\n</td></tr></table>\n<<endif>>
<table><tr><td>\nand at the same time [[it is also the sea.]]\n</td></tr></table>
<table><tr><td>\nThe elevator doors slide open and you step inside. It is a pleasant elevator, with pleasant music and a pleasant carpet and pleasant walls of stainless steel. It [[begins to move.]]\n</td></tr></table>
<table><tr><td>\nStanding there is none other than your dentist, Dr. Tasaka. \n\nHe asks how you’ve been, and whether you’ve been flossing, and how long you plan to go on like this, tunnelling further and further into your dream, a series of rooms within rooms. \n\nYou reply,\n\n[[“Until I am dead.”]]\n[[“Until I am satisfied.”|“Until I am dead.”]]\n[[“Until I am no longer trapped in this dream.”|“Until I am dead.”]]\n</td></tr></table>
[[lastname]] Pharmaceuticals\n[[lastname]] Industries\n[[lastname]] Petroleum\n[[lastname]] Aerospace\n[[lastname]] Group\n[[lastname]] Agrochemical
the saguaro maze\nthe purple bluffs\n[[lastname]] Canyon\nthe [[lastname]] Arboretum\nthe Crestview Galleria\nDelmonico’s Ristorante\n[[lastname]] Park\n[[lastname]] Plaza\nthe Hog and Bristle\nCafe Umami\nthe Prickly Pear\nCity Hall\nthe offices of [[lastname]] [[lastname]] and [[lastname]]\nthe Flux nightclub\nthe [[lastname]] Academy
<table><tr><td>\n<center>“A sweeping current will rush along a range of grain sizes, and when it stops, the biggest grains settle first. The sand is graded; nature has carefully sorted out the sizes and dumped them in sequence on top of one another.” \n\n--Michael Welland, //Sand//\n\n[[START|ch3-5]]</center>\n\n</td></tr></table>
<table><tr><td>\nthat reach out toward the <<print $horizon>> horizon. \n\nIn front of you is a placid swimming pool. \n\nYou [[dive into the water.]]\n</td></tr></table>
<table><tr><td>\nand you think to yourself\n\nthat [[it is like laughing.]]\nthat [[it is like breaking.|it is like laughing.]]\nthat [[it is like lying.|it is like laughing.]]\n</td></tr></table>
//requires jquery\n\n// input: an array of objects\n//\t\t a property that each of those object have\n// output: an array of the properties of all the objects\nwindow.skimObjectArray = function(objectArray, property){\n\tconsole.log("skimObjectArray(", "objectArray", objectArray, "property", property, ")")\n\tvar values = [];\n\n\tfor (var i = 0; i < objectArray.length; i++) {\n\t\tvar thingToAdd = objectArray[i][property];\n\t\tif(typeof thingToAdd === "object"){\n\t\t\t// i hope to god this works\n\t\t\tthingToAdd = objectArray[i][property].join("\sn")\n\t\t}\n\t\tvalues.push( thingToAdd );\n\t};\n\n\tvalues = values.join("\sn");\n\tvalues = values.split("\sn")\n\n\treturn values;\n}\n\nStory.prototype.appendCorpora = function(){\n\tvar corporaToAppend = tale.lookup("tags", "corpus");\n\tif(!corporaToAppend.length) return;\n\n\tfor(var i in corporaToAppend){\n\t\tvar currentPassage = corporaToAppend[i].title;\n\n\t\t// the rules are the concatenation of each symbol in this passage\n\t\tvar rules = [];\n\t\tvar lines = tale.passages[currentPassage].text.split("\sn")\n\t\tfor(var j in lines){\n\t\t\tvar line = lines[j];\n\t\t\tvar location = line.split("#");\n\t\t\tconsole.log("location: ", location);\n\t\t\tvar corpusLocation = location[0];\n\n\t\t\t// fetch me that sweet sweet boy\n\t\t\tvar corpus = $.ajax({\n\t\t\t\tdataType: "json",\n\t\t\t\turl: corpusLocation,\n\t\t\t\tasync: false\n\t\t\t});\n\t\t\tcorpus = corpus.responseJSON;\n\n\t\t\t// drill down to the array we want\n\t\t\tfor (var i = 1; i < location.length; i++) {\n\t\t\t\tconsole.log("corpus: ", corpus);\n\t\t\t\t// if there's a ! at the beginning of a location, skim the objArray for that property\n\t\t\t\tif(location[i][0] === "!"){\n\t\t\t\t\tcorpus = skimObjectArray(corpus, location[i].substring(1));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcorpus = corpus[ location[i] ]\n\t\t\t};\n\n\t\t\tconsole.log("corpus: ", corpus);\n\t\t\t// add this into the symbol-in-progress\n\t\t\trules = rules.concat(corpus);\n\t\t\tconsole.log("rules: ", rules)\n\t\t}\n\n\t\t// the name of this symbol is the name of the passage\n\t\tvar finalJSON = "{ \s"" + currentPassage + "\s": " + JSON.stringify(rules) + " }";\n\n\t\t// save our dark deeds to the passage\n\t\ttale.passages[currentPassage].text = finalJSON;\n\n\t\t//tag this as JSON so it gets appended in the next step\n\t\ttale.passages[currentPassage].tags.push("JSON")\n\t}\n\n\tconsole.log("corpora loaded")\n}\n\nStory.prototype.appendJSON = function() {\n\tvar JSONtoAppend = tale.lookup("tags", "JSON");\n\tif(!JSONtoAppend.length) return;\n\n\tfor(i in JSONtoAppend){\n\t\tvar newJSON = JSON.parse(JSONtoAppend[i].text);\n\t\t$.extend(this.data, newJSON);\n\t}\n\tconsole.log("JSON appended");\n}\n\nfunction Story(){\n\tvar grammars = tale.lookup("tags", "grammar", "title");\n\tthis.data = {};\n\n\tvar links = /(\s[\s[\sb)(.+?)(\sb\s]\s])/g;\n\tvar sublinks = /([^\s[\s]]+)*(.+)/\n\n\tfunction convertSyntax(match, p1, p2, p3){\n\t\t// If a passage is invoked that's tagged as a grammar, change Twine links into Tracery symbols.\n\t\t// e.g.: [[animal]] => #animal#\n\t\t// e.g.: [[animal][capitalize]] => #animal.capitalize#\n\n\t\t// p1 is left brackets, p3 is right brackets\n\t\tvar targetLink = p2.split("][")[0];\n\t\tvar modifiers = p2.split("][").slice(1, p2.length).join(".");\n\t\tmodifiers = modifiers?("." + modifiers):"";\n\t\t\n\t\tvar trace = "#" + targetLink + modifiers + "#";\n\t\t\n\t\tvar linkIsGrammar = false;\n\t\tvar tags = tale.get(targetLink).tags\n\t\tfor(var i = 0; i < tags.length; i++){\n\t\t\tif(tags[i] == "grammar" || tags[i] == "corpus"){\n\t\t\t\tlinkIsGrammar = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn linkIsGrammar?trace:match;\n\t}\n\n\tfor(var i in grammars){\n\t\tif(grammars[i] == undefined) continue;\n\n\t\t// Passage names become grammar names, Passage text becomes grammar text. \n\t\tvar newSymbol = grammars[i].title\n\t\tvar newText = grammars[i].text\n\n\t\tvar link = /(\s[\s[\sb)(.+?)(\sb\s]\s])/g;\n\t\tnewText = newText.replace(link, convertSyntax);\n\t\t// Get everything that's being linked to.\n\n\t\tthis.data[newSymbol] = newText.split('\sn');\n\t}\n\n\tthis.appendCorpora();\n\tthis.appendJSON();\n\tconsole.log("Story: ", this);\n}\nStory.prototype.constructor = Story;\n\n// Append this to the tale object because I don't know where else to put it.\nTale.prototype.story = new Story();\n\nStory.prototype.toHTML = function() {\n\tvar output = [];\n\tvar tab = " ";\n\tvar beg = '\sn' + tab + "\s"<span class=\s"grammarContents\s">{{{"\n\tvar end = "}}}</span>\s""\n\n\tfor(var i in this.data){\n\t\tvar gram = "<span class=\s"grammarTitle\s">\s"" + i + "\s"</span>: [";\n\t\tgram += beg + this.data[i].join(end + ',' + beg) + end;\n\t\tgram += "]";\n\t\toutput.push(gram);\n\t}\n\treturn "{\sn" + output.join(",\sn") + "\sn}";\n}\n\nTale.prototype.JSONtoTwee = function() {\n\tvar JSONtoConvert = tale.lookup("tags", "JSON");\n\tvar combinedJSON = ""\n\n\tfor (var i in JSONtoConvert){\n\t\tcombinedJSON += JSONtoConvert[i].text;\n\t}\n\n\t// Note the {{{}}} delimiters in textPost. This is intended for display in Twine, so\n\t// if you're just running these raw they aren't necessary.\n\tvar regex = {titlesPre: /\st"(.+)": \s[/g, titlesPost: "<br>:: $1 [grammar]",\n\t\t\t\t textPre: /\st*"(.+)",*(?:\sn\st)?(?:\s],)*\sn/g, textPost: "{{{$1}}}<br>"}\n\n\tvar tweeOutput = combinedJSON.replace(regex.titlesPre, regex.titlesPost);\n\ttweeOutput = tweeOutput.replace(regex.textPre, regex.textPost);\n\ttweeOutput = tweeOutput.replace(/({\sn)|(]\sn})/g, "")\n\n\treturn tweeOutput;\n}
Tyler\nKai\nBrady\nHayley\nCiara\nNicole
Stefano\nFynn\nLuke\nMadison\nJordan\nAmanda
Aidan\nBuckley\nCameron\nChristian\nBrie\nMegan\nAshley
<<set $key to false>><table><tr><td>\n<center>“ENTER INTO THOSE PORTALS. I WILL GUIDE YOU THROUGH THEM. YOU WILL NEED OUR HELP TO SORT OUT THE GREAT DANGERS THAT LIE AHEAD.” \n\n--//NyxQuest: Kindred Spirits//\n\n[[START|ch4]]</center>\n\n</td></tr></table>
(function(){version.extensions.replaceMacrosCombined={major:1,minor:1,revision:7};var nullobj={handler:function(){}};function showVer(n,notrans){if(!n){return;}n.innerHTML="";\nnew Wikifier(n,n.tweecode);n.setAttribute("data-enabled","true");n.style.display="inline";n.classList.remove("revision-span-out");if(!notrans){n.classList.add("revision-span-in");\nif(n.timeout){clearTimeout(n.timeout);}n.timeout=setTimeout(function(){n.classList.remove("revision-span-in");n=null;},20);}}function hideVer(n,notrans){if(!n){return;\n}n.setAttribute("data-enabled","false");n.classList.remove("revision-span-in");if(n.timeout){clearTimeout(n.timeout);}if(!notrans){n.classList.add("revision-span-out");\nn.timeout=setTimeout(function(){if(n.getAttribute("data-enabled")=="false"){n.classList.remove("revision-span-out");n.style.display="none";n.innerHTML="";}n=null;\n},1000);}else{n.style.display="none";n.innerHTML="";n=null;}}function tagcontents(b,starttags,desttags,endtags,k){var l=0,c="",tg,a,i;function tagfound(i,e,endtag){for(var j=0;\nj<e.length;j++){if(a.indexOf("<<"+e[j]+(endtag?">>":""),i)==i){return e[j];}}}a=b.source.slice(k);for(i=0;i<a.length;i++){if(tg=tagfound(i,starttags)){l++;}else{if((tg=tagfound(i,desttags,true))&&l==0){b.nextMatch=k+i+tg.length+4;\nreturn[c,tg];}else{if(tg=tagfound(i,endtags,true)){l--;if(l<0){return null;}}}}c+=a.charAt(i);}return null;}var begintags=[];var endtags=[];function revisionSpanHandler(g,e,f,b){var k=b.source.indexOf(">>",b.matchStart)+2,vsns=[],vtype=e,flen=f.length,becomes,c,cn,m,h,vsn;\nfunction mkspan(vtype){h=insertElement(m,"span",null,"revision-span "+vtype);h.setAttribute("data-enabled",false);h.style.display="none";h.tweecode="";return h;}if(this.shorthand&&flen){while(f.length>0){vsns.push([f.shift(),(this.flavour=="insert"?"gains":"becomes")]);\n}}else{if(this.flavour=="insert"||(this.flavour=="continue"&&this.trigger=="time")){vsns.push(["","becomes"]);}}if(this.flavour=="continue"&&flen){b.nextMatch=k+b.source.slice(k).length;\nvsns.push([b.source.slice(k),vtype]);}else{becomes=["becomes","gains"];c=tagcontents(b,begintags,becomes.concat(endtags),endtags,k);if(c&&endtags.indexOf(c[1])==-1){while(c){vsns.push(c);\nc=tagcontents(b,begintags,becomes,endtags,b.nextMatch);}c=tagcontents(b,begintags,["end"+e],endtags,b.nextMatch);}if(!c){throwError(g,"can't find matching end"+e);\nreturn;}vsns.push(c);if(this.flavour=="continue"){k=b.nextMatch;b.nextMatch=k+b.source.slice(k).length;vsns.push([b.source.slice(k),""]);}}if(this.flavour=="remove"){vsns.push(["","becomes"]);\n}cn=0;m=insertElement(g,"span",null,e);m.setAttribute("data-flavour",this.flavour);h=mkspan("initial");vsn=vsns.shift();h.tweecode=vsn[0];showVer(h,true);while(vsns.length>0){if(vsn){vtype=vsn[1];\n}vsn=vsns.shift();h=mkspan(vtype);h.tweecode=vsn[0];}if(typeof this.setup=="function"){this.setup(m,g,f);}}function quantity(m){return(m.children.length-1)+(m.getAttribute("data-flavour")=="remove");\n}function revisionSetup(m,g,f){m.className+=" "+f[0].replace(" ","_");}function keySetup(m,g,f){var key=f[0];m.setEventListener("keydown",function l(e){var done=!revise("revise",m);\nif(done){m.removeEventListener("keydown",l);}});}function timeSetup(m,g,f){function cssTimeUnit(s){if(typeof s=="string"){if(s.slice(-2).toLowerCase()=="ms"){return Number(s.slice(0,-2))||0;\n}else{if(s.slice(-1).toLowerCase()=="s"){return Number(s.slice(0,-1))*1000||0;}}}throwError(g,s+" isn't a CSS time unit");return 0;}var tm=cssTimeUnit(f[0]);var s=state.history[0].passage.title;\nsetTimeout(function timefn(){if(state.history[0].passage.title==s){var done=!revise("revise",m);if(!done){setTimeout(timefn,tm);}}},tm);}function hoverSetup(m){var fn,noMouseEnter=(document.head.onmouseenter!==null),m1=m.children[0],m2=m.children[1],gains=m2.className.indexOf("gains")>-1;\nif(!m1||!m2){return;}m1.onmouseenter=function(e){var efp=document.elementFromPoint(e.clientX,e.clientY);while(efp&&efp!==this){efp=efp.parentNode;}if(!efp){return;\n}if(this.getAttribute("data-enabled")!="false"){revise("revise",this.parentNode);}};m2.onmouseleave=function(e){var efp=document.elementFromPoint(e.clientX,e.clientY);\nwhile(efp&&efp!==this){efp=efp.parentNode;}if(efp){return;}if(this.getAttribute("data-enabled")!="false"){revise("revert",this.parentNode);}};if(gains){m1.onmouseleave=m2.onmouseleave;\n}if(noMouseEnter){fn=function(n){return function(e){if(!event.relatedTarget||(event.relatedTarget!=this&&!(this.compareDocumentPosition(event.relatedTarget)&Node.DOCUMENT_POSITION_CONTAINED_BY))){this[n]();\n}};};m1.onmouseover=fn("onmouseenter");m2.onmouseout=fn("onmouseleave");if(gains){m1.onmouseout=m2.onmouseout;}}m=null;}function mouseSetup(m){var evt=(document.head.onmouseenter===null?"onmouseenter":"onmouseover");\nm[evt]=function(){var done=!revise("revise",this);if(done){this[evt]=null;}};m=null;}function linkSetup(m,g,f){var l=Wikifier.createInternalLink(),p=m.parentNode;\nl.className="internalLink replaceLink";p.insertBefore(l,m);l.insertBefore(m,null);l.onclick=function(){var p,done=false;if(m&&m.parentNode==this){done=!revise("revise",m);\nscrollWindowTo(m);}if(done){this.parentNode.insertBefore(m,this);this.parentNode.removeChild(this);}};l=null;}function visitedSetup(m,g,f){var i,done,shv=state.history[0].variables,os="once seen",d=(m.firstChild&&(this.flavour=="insert"?m.firstChild.nextSibling:m.firstChild).tweecode);\nshv[os]=shv[os]||{};if(d&&!shv[os].hasOwnProperty(d)){shv[os][d]=1;}else{for(i=shv[os][d];i>0&&!done;i--){done=!revise("revise",m,true);}if(shv[os].hasOwnProperty(d)){shv[os][d]+=1;\n}}}[{name:"insert",flavour:"insert",trigger:"link",setup:linkSetup},{name:"timedinsert",flavour:"insert",trigger:"time",setup:timeSetup},{name:"insertion",flavour:"insert",trigger:"revisemacro",setup:revisionSetup},{name:"later",flavour:"insert",trigger:"visited",setup:visitedSetup},{name:"keyinsert",flavour:"insert",trigger:"key",setup:keySetup},{name:"replace",flavour:"replace",trigger:"link",setup:linkSetup},{name:"timedreplace",flavour:"replace",trigger:"time",setup:timeSetup},{name:"mousereplace",flavour:"replace",trigger:"mouse",setup:mouseSetup},{name:"hoverreplace",flavour:"replace",trigger:"hover",setup:hoverSetup},{name:"revision",flavour:"replace",trigger:"revisemacro",setup:revisionSetup},{name:"keyreplace",flavour:"replace",trigger:"key",setup:keySetup},{name:"timedremove",flavour:"remove",trigger:"time",setup:timeSetup},{name:"mouseremove",flavour:"remove",trigger:"mouse",setup:mouseSetup},{name:"hoverremove",flavour:"remove",trigger:"hover",setup:hoverSetup},{name:"removal",flavour:"remove",trigger:"revisemacro",setup:revisionSetup},{name:"once",flavour:"remove",trigger:"visited",setup:visitedSetup},{name:"keyremove",flavour:"remove",trigger:"key",setup:keySetup},{name:"continue",flavour:"continue",trigger:"link",setup:linkSetup},{name:"timedcontinue",flavour:"continue",trigger:"time",setup:timeSetup},{name:"mousecontinue",flavour:"continue",trigger:"mouse",setup:mouseSetup},{name:"keycontinue",flavour:"continue",trigger:"key",setup:keySetup},{name:"cycle",flavour:"cycle",trigger:"revisemacro",setup:revisionSetup},{name:"mousecycle",flavour:"cycle",trigger:"mouse",setup:mouseSetup},{name:"timedcycle",flavour:"cycle",trigger:"time",setup:timeSetup},{name:"keycycle",flavour:"replace",trigger:"key",setup:keySetup}].forEach(function(e){e.handler=revisionSpanHandler;\ne.shorthand=(["link","mouse","hover"].indexOf(e.trigger)>-1);macros[e.name]=e;macros["end"+e.name]=nullobj;begintags.push(e.name);endtags.push("end"+e.name);});function insideDepartingSpan(elem){var r=elem.parentNode;\nwhile(!r.classList.contains("passage")){if(r.classList.contains("revision-span-out")){return true;}r=r.parentNode;}}function reviseAll(rt,rname){var rall=document.querySelectorAll(".passage [data-flavour]."+rname),ret=false;\nfor(var i=0;i<rall.length;i++){if(!insideDepartingSpan(rall[i])){ret=revise(rt,rall[i])||ret;}}return ret;}function revise(rt,r,notrans){var ind2,curr,next,ind=-1,rev=(rt=="revert"),rnd=(rt.indexOf("random")>-1),fl=r.getAttribute("data-flavour"),rc=r.childNodes,cyc=(fl=="cycle"),rcl=rc.length-1;\nfunction doToGainerSpans(n,fn){for(var k=n-1;k>=0;k--){if(rc[k+1].classList.contains("gains")){fn(rc[k],notrans);}else{break;}}}for(var k=0;k<=rcl;k++){if(rc[k].getAttribute("data-enabled")=="true"){ind=k;\n}}if(rev){ind-=1;}curr=(ind>=0?rc[ind]:(cyc?rc[rcl]:null));ind2=ind;if(rnd){ind2=(ind+(Math.floor(Math.random()*rcl)))%rcl;}next=((ind2<rcl)?rc[ind2+1]:(cyc?rc[0]:null));\nvar docurr=(rev?showVer:hideVer);var donext=(rev?hideVer:showVer);var currfn=function(){if(!(next&&next.classList.contains("gains"))||rnd){docurr(curr,notrans);doToGainerSpans(ind,docurr,notrans);\n}};var nextfn=function(){donext(next,notrans);if(rnd){doToGainerSpans(ind2+1,donext,notrans);}};if(!rev){currfn();nextfn();}else{nextfn();currfn();}return(cyc?true:(rev?(ind>0):(ind2<rcl-1)));\n}macros.revert=macros.revise=macros.randomise=macros.randomize={handler:function(a,b,c){var l,rev,rname;function disableLink(l){l.style.display="none";}function enableLink(l){l.style.display="inline";\n}function updateLink(l){if(l.className.indexOf("random")>-1){enableLink(l);return;}var rall=document.querySelectorAll(".passage [data-flavour]."+rname),cannext,canprev,i,ind,r,fl;\nfor(i=0;i<rall.length;i++){r=rall[i],fl=r.getAttribute("data-flavour");if(insideDepartingSpan(r)){continue;}if(fl=="cycle"){cannext=canprev=true;}else{if(r.firstChild.getAttribute("data-enabled")==!1+""){canprev=true;\n}if(r.lastChild.getAttribute("data-enabled")==!1+""){cannext=true;}}}var can=(l.classList.contains("revert")?canprev:cannext);(can?enableLink:disableLink)(l);}function toggleText(w){w.classList.toggle(rl+"Enabled");\nw.classList.toggle(rl+"Disabled");w.style.display=((w.style.display=="none")?"inline":"none");}var rl="reviseLink";if(c.length<2){throwError(a,b+" macro needs 2 parameters");\nreturn;}rname=c.shift().replace(" ","_");l=Wikifier.createInternalLink(a,null);l.className="internalLink "+rl+" "+rl+"_"+rname+" "+b;var v="";var end=false;var out=false;\nif(c.length>1&&c[0][0]=="$"){v=c[0].slice(1);c.shift();}switch(c[c.length-1]){case"end":end=true;c.pop();break;case"out":out=true;c.pop();break;}var h=state.history[0].variables;\nfor(var i=0;i<c.length;i++){var on=(i==Math.max(c.indexOf(h[v]),0));var d=insertElement(null,"span",null,rl+((on)?"En":"Dis")+"abled");if(on){h[v]=c[i];l.setAttribute("data-cycle",i);\n}else{d.style.display="none";}insertText(d,c[i]);l.appendChild(d);}l.onclick=function(){reviseAll(b,rname);var t=this.childNodes,u=this.getAttribute("data-cycle")-0,m=t.length,n,lall,i;\nif((end||out)&&u>=m-(end?2:1)){if(end){n=this.removeChild(t[u+1]||t[u]);n.className=rl+"End";n.style.display="inline";this.parentNode.replaceChild(n,this);}else{this.parentNode.removeChild(this);\nreturn;}}else{toggleText(t[u]);u=(u+1)%m;if(v){h[v]=c[u];}toggleText(t[u]);this.setAttribute("data-cycle",u);}lall=document.getElementsByClassName(rl+"_"+rname);\nfor(i=0;i<lall.length;i++){updateLink(lall[i]);}};disableLink(l);setTimeout((function(l){return function(){updateLink(l);};}(l)),1);l=null;}};macros.mouserevise=macros.hoverrevise={handler:function(a,b,c,d){var endtags=["end"+b],evt=(window.onmouseenter===null?"onmouseenter":"onmouseover"),t=tagcontents(d,[b],endtags,endtags,d.source.indexOf(">>",d.matchStart)+2);\nif(t){var rname=c[0].replace(" ","_"),h=insertElement(a,"span",null,"hoverrevise hoverrevise_"+rname),f=function(){var done=!reviseAll("revise",rname);if(b!="hoverrevise"&&done){this[evt]=null;\n}};new Wikifier(h,t[0]);if(b=="hoverrevise"){h.onmouseover=f;h.onmouseout=function(){reviseAll("revert",rname);};}else{h[evt]=f;}h=null;}}};macros.instantrevise={handler:function(a,b,c,d){reviseAll("revise",c[0].replace(" ","_"));\n}};macros.endmouserevise=nullobj;macros.endhoverrevise=nullobj;}());
<table><tr><td>\n<center><<timedreplace 2s>>"IF YOU FOLLOW A MIRAGE..." <<becomes>>"THE DESERT WILL SWALLOW YOU."<<becomes>>"IF YOU INSIST ON GOING..."<<becomes>>"I’LL WAIT FOR YOU HERE."<<becomes>>"WHO ARE YOU?"<<becomes>>"WHERE ARE YOU GOING?"<<becomes>>"YOU ARE SURROUNDED BY DUST."\n<<becomes>>[["AND IT IS DUST YOU SHALL BECOME."|start2]]<<endtimedreplace>>\n</center>\n</td></tr></table>
<table><tr><td>\nThere as on e a in ho r ed a anet en ir ed an oons. He had a ea ti i e, ho he on ined to the ro nds o his a a e eans o en hant ent.\n\nIn order to a e her i e ore interestin , the een too a o er: a sor eress. One a ternoon, the in a e on the een ith her o er. In a ra e, he t their odies into a h ndred ie es and had ea h ie e sent to a di erent oon. The ie es a ndist r ed on the d st and si ent nar s r a e or se era ears. \n\nThen a rio s thin ha ened: ro ea h oot there s ro ted a e ; ro ea h in er, a hand; ro ea h e e a , a a e--and so on and so orth nti a o ete od as or ed ro ea h one o the s attered i s. And on those oons, i e e an to o rish.\n\n ean hi e on the in ’s anet, no ant or ani a as e er orn a ain. O eans e a orated, on e-h id orests t rned to d st. One one, a i in reat res died, nti on the in re ained, and soon a ter that he died too.\n\n\n\n\n\n<center>[ [[-|ch3-1]] [[-|ch3-2]] [[-|ch3-3]] [[-|ch3-4]] [[-|ch3-5]] [[-|ch3-6]] + [[-|ch3-8]] [[-|ch3-9]]]</center>\n</td></tr></table>
<table><tr><td>\n[[2,578]]\n</td></tr></table>
When a body was discovered amid the charred remains of [[location]], [[names_men1]] suspected that it might have been [[names_women]], but it was not. She died many years later, far from Crestview, a <<print either("wealthy","reclusive","beautiful","wretched")>> amnesiac, never remembering her <<print either("former life","own name","troubled dreams")>>, never getting the chance to forgive [[names_men2]], never getting the chance to meet her own <<print either("daughter","twin","son","child")>>.
// Expands a symbol and returns the output.\nwindow.trace = function(symbol){\n\tif(symbol === undefined){\n\t\tsymbol = "origin";\n\t}\n\tif(tale.grammar === undefined){\n\t\tconsole.log("Couldn't find the grammar object.");\n\t\treturn "ERROR: Grammar object not found.";\n\t}\n\n\tvar output = tale.grammar.flatten("#" + symbol + "#")\t\n//\tconsole.log(symbol + " expands to:\sn" + output);\n\treturn output;\n}
v.2016-09-05
<table><tr><td>\n''Summer palace''\nThere is something shiny between the dragon's clenched teeth. <<replace "It's a key.">><<set $key to true>>[[You take the key.|summer palace]]<<endreplace>>\n\n</td></tr></table>
<table><tr><td>\n<<trace "page2">>\n\n<center>[[BACKWARD|ch2]] | [[FORWARD|p3]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page3">>\n\n<center>[[BACKWARD|p2]] | [[FORWARD|p4]]</center>\n</td></tr></table>
<table><tr><td>\nEveryone in Crestview commented on the peculiar weather.\n\n<center>[[BACKWARD|p5]] | [[FORWARD|p7]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page7">>\n\n<center>[[BACKWARD|p6]] | [[FORWARD|p8]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page4">>\n\n<center>[[BACKWARD|p3]] | [[FORWARD|p5]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page5">>\n\n<center>[[BACKWARD|p4]] | [[FORWARD|p6]]</center>\n</td></tr></table>
<table><tr><td>\n[[57]]\n</td></tr></table>
<table><tr><td>\n<<trace "page8">>\n\n<center>[[BACKWARD|p7]] | [[FORWARD|p9]]</center>\n</td></tr></table>
<table><tr><td>\n<<trace "page9">>\n\n<center>[[BACKWARD|p8]] | [[FORWARD|p10]]</center>\n</td></tr></table>
That night strange <<print either("lights","insects")>> illuminated the sky above [[location]].
<table><tr><td>\nWe all know about the [[classic dream:]]\n</td></tr></table>\n
<table><tr><td>\n<<trace "page1">>\n\n<center>[[FORWARD|p2]]</center>\n</td></tr></table>
<<if $key is false>><table><tr><td>\n''Temple hall''\nAs your eyes adjust to the darkness, you perceive on either side of you massive stone columns with capitals resembling open papyrus blossoms. On the columns are carved and painted scenes of priests presenting offerings to the gods. Beyond them, smaller columns--far too many to count--recede into the marshy darkness. \n\nLight filters in from high above, illuminating a path that leads to a small locked <<replace " door.">>door. (If you had the key, you could open it.)<<endreplace>>\n\n<p></p>\n<<replace "A priest is here.">>"RETURN HERE ALONE."<<endreplace>>\n\n<<replace "A priest is here.">>"ASK YOURSELF WHY YOU HAVE COME HERE."<<endreplace>>\n\n<<replace "A priest is here.">>"THE DESERT WILL SWALLOW YOU."<<endreplace>>\n\n<<replace "A priest is here.">>"THUS YOU WILL BE ABLE TO CONTINUE YOUR SEARCH."<<endreplace>>\n\n<<replace "A priest is here.">>"DO YOU KNOW WHO YOU ARE?"<<endreplace>>\n\n<<replace "A priest is here.">>"WHERE YOU HAVE COME FROM?"<<endreplace>>\n\n<<replace "A priest is here.">>"LOOK OVER US KINDLY."<<endreplace>>\n\n<<replace "A priest is here.">>"OR DIE WITHIN THE HOUR."<<endreplace>>\n\n<<replace "A priest is here.">>"GO NOW. GO!"<<endreplace>>\n\n<p></p>\nYou can go [[east|saloon]] from here.\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Temple hall''\nAs your eyes adjust to the darkness, you perceive on either side of you massive stone columns with capitals resembling open papyrus blossoms. On the columns are carved and painted scenes of priests presenting offerings to the gods. Beyond them, smaller columns--far to many to count--recede into the marshy darkness. \n\nLight filters in from high above, illuminating a path that leads to a small locked [[door.|hatch]] \n\n<p></p>\nYou can go [[east|saloon]] from here.\n</td></tr></table>\n<<endif>>
An "anonymous" tipster ([[names3]]) revealed to the //Star Tribune// that the fire had been deliberately set.
[[names_women1]] brainwashed [[names_men]] so that he would forget about her affair with [[names_women2]].
[[names2]] brainwashed themselves so that they would forget about their affair with [[names3]].
[[names_men1]] infiltrated the [[industry]] Labor Day <<print either("regatta","masquerade","orphan brunch")>> disguised as [[names_women1]]'s evil twin [[names_women2]].
The next week, someone set [[location]] on fire.
In an attempt to uncover the identity of the arsonist, [[names_men1]] spiked [[names_women1]]’s martini with <<print either("plasma","mushrooms","algae","a microdose of lsd","e-liquid","tears")>>. Later that night, she revealed that she was really [[names_men2]], <<print either("[[names_women2]]’s long-lost cousin","a hologram of [[names_women2]]", "[[names_women2]]’s nemesis","a hallucination of [[names_women2]]'s alter-ego","an avatar of [[names_women2]]'s algorithmic past","a vision of [[names_women2]]'s potential future","a glitched-out version of [[names_women2]]'s super-ego")>>.
<table><tr><td>\nThe fires raged all summer. \n\n<center>[[FORWARD|p24]]</center>\n</td></tr></table>
<table><tr><td>\nIt feels soft against your skin.\n\n[[It is the pool]]\n</td></tr></table>
<<if $key is false>><table><tr><td>\n''Caldarium''\nThe wet floor is warm against your bare feet. Steam rises from the circular pool in front of you, and you begin to sweat. On the walls are mosaics made from cubes of green, blue, and ochre glass. They depict maps of a declining empire.\n\n<p></p>\n<<replace "A priestess is here.">>"IF YOU FOLLOW A MIRAGE... "<<endreplace>>\n\n<<replace "A merchant is here.">>"IF YOU INSIST ON GOING..."<<endreplace>>\n\n<<replace "A glass-maker is here.">>"I’LL TELL ALL..."<<endreplace>>\n\n<<replace "A midwife is here.">>"THE DESERT WILL SWALLOW YOU."<<endreplace>>\n\n<<replace "A engineer is here.">>"WHO ARE YOU?"<<endreplace>>\n\n<<replace "A scholar is here.">>"WHY ARE YOU HERE?"<<endreplace>>\n\n<<replace "A mason is here.">>"WHERE HAVE YOU COME FROM?"<<endreplace>>\n\n<<replace "A messenger is here.">>"GO NOW. GO!"<<endreplace>>\n\n<<replace "A politician is here.">>"YOU ARE SURROUNDED BY DUST."<<endreplace>>\n\n<<replace "A doctor is here.">>"AND IT IS DUST YOU SHALL BECOME."<<endreplace>>\n\n<p></p>\nYou can go [[north|saloon]] or [[south|summer palace]] from here.\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Caldarium''\nThe wet floor is warm against your bare feet. Steam rises from the circular pool in front of you, and you begin to sweat. On the walls are mosaics made from cubes of green, blue, and ochre glass. They depict maps of a declining empire. \n\nIs the room shifting around you, or is it just the steam?\n\n<p></p>\nYou can go [[north|saloon]] or [[south|summer palace]] from here.\n\n</td></tr></table>\n<<endif>>
<table><tr><td>\nI guess <<if visited("SO ARE THE DAYS", "THE BOOK OF SAND", "A STRANGER WHOSE NAME I DON'T KNOW")>>[[this must be it--|epilogue]]<<else>>[[this must be it--|menu]]<<endif>>\n</td></tr></table>
[[names_women1]], disguised as [[names_women2]], <<print either("drew her body further and further into her shell","begged [[names_men1]] to divorce [[names_men2]]","convinced [[names_men]] to fake his own death and flee Crestview with her","persuaded [[names_men1]] to join the followers of Sri [[names_men2]], a guru of white capitalist mysticism")>>.
While the [[lastname]]s were at the [[industry]] <<print either("benefit","gala","biennale","employee softball game")>>, their house caught fire and was completely destroyed.
[[names2]] and [[names1]] staged a <<print either("midnight","sunrise","solstice","drive-by")>> <<print either("tryst","intervention","ritual","DNA test")>> at [[location]].
[[names_men]] miraculously emerged from his coma at the same moment that [[names_women2]] and [[names_women1]] realized they had been switched at birth.
[[names_women]] contracted a strange fever from a <<print either("contaminated dream","fish scale","raw egg","tincture of ginseng")>> and <<print either("in their delirium confessed to [[names_men]]'s kidnapping","created a scene at [[names_men]]’s funeral")>>.
[[names_women]] tried <<print either("self-hypnosis","regression therapy","lucid dreaming","ASMR","sensory deprivation")>> to recover her memories, but instead discovered an identity she lived in a former life: [[names_men]], <<print either("a kleptomaniac","a compulsive liar","a grifter","a Libra","a Gemini","an Aquarius")>> with <<print either("an amphibious heart","a secret","a troubled past","a heart of gold")>>.
[[names2]] <<print either("betrayed","seduced","blackmailed","cloned")>> [[names3]].
[[names_all]], a mysterious amnesiac, <<print either("was found wandering the beach, covered in kelp","was found squatting beneath the moon","barged into the Hotel Ripley, mumbling the names of Crestview’s most prominent residents")>>.
<table><tr><td>\nAnd just when you think you can walk no further, you come to the [[end of the hallway.]]\n</td></tr></table>
<table><tr><td>\nYou insert the key and [[turn it.]]\n\n</td></tr></table>
<table><tr><td>\nand [[that way again...|this way again...]]\nor [[this way...|this way again...]]\nor [[another way altogether...|this way again...]]\n</td></tr></table>
<table><tr><td>\nthe one where you are lost in a building that is [[endlessly unfolding,]]\n</td></tr></table>\n
<table><tr><td>\nAnd as you walk, down hallways that slope and twist and climb, revealing empty room after empty room--rooms that, as you peer into them, seem to grow ever more cavernous, you wonder if you are perhaps walking\n\nthrough the [[chambers of a shell][$walk = "shells"]]\nthrough the [[galleries of a museum|chambers of a shell][$walk = "galleries"]]\nthrough the [[halls of a glacier|chambers of a shell][$walk = "glaciers"]]\n</td></tr></table>
<<silently>>\nUses the parameter if one was passed. Then, checks for the $symbol variable. If neither is present, uses "origin". Clears $symbol at the end.\n\n<<if parameter(0)>>\n\t<<set $symbol to parameter(0)>>\n<<else>><<if $symbol>>\n\tNo need to do anything.\n<<else>>\n\t<<set $symbol to "origin">>\n<<endif>><<endif>>\n\n<<endsilently>><<print console.log("trace " + $symbol)>><<print tale.grammar.flatten("#" + $symbol + "#")>><<forget $symbol>>
<<if $key is false>><table><tr><td>\n''Monastery''\nThe room is cold and austere: floors of hardened earth, walls of baked brick, pillars of creaking wood. Dominating the front of the room is a sandalwood statue of the Buddha. It is said to answer the prayers of the sick. \n\n<p></p>\n<<replace "A monk is here.">>"WHO ARE YOU?"<<endreplace>>\n\n<<replace "A monk is here.">>"WHY ARE YOU HERE?"<<endreplace>>\n\n<<replace "A monk is here.">>"RETURN HERE ALONE."<<endreplace>>\n\n<<replace "A monk is here.">>"I’LL WAIT FOR YOU HERE."<<endreplace>>\n\n<p></p>\nA doorway leads [[south|saloon]]. Two colossal human-headed winged bulls guard a passage to the [[north|throne room]].\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Monastery''\nThe room is cold and austere: floors of hardened earth, walls of baked brick, pillars of creaking wood. Dominating the front of the room is a sandalwood statue of the Buddha. It is said to answer the prayers of the sick. \n\nYou can hear monks chanting sutras in another part of the monastery.\n\n<p></p>\nA doorway leads [[south|saloon]]. Two colossal human-headed winged bulls guard a passage to the [[north|throne room]].\n\n</td></tr></table>\n<<endif>>
// Returns a new version of a given expansion.\nwindow.retrace = function(symbol, old, maxAttempts){\n\tif(maxAttempts === undefined){\n\t\tmaxAttempts = 32;\n\t}\n\tif(!(maxAttempts > 1)){\n\t\tmaxAttempts = 1;\n\t}\n\t\n\tvar output = "", attempts = 0;\n\tdo{\n\t\toutput = trace(symbol);\n\t\tattempts++;\n\t}while(output == old && attempts < maxAttempts)\n\n//\tconsole.log("retrace:"\n//\t\t\t\t+ "\sn\stold: " + old\n//\t\t\t\t+ "\sn\stnew: " + output\n//\t\t\t\t+ "\sn\stattempts: " + attempts)\n\treturn output;\n}
<table><tr><td>\n[[96,814]]\n</td></tr></table>
Dawn Sueoka
<table><tr><td>\n<center>\n“This place is not meant to be shared. Return here alone when you wish to remember the cycle of things.”\n\n--//URU: Ages Beyond Myst//\n<p></p>\n<p></p>\n[[CREDITS]]\n\n</center>\n</td></tr></table>
<table><tr><td>\n<center>“We have built our world on sand in the form of concrete--and it is starting to crumble.” \n\n--Vince Beiser, //The World in a Grain//\n\n[[START|ch1]]</center>\n\n</td></tr></table>
Hayley\nMadison\nBrie\nCiara\nJordan\nMegan\nNicole\nAmanda\nAshley
html \n\n[data-tags="menu"] {\nfont-family: "Lucida Console", Monaco, monospace;\n font-size: 16px;\n color: #FFFFFF;\n background: #000000;\n}\n\n[data-tags="level1"] {\nfont-family: "Lucida Console", Monaco, monospace;\n font-size: 16px;\n color: #FFFFFF;\n background: url("ch1.gif");\nbackground-repeat: repeat;\n}\n\n[data-tags="level2"] {\nfont-family: "Lucida Console", Monaco, monospace;\n font-size: 16px;\n color: #FFFFFF;\n background: url("ch2.gif");\nbackground-repeat: repeat;\n}\n\n[data-tags="level3"] {\nfont-family: "Lucida Console", Monaco, monospace;\n font-size: 16px;\n color: #FFFFFF;\n background: url("ch3.gif");\nbackground-repeat: repeat;\n}\n\n[data-tags="level4"] {\nfont-family: "Lucida Console", Monaco, monospace;\n font-size: 16px;\n color: #FFFFFF;\n background: url("ch4.gif");\nbackground-repeat: repeat;\n}\n\n.transition-in {\n\topacity:1;\n\tposition:absolute;\n}\n\n\n.passage table {\nbackground-color: #000000;\nwidth: 70%;\n}\n\n.passage td {\npadding: 20px;\n}\n\n\n#sidebar {\n display: none;\n}\n\n.revision-span-in {\n\topacity: 0;\n}\n.revision-span:not(.revision-span-out) {\n\ttransition: 1s; -webkit-transition: 1s;\n}\n.revision-span-out {\n\tposition:absolute;\n\topacity: 0;\n}\n\n
<table><tr><td>\n<<trace "page13">>\n\n<center>[[BACKWARD|p12]] | [[FORWARD|p14]]</center>\n</td></tr></table>
Hayley\nMadison\nBrie\nCiara
<<if $key is false>><table><tr><td>\n''Saloon''\nThe smell of sweat and whisky makes your eyes water. There’s a long, oak-paneled bar here, with squat brass spittoons at both ends. An overturned poker table suggests a recent brawl. Drops of blood are scattered among the fallen cards.\n\n<p></p>\n<<replace "A miner is here.">>"GO NOW. GO!"<<endreplace>>\n\n<<replace "A bandit is here.">>"OR DIE WITHIN THE HOUR."<<endreplace>>\n\n<<replace "A banker is here.">>"I’LL TELL ALL..."<<endreplace>>\n\n<<replace "A madam is here.">>"ONLY ONE PATH IS TRUE."<<endreplace>>\n\n<<replace "A deputy is here.">>"DO YOU KNOW WHO YOU ARE?"<<endreplace>>\n\n<<replace "A pharmacist is here.">>"ASK YOURSELF WHY YOU HAVE COME HERE."<<endreplace>>\n\n<<replace "A stranger is here.">>"IF YOU INSIST ON GOING..."<<endreplace>>\n\n<<replace "A bartender is here.">>"LOOK OVER US KINDLY."<<endreplace>>\n\n<<replace "A gambler is here.">>"THE DESERT WILL SWALLOW YOU."<<endreplace>>\n\n<p></p>\nYou can go [[north|monastery]], [[east|pavilion]], [[south|caldarium]], or [[west|ch4]] from here.\n\n</td></tr></table><<else>>\n<table><tr><td>\n''Saloon''\nThe smell of sweat and whisky makes your eyes water. There’s a long, oak-paneled bar here, with squat brass spittoons at both ends. An overturned poker table suggests a recent brawl. Drops of blood are scattered among the fallen cards.\n\nYou’re feeling awfully thirsty.\n\n<p></p>\nYou can go [[north|monastery]], [[east|pavilion]], [[south|caldarium]], or [[west|ch4]] from here.\n\n</td></tr></table>\n<<endif>>
<table><tr><td>\nYou step out into the desert. The moon illuminates the contours of the dunes. \n\nYour mind gurgles. Above you the stars bulge. \n\nWho are you? \n\nWhat are you doing here? \n\nWhere are you going? \n\nAs you stagger over the sand, your mind keeps repeating the misheard lyrics to a song you once heard:\n\n<center>\n<<replace>>//"moon river, softer than a smile..."//<<becomes>>//"moon river, wider than a while…"//<<becomes>>//"moon river, softer than it seems…"//<<becomes>>//"moon river, wider than a dream…"//<<becomes>><<if visited("THE DREAM", "SO ARE THE DAYS", "THE BOOK OF SAND")>>[[THE END|epilogue]]<<else>>[[THE END|menu]]<<endif>><<endreplace>>\n</center>\n</td></tr></table>