The 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 \
% 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.