dariusk / NaNoGenMo

National Novel Generation Month. Because.
184 stars 16 forks source link

Grid Remix: LOTR #33

Open jeffThompson opened 10 years ago

jeffThompson commented 10 years ago

Well, here goes...

dariusk commented 10 years ago

!

jeffThompson commented 10 years ago

Well, not what I wanted but still interesting: some kind of text-gridding glitch:

The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The The

The Lord of the Rings Part 1 The Fellowship of the Ring By J R R Tolkien Part 1 The Fellowship of the Ring Part 2 The Two Towers Part 3 The Return of the King Three Rings for the Elvenkings under the sky Seven for the Dwarflords in their halls of stone Nine for Mortal Men doomed to die One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie One Ring to rule them all One Ring to find them One Ring to bring them all and

The of Rings 1 Fellowship the By R Tolkien 1 Fellowship the Part The Towers 3 Return the Three for Elvenkings the Seven the in halls stone for Men to One the Lord his throne the of where Shadows One to them One to them Ring bring all in darkness them the of where Shadows CONTENTS PROLOGUE Concerning 2 Pipeweed Of Ordering the 4 the of Ring on Shire THE OF RING I 1 Longexpected Chapter The of Past 3 is Chapter A Cut Mushrooms 5 Conspiracy Chapter The Forest 7 the of Bombadil 8 on

The the 1 of By R 1 of Part Two 3 of Three the the for in of for doomed One Dark his In of the One rule One find Ring them in bind the Mordor Shadows FOREWORD Concerning Concerning Of of 4 Finding Ring the THE THE I A Chapter Shadow Past Three Chapter Short Mushrooms A Chapter Old 7 House Bombadil Fog BarrowDowns At of Pony Strider A the 12 the II Many 2 of 3 Goes 4 in Chapter Bridge Chapter Chapter Mirror Chapter to 9 River The the TWO III The Boromir

The Rings Fellowship By Tolkien Fellowship Part Towers Return Three Elvenkings Seven in stone Men One Lord throne of Shadows to One them bring in them of Shadows PROLOGUE 2 Of the the Ring Shire OF I Longexpected The Past is A Mushrooms Conspiracy The 7 of 8 BarrowDowns the Prancing Strider Knife Chapter the Chapter Chapter of The Chapter in 5 Khazaddm Chapter of Farewell 9 Chapter of TWO Chapter of The Chapter Chapter 5 Chapter of Chapter Chapter to Flotsam 10 Saruman Palant_r 1 Smagol Passage Chapter Gate 4 Stewed The West Forbidden Journey

dariusk commented 10 years ago

My wife just read this out loud in the living room. Good times.

jeffThompson commented 10 years ago

Is there a 'like' button on here? :)

catseye commented 10 years ago

In lieu of a "Like" button there's :+1:

Also, :+1:

jeffThompson commented 10 years ago

Ok, in progress. An existing text is loaded word-by-word, then organized into a 2d grid. Using a random start position in the grid, the "cursor" is moved up, down, left, or right and that word is added. The process is repeated up to 50k words. Random commas, periods, and paragraph breaks are also added along the way.

An excerpt, using "Tale of Two Cities" as a source text:

Jurys upon pay thousand one and one. Thousand were I than tried He tried than I were thousand seven, now were and than. I, were and than and were, thousand one. November before and were now turned now were now turned done to explain to. Tried than tried than better. Than and, before better before and were I to the to explain to when time.

More. Remarkable more remarkable of remarkable of lawwork no lawwork to do Dont. Do too Lord too Lord inquired of living in London in London in London, arisen to arisen and do to how. Known not known where up did seventyfive, stood seventyfive stood seventyfive did seventyfive stood up did up where business did seventyfive. Stood seventyfive stood had, not that not had stood again and Was, all unless the prisoners that had it had passing arts and thought of powers of thought been more knew was knew they knew. More slowly the slowly. The slowly nothing about the and the about nothing taken off about off taken, prisoner in off taken off That the. That. The about nothing about nothing taken off about the about nothing slowly. Nothing knew they been. They. That had it Some it had passing thought and powers of the slowly the infamy the of selfdeceit infamy selfdeceit of.

Another example, with repetition allowed (LOTR as source):

Help would help would help would judgement For help for help help for them, for who would judgement For For help For even even even even, the even it at looked and and, and again death death friends who who who in death out pocket out death out death death friends friends friends task easy easy an first an fine, deal his pocket his of his of of chosen and his deal his deal fine fine his first first his were him him were There There tracked tracked that find is. Begins to grip But as as far far as as But too too clear Making far far far as to as as out as task friends task friends who who for who who for them them for for Gollums out as.

Source code and texts here: https://github.com/jeffThompson/NaNoGenMo

jeffThompson commented 10 years ago

Done! Or at least, draft sent to Blurb for proofing.

UPDATED/REVISED PROCESS: The book was created algorithmically using custom software written in Python and Processing. J.R.R. Tolkien’s 1954 classic The Fellowship of the Ring was loaded word-by-word then organized into a two-dimensional grid. From a random start position in the grid, the “cursor” was moved up, down, left, or right and that word added to the new text.

The process was repeated until 50,000 words was reached, the length of an average novel.

Random commas, periods, paragraph breaks, and chapters were added along the way. Any sentence including a variation of the words “s/he said” was placed in quotes.

THE FIRST CHAPTER:

The real ten the the real war. Whatsoever. It has indeed this remarkable things remarkable things. Remarkable things comely the upper vales their things comely things comely this. Remarkable, people. Remarkable things upper the comely things comely the upper the upper the upper vales of faces from the outset as between the between as between anduin sea outside to out sea the over, the over the sea outside mostly outside to as mostly and barns as mostly as to outside. To out of westernesse but battle last hanging said hanging last westernesse but westernesse eaves rule eaves westernesse. But they greenwood the greenwood the were fornost were they. Greenwood natured rather than the earlier beautiful and beautiful than rather possess situation if conclusion if conclusion already were, already chapter chapter chapter chapter some chapter of, mordor. With my where the feet home of heard never old shire the scent regarded the of mushrooms was rising clop and got the got I got, and well thoughtfully him a lantern clop clop a him at with. Out scent, of the of scent the the held waggon held, old the I though of the of though merry though. Of the I did I never heard like look my. Feet like feet home many any horse any the any. Of home many there feet the tower of tower the to the, by read by the tower the shadows. Of cirith ungol. Elrond since.

It. Finally appeared the appeared in appeared high the gondolin the finally the finally the high elves land of shadow the, and of and print. And print then print and of, shadow one shadow one ring. Chapter shadow one all one ring chapter ring chapter ring of shout of ring to 3 to things things of whoa them from whoa reminded whoa of things. Things of, shout one all of, all them rule the 2 to rule them all them. Land, them all one all them rule them. Land elves and print in appeared the of the few with cheeked red readers such for bright broad book different, book broad the and the and the and the misty mountains misty the misty the misty the and, the misty. Mountains lands mountains lands of into the museum at by at sent north later north later they later north. Sent at, sent some. Michel the even and even the even varieties even and windows round marish down. By at museum down.

Marish round marish round windows round district especially by the the the duty before though only by although families leading from preference a, inhabitants a inhabitants or inhabitants the walls or witch the fast and beautiful and fast and the misty bright. Eyed such for book different entirely, different. And for book different book for and different and for such for, and much further readers further the development back development back further much directed or many people matter people. Many people since elrond gondolin, elrond gondolin the 2 chapter ring one. Ring to ring chapter ring a was of many of many home of any horse of many. Any horse. Any. Horse of was a his swimming his swimming horse swimming the brandywine but things. But foreigners as what or bilbo’s or things or have horses were it were horses have what as what as it as it were it as what have, it have or shout one shadow. Chapter shadow one shout. One ring one. All one all a shout a all a things. Things but what as what a things but things and splash and a shout one shout one shadow of land elves land elves, land of all. One ring chapter shadow chapter ring. One ring.

ALSO: The print book is based on the first-edition printing of LOTR, using the same font/size and colors. The "Ring Poem" was also translated into Tolkien's Black Speech, though LOTR geeks might find some grammatical issues :)

MichaelPaulukonis commented 10 years ago

Curiouser and curiouser!

Would it be possible to do a Knight's Tour (or Knight Graph) solution, where the algorithm can jump around the text a limited amount, but is required to visit every word one? You would end up with a novel the same size as the original (+|- punctuation).

250px-knight s_tour_anim_2

jeffThompson commented 10 years ago

Interesting idea! That would certainly be possible, though I would guess that by jumping rather than moving +/- 1 that you would lose some of the continuity of the text.

I was also thinking that the algorithm could remove words that were picked, then jump over blanks to the next available tile. This wouldn't get every word, but would give a wider range of selected words.

MichaelPaulukonis commented 10 years ago

Continuity is already broken with vertical movement, but that did strike me as well. There's nothing left for contiguous-word continuity, with knight-jumping.

For text the algorithm shouldn't be so strict -- not every jump would have to be non-contiguous. It was more the idea of using each [square|word] exactly once. A trivial solution would then be to traverse the grid from upper-left to lower-right, but that should be disallowed.


Interesting note:

In the 20th century, the Oulipo group of writers used [the Knight's tour] among many others. The most notable example is the 10 × 10 Knight's Tour which sets the order of the chapters in Georges Perec's novel Life: A User's Manual. (source)

enkiv2 commented 10 years ago

A knight's tour on the sentence level should be more readable (and you can then scramble the internals of each sentence separately -- which will be no problem, given Tolkein's average sentence length!)

On Fri, Nov 15, 2013 at 9:44 AM, Michael Paulukonis < notifications@github.com> wrote:

Continuity is already broken with vertical movement, but that did strike me as well. There's nothing left for contiguous-word continuity, with knight-jumping.

For text the algorithm shouldn't be so strict -- not every jump would have to be non-contiguous. It was more the idea of using each [square|word] exactly once. A trivial solution would then be to traverse the grid from

upper-left to lower-right, but that should be disallowed.

Interesting note:

In the 20th century, the Oulipo group of writers used [the Knight's tour] among many others. The most notable example is the 10 × 10 Knight's Tour which sets the order of the chapters in Georges Perec's novel Life: A User's Manual. (sourcehttp://en.wikipedia.org/wiki/Knight%27s_tour#History )

— Reply to this email directly or view it on GitHubhttps://github.com/dariusk/NaNoGenMo/issues/33#issuecomment-28573537 .

jeffThompson commented 10 years ago

I like the idea of reworking on the sentence or paragraph level, then perhaps using the same method to rearrange the resulting pieces.

MichaelPaulukonis commented 10 years ago

o hai! I found your blog today when I was looking for pixelization code in Processing. Digging through posts, I discovered we had "met" tangentially in here....

http://www.jeffreythompson.org/blog/2013/11/10/grid-remix-fellowship-of-the-ring/

Partially, you are to blame for pablopixel. But do not weep! If not yours, some other code would have been abus-ed.

jeffThompson commented 10 years ago

Hey Michael, I don't think that's my pixelate code, but cool! Here's mine: https://github.com/jeffThompson/ProcessingTeachingSketches/blob/master/ImageProcessingAndOpenCV/PosterizeAndDownsampleImage/PosterizeAndDownsampleImage.pde

MichaelPaulukonis commented 10 years ago

No, the core of void pixelateImage(int pxSize) I;mworking with came from you. Unless that's a different Jeffery Thompson who also did a LOTR grid-remix.

My code has changed a bit from yours, but that was the ur-template. I ditched the ratio because I wanted squares. Still thinking about that, though. I don't like partially-sized boxes on the right and bottom.

Anyway, enjoying your blog, and glad for the serindip.

jeffThompson commented 10 years ago

I am one in the same! Must be an older version of the pixelate code. Glad it helped!