Megawatt

Megawatt coverThe fruits of my National Novel Generation Month (NaNoGenMo) labors are now online; the _Megawatt_ generator is available as a single 350-line Python file, while the novel it deterministically generates can be obtained as a PDF, megawatt.pdf or in epub format, megawatt.epub. From the program’s docstring and from the preface to the book:

_Megawatt_ is the title of both a computer program, the source code
to which you may be reading, and the output of this program, which in
many ways is like a standard novel and which you may instead be reading.
This note appears at the beginning of both.

The program _Megawatt_ is based on passages from Samuel Beckett’s novel
_Watt,_ first published in 1953 but written much earlier, when Beckett
was aiding the French Resistance during World War II.

The novel _Megawatt_ leaves aside all of the more intelligible language
of Beckett’s novel and is based, instead, on that which is most systematic
and inscrutable. It does not just recreate these passages, although with
minor changes the _Megawatt_ code can be used to do so. In the new novel,
rather, they are intensified by generating, using the same methods that
Beckett used, significantly more text than is found in the already
excessive _Watt_.

(Please note: The following information is handy if you want to, for instance, modify the program and generate a PDF or epub yourself. You don’t need to do this to read the novel. You can download it in PDF: megawatt.pdf or in epub format: megawatt.epub.)

To produce the novel in markdown format, run megawatt.py (a Python 2
program) with TextBlob (a text processing library) installed.

% python megawatt.py > megawatt.text

To produce PDF and epub documents, use pandoc:

% pandoc -V geometry:paperwidth=5.5in \
-V geometry:paperheight=8.25in \
-V geometry:margin=.7in -o megawatt.pdf \
megawatt.text
% echo ‘% Megawatt’ > info.txt
% echo ‘% Nick Montfort’ >> info.txt
% pandoc -o megawatt.epub info.txt megawatt.text

_Megawatt_ was written/generated for the second NaNoGenMo (National
Novel Generation Month) in November 2014, and is free software.