One hundred million million poems
1 April 2016
The last time I wrote, I had just begun to learn how to program in Python, creating a simple programmed version of Raymond Queneau’s Cent mille milliards de poèmes for my Annex 3. This program, along with my Annexes 2 (S+7) and 4 (Queneau’s Un conte à votre façon ) would be the most important part of my project, as the Oulipo had made its own digital versions of these texts at several key moments in its history. However, the Cent mille milliards de poèmes program was relatively simple compared to the programming skills I needed for the other projects, so I spent the month of January going through a more difficult introduction to Python.
Zed A. Shaw’s Learn Python the Hard Way was an excellent introduction to more advanced object-oriented programming, and one of the final exercises seemed to be perfectly adaptable for my Annex 4. I therefore decided to create my own version of this program in order to make an interactive, digital edition of Un conte à votre façon. The way Shaw’s program worked was that it created a map, took raw input from the reader at select moments, and then used that input to choose the next place in the map to go. My program worked perfectly up to a certain point, but to add a graphical component to the mix, it wasn’t quite sufficient.
To create a graph of Un conte à votre façon, I used the nodes (Queneau’s basic story elements that are numbered in the text) and the edges (the choices he offers the reader at the end of each numbered element) to create a simple graphviz plot. Very happy with the graph, I then realized that two separate programs — one to allow the reader to move throughout the graph and read the story, and another to generate a graph — was overkill. It would be simpler and more elegant to make my original program reflect the structure of graphs.
It was then that I was introduced to the notion of data structures. Rather than create a simple map, I had to divide Queneau’s texts (as I had already done in my head) into nodes and edges in order to create my program. Then, I had to write functions that would allow the reader to enter the program at the first node (Queneau’s text always begins at 1), that would then give the reader the appropriate choices (ergo, the edges associated with that particular node), ask the reader for his choice (the raw input), then move on to the next appropriate node. Once I had done all that, I had an elegant data structure of a Graph with Nodes and Edges. At the end, I used this structure in conjunction with graphviz in order to print out the graph of the program. Finally, the program seemed perfect!
Well, there were a few additional steps to take. First, I had to put in an error checking mechanism, since at the time, the reader could put in any node when prompted for a choice whether or not it was one of the choices presented. Once I had done that, I wanted a way to color the nodes that the reader had chosen. That way, the graph printed out in the end would reflect the story the reader had actually read. Luckily, it turns out that graphviz can handle that request, and my program was complete.
Completing my fourth annex was not only a lesson in programming, but it was an excellent way to analyze the text. Queneau wrote Un conte à votre façon in the milieu of Oulipo, amid the theoretical buzz of Vladimir Propp’s Morphology of the Folktale (which had recently been translated into French) and the mathematical developments of Claude Berge (a fellow Oulipo member who was also one of the most influential mathematicians in field of graph theory). While many read Un conte à votre façon as a commentary on Propp’s notion that folktales (or contes) are nothing more than combinations of the same basic elements, it is also readable as a graph. Reimagining it as a data structure made of nodes and edges helped me with my own analysis of the text, which I was able to incorporate right into the fourth chapter. Now there is a solid connection between my Annex 4 and Chapter 4, meaning that another digital annex is successfully completed.