dariusk / NaNoGenMo-2014

National Novel Generation Month, 2014 edition.
258 stars 17 forks source link

This is unutterably wonderful! #68

Open ceoln opened 9 years ago

ceoln commented 9 years ago

I've been interested in generative things forever (see, oh, I dunno, my ancient DOOM level generator http://doom.wikia.com/wiki/SLIGE, and the generator of rules for 1D cellular automata http://www.davidchess.com/toys/odca.html , and some generated music mentioned briefly http://davidchess.com/words/log.20001020.html#20001023 ), and I've also done NaNoWriMo a few times (most were ordinary novels more or less with narratives, but "Silence. Silence. Silence. Silence." might I suppose be mistaken for something algorithmic http://www.davidchess.com/words/n2009.txt ).

I didn't finish my NaNoWriMo novel last year (was that just last year?), and had just decided not to start one this year, but this NaNoGenMo has got me all enthused now.

My initial thought is to do some sort of simple generative grammar with parameters, but that's just an initial thought. And if it gets late in the month I can always go for vaguely convincing-looking text in an unknown tongue (hm, that sounds kind of interesting, actually).

ceoln commented 9 years ago

... so now I am thinking about a parameterized generative grammar with the terminals in a fictional language. Could be ossum!

hugovk commented 9 years ago

See also https://github.com/dariusk/NaNoGenMo-2014/issues/45 for an entry using the Voynich manuscript which works really well.

ceoln commented 9 years ago

Yeah, that one is cool! I've decided to (to start with anyway) limit myself to what a self-contained C program can do (so, generating sequences of alphanumerics and punctuation, not fetching anything from the web). Old skool style. :)

I now have an Eclipse project and .c file called "elegant iron oven" (it's an anagram). Current plan is to produce what looks like a foreign-language novel in your basic ASCII-type character set. Flat text to start with, might get ambitious and produce LaTex or pdf or something later on.

ceoln commented 9 years ago

Well, we are rollin'. :) First sample output (just a little structure): https://drive.google.com/file/d/0B_FnSSonAA5yX21YMkhfbklHN0E/view?usp=sharing

hugovk commented 9 years ago

If you can stretch to non-ASCII, a few umlauts and accents peppered here and there really help things look foreign.

ceoln commented 9 years ago

That is true. :) Maybe as a command-line switch...

ceoln commented 9 years ago

More progress!

https://drive.google.com/file/d/0B_FnSSonAA5yZFltRC1yQ1ZXaXJZZEJPTGdKbVNYYy1tYzg4/view?usp=sharing

Now includes a bit of flat-text formatting, and unpronouncible fake words! Very primitive algorithms so far, but woo woo! Reminds me of stuff I did in High School in BASIC. :)

cpressey commented 9 years ago

Definitely scores some points in my book* for using a programming language that doesn't have automatic memory management!

*and now I choose use this idiom even though it is apt to be confusing here

ceoln commented 9 years ago

Yeah, not to mention the most primitive possible string support. :) Takes me back to my roots.

Here is Ej Onike Yboruzi; it is just over 50K words, but it's still extremely primitive. I want to get the statistics more like a natural language, to have it use a finite list of words rather than making them up from scratch, and so on...

https://drive.google.com/file/d/0B_FnSSonAA5yOGhuZUp4aHhPQWJYMWhLRy1QTVNjdHhPTDZ3/view?usp=sharing

ceoln commented 9 years ago

Now it takes from a finite list of words, although still completely at random. Oj Eninco:

https://drive.google.com/file/d/0B_FnSSonAA5yLUFGZ3ZEVGNfSVU/view?usp=sharing

Next to do something like sorting the list roughly by word-length, and choosing the next word according to a Zipfian distribution. Or something like th at...

ceoln commented 9 years ago

I'm going to declare victory here :) as the month got busy and I never did much more than what I'd already mentioned as of the last comment. But it meets the requirements!

The official sample novel, "Gazanduwo U": https://drive.google.com/file/d/0B_FnSSonAA5yektjQ3M2MG5ETFU/

The Source Code (terribly-written and non-maintainable C code; see disclaimers at the beginning): https://drive.google.com/file/d/0B_FnSSonAA5yMW9JcnNZUGhfV00/

The program is called Elegant Iron Oven, because I was on an Anagram Server kick that week. :)

The underlying principles will be obvious (hahaha) from the source code.