summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html2
-rw-r--r--static/poems.js110
-rw-r--r--static/script.js6
3 files changed, 91 insertions, 27 deletions
diff --git a/index.html b/index.html
index 53af710..9505f7f 100644
--- a/index.html
+++ b/index.html
@@ -84,7 +84,7 @@
</div>
<div id="win" style="display: none;">
<p>
- Victory is yours! Today&rsquo;s secret line was in
+ Huzzah! Today&rsquo;s secret line was in
<strong id="meter"></strong>:
</p>
<pre id="ctx" class="poetry"></pre>
diff --git a/static/poems.js b/static/poems.js
index e51bddf..86b4c15 100644
--- a/static/poems.js
+++ b/static/poems.js
@@ -5,8 +5,9 @@ var challenges = [
"title": "Lines written a few miles above Tintern Abbey",
"collection": "Lyrical Ballads",
"author": "William Wordsworth",
- "meter": "iambic pentameter",
- "ctx": `And I have felt
+ "meter": "iambic pentameter",
+ "ctx": `
+And I have felt
A presence that disturbs me with the joy
Of elevated thoughts; a sense sublime
Of something far more deeply interfused,
@@ -15,7 +16,8 @@ And the round ocean, and the living air,
And the blue sky, and in the mind of man,
A motion and a spirit, that impels
All thinking things, all objects of all thought,
-And rolls through all things.`,
+And rolls through all things.
+`,
"link": "https://www.gutenberg.org/files/9622/9622-h/9622-h.htm#poem23",
},
{
@@ -24,11 +26,13 @@ And rolls through all things.`,
"title": "The Destruction of Sennacherib",
"collection": "Hebrew Melodies",
"author": "Lord Byron",
- "meter": "anapestic tetrameter",
- "ctx": `For the Angel of Death spread his wings on the blast,
+ "meter": "anapestic tetrameter",
+ "ctx": `
+For the Angel of Death spread his wings on the blast,
And breathed in the face of the foe as he passed;
And the eyes of the sleepers waxed deadly and chill,
-And their hearts but once heaved, and for ever grew still!`,
+And their hearts but once heaved, and for ever grew still!
+`,
"link": "https://www.poetryfoundation.org/poems/43827/the-destruction-of-sennacherib",
},
{
@@ -37,13 +41,15 @@ And their hearts but once heaved, and for ever grew still!`,
"title": "Book IV",
"collection": "Paradise Lost",
"author": "John Milton",
- "meter": "iambic pentameter",
- "ctx": `Me miserable! which way shall I flie
+ "meter": "iambic pentameter",
+ "ctx": `
+Me miserable! which way shall I flie
Infinite wrauth, and infinite despaire?
Which way I flie is Hell; my self am Hell;
And in the lowest deep a lower deep
Still threatning to devour me opens wide,
-To which the Hell I suffer seems a Heav'n.`,
+To which the Hell I suffer seems a Heav'n.
+`,
"link": "https://milton.host.dartmouth.edu/reading_room/pl/book_4/text.shtml",
},
{
@@ -52,15 +58,17 @@ To which the Hell I suffer seems a Heav'n.`,
"title": "The Famine",
"collection": "The Song of Hiawatha",
"author": "Henry Wadsworth Longfellow",
- "meter": "trochaic tetrameter",
- "ctx": `Then they buried Minnehaha;
+ "meter": "trochaic tetrameter",
+ "ctx": `
+Then they buried Minnehaha;
In the snow a grave they made her,
In the forest deep and darksome,
Underneath the moaning hemlocks;
Clothed her in her richest garments,
Wrapped her in her robes of ermine,
Covered her with snow, like ermine;
-Thus they buried Minnehaha.`,
+Thus they buried Minnehaha.
+`,
"link": "https://www.gutenberg.org/files/30795/30795-h/30795-h.htm#XX",
},
{
@@ -69,11 +77,13 @@ Thus they buried Minnehaha.`,
"title": "The Passionate Shepherd to His Love",
"collection": null,
"author": "Christopher Marlowe",
- "meter": "iambic tetrameter",
- "ctx": `And we will sit upon the rocks,
+ "meter": "iambic tetrameter",
+ "ctx": `
+And we will sit upon the rocks,
Seeing the shepherds feed their flocks
By shallow rivers to whose falls
-Melodious birds sing madrigals.`,
+Melodious birds sing madrigals.
+`,
"link": "https://en.wikipedia.org/wiki/The_Passionate_Shepherd_to_His_Love",
},
{
@@ -82,8 +92,9 @@ Melodious birds sing madrigals.`,
"title": "Puck, Act II, Scene I",
"collection": "A Midsummer's Night Dream",
"author": "William Shakespeare",
- "meter": "iambic tetrameter",
- "ctx": `Over hill, over dale,
+ "meter": "iambic tetrameter",
+ "ctx": `
+Over hill, over dale,
Thorough bush, thorough brier,
Over park, over pale,
Thorough flood, thorough fire,
@@ -94,7 +105,8 @@ To dew her orbs upon the green.
The cowslips tall her pensioners be:
In their gold coats spots you see;
Those be rubies, fairy favours,
-In those freckles live their savours:`,
+In those freckles live their savours:
+`,
"link": "http://shakespeare.mit.edu/midsummer/full.html#2.1.2",
},
{
@@ -103,8 +115,9 @@ In those freckles live their savours:`,
"title": "Sonnet XLIII",
"collection": "",
"author": "Edna St. Vincent Millay",
- "meter": "iambic pentameter",
- "ctx": `What lips my lips have kissed, and where, and why,
+ "meter": "iambic pentameter",
+ "ctx": `
+What lips my lips have kissed, and where, and why,
I have forgotten, and what arms have lain
Under my head till morning; but the rain
Is full of ghosts tonight, that tap and sigh
@@ -117,7 +130,8 @@ Nor knows what birds have vanished one by one,
Yet knows its boughs more silent than before:
I cannot say what loves have come and gone,
I only know that summer sang in me
-A little while, that in me sings no more.`,
+A little while, that in me sings no more.
+`,
"link": "https://www.poetryfoundation.org/poems/46557/what-lips-my-lips-have-kissed-and-where-and-why",
},
{
@@ -126,8 +140,9 @@ A little while, that in me sings no more.`,
"title": "In Memory of W. B. Yeats",
"collection": "",
"author": "W. H. Auden",
- "meter": "catalectic trochaic tetrameter",
- "ctx": `Earth, receive an honoured guest:
+ "meter": "catalectic trochaic tetrameter",
+ "ctx": `
+Earth, receive an honoured guest:
William Yeats is laid to rest.
Let the Irish vessel lie
Emptied of its poetry.
@@ -140,7 +155,54 @@ Each sequestered in its hate;
Intellectual disgrace
Stares from every human face,
And the seas of pity lie
-Locked and frozen in each eye.`,
+Locked and frozen in each eye.
+`,
"link": "https://poets.org/poem/memory-w-b-yeats",
},
+ {
+ "line": "To skies that knit their heartstrings right".split(' '),
+ "scansion": ['x', '/', 'x', '/', 'x', '/x', '/'],
+ "title": "From Clee to heaven the beacon burns",
+ "collection": "A Shropshire Lad",
+ "author": "A. E. Housman",
+ "meter": "iambic tetrameter",
+ "ctx": `
+To skies that knit their heartstrings right,
+ To fields that bred them brave,
+The saviours come not home to-night:
+ Themselves they could not save.
+`,
+ "link": "https://www.poetryfoundation.org/poems/44410/a-shropshire-lad-1-from-clee-to-heaven-the-beacon-burns",
+ },
+ {
+ "line": "Into the jaws of Death".split(' '),
+ "scansion": ['/x', 'x', '/', 'x', 'x'],
+ "title": "The Charge of the Light Brigade",
+ "collection": null,
+ "author": "Alfred, Lord Tennyson",
+ "meter": "dactylic dimeter",
+ "ctx": `
+Cannon to right of them,
+Cannon to left of them,
+Cannon in front of them
+ Volleyed and thundered;
+Stormed at with shot and shell,
+Boldly they rode and well,
+Into the jaws of Death,
+Into the mouth of hell
+ Rode the six hundred.
+`,
+ "link": "https://www.poetryfoundation.org/poems/45319/the-charge-of-the-light-brigade",
+ },
]
+ // {
+ // "line": "Into the jaws of Death".split(' '),
+ // "scansion": ['/x', 'x', '/', 'x', 'x'],
+ // "title": "The Charge of the Light Brigade",
+ // "collection": null,
+ // "author": "Alfred, Lord Tennyson",
+ // "meter": "dactylic dimeter",
+ // "ctx": `
+// `,
+ // "link": "https://www.poetryfoundation.org/poems/45319/the-charge-of-the-light-brigade",
+ // },
diff --git a/static/script.js b/static/script.js
index 41d9278..0de93ad 100644
--- a/static/script.js
+++ b/static/script.js
@@ -222,7 +222,8 @@ function winGame(challenge) {
document.getElementById('btns').style = 'display: none;'
document.getElementById('meter').innerText = challenge.meter
var collection = challenge.collection ? `${challenge.collection}, ` : ""
- document.getElementById('ctx').innerHTML = challenge.ctx.replaceAll(/^(.*)/gm, ' $1') + `\n\t<span class="byline">&mdash;<a href="${challenge.link}">${challenge.title}</a>\n\t\t${collection}${challenge.author}</span>`
+ var ctx = challenge.ctx.replace(/^\n/, '').replace(/\n$/, '').replaceAll(/^(.*)/gm, ' $1')
+ document.getElementById('ctx').innerHTML = ctx + `\n\t<span class="byline">&mdash;<a href="${challenge.link}">${challenge.title}</a>\n\t\t${collection}${challenge.author}</span>`
var firstguess = Object.values(guesses[0]).join(' ')
document.getElementById('share').value = `I solved Prosodyle #${getChallengeIdx()+1} at cyfraeviolae.org/prosodyle. My first guess was: "${firstguess}."`
}
@@ -302,7 +303,8 @@ function getDayOfYear() {
}
function getChallengeIdx() {
- return getDayOfYear() - 57
+ var idx = getDayOfYear() - 57
+ return Math.min(idx, challenges.length-1)
}
function getDailyChallenge() {