Remarks: Ports to Other Platforms

From Maze

Jump to: navigation, search

PATH: Maze as Program

While computer users may think of programming languages as relatively straightforward instruments used to produce increasingly complex or efficient tools and experiences, 10 PRINT shows that the code itself can have aesthetic features worthy of consideration on their own merit.

A small but lively group of programmers rejects the values of clarity and efficiency in programming, in favor of other code aesthetics. While some of these techniques rely on the exploitation of conventions in existing, "normal" programming languages, others involve the invention of entirely new languages with their own aesthetic properties. These "esoteric" or "weird" languages test the limits of programming language design and comment upon programming languages themselves.

Many weird languages comment on the practices of programming, but the sort Michael Mateas and Nick Montfort dub "minimalist" comment on the space of computation itself. As they put it, "Minimalist languages strive to achieve universality while providing the smallest number of language constructs possible. Such languages also often strive for syntactic minimalism, making the textual representation of programs minimal as well." The archetypical minimalist language is Brainfuck. It provides seven commands, each corresponding to a single character of punctuation.

Another style of weird language uses a two-dimensional space to hold a program's instructions, rather than the usual organization into lines of code. One such example is Piet, a language whose source code resembles abstract paintings (like those by its namesake, Piet Mondrian). Another is Befunge, which uses typographical symbols like <, v, and ^ to move program flow.

PATH is a weird language that borrows from the conventions of Brainfuck and Befunge, offering a syntactically constrained language whose control flow takes place in a two-dimensional space.

PATH has a natural connection to 10 PRINT because the language uses the / and \ characters for program flow. / and \ are reflectors. As the program counter travels around in 2D space, it bounces off the reflectors in the intuitive way. Here's a path program that computes nothing (but moves the PC around).

    /      \
$  /      /

Control starts at the dollar sign and flows to the right. It bounces off the first reflector and goes up, then bounces right, then down, then left then down (and at this point would flow off the edge, terminating the program).

In addition to / and \, PATH uses v ^ < > to move the flow conditionally, down, up, left and right, respectively, if the current memory location is non-zero. Memory locations are arrayed on an infinite tape Turing style, and you can increment and decrement the current memory focus.

Given PATH's strong typographical similarity to 10 PRINT, it's possible to implement a version of 10 PRINT in PATH--a program that generates labyrinths by endlessly walking a labyrinth. Here's what such a PATH program looks like:

10 print chr$(109+rnd(1)*2); : goto 10

$ \
/ /
\ + } } } } } + } } + } } + } + } + } + }   }   } + } +  \
/                                                        /
\ } +++++++++++++++++++++++++++++++++++++++++++++++ \
/                                                   /
\ } ++++++++++++++++++++++++++++++ \
  / ++++++++++++++++++++++++++++++ /
  \ ++++++++++++++++++++++++++++++++ \
/         {{{{{{{{{{{{{{{{{{         /
!
/                                                                                                                     \
                  /  - {  \          /  - {  \          /  - {  \          /  - {  \
\} } } } } } } v }^ { !/ !\ !/  { v }^ { !/ !\ !/  { v }^ { !/ !\ !/  { v }^ { !/ !\ !/   \
                       {                  {                  {                  {
               \ }     ^ + { /    \ }     ^ + { /    \ }     ^ + { /    \ }     ^ + { /   
           /                                                                              /
       
                  /  - {  \          /  - {  \          /  - {  \          /  - {  \
           \ { v }^ { !/ !\ !/  { v }^ { !/ !\ !/  { v }^ { !/ !\ !/  { v }^ { !/ !\ !/  v  !/  \
                       {                  {                  {                  {        \ - /
               \ }     ^ + { /    \ }     ^ + { /    \ }     ^ + { /    \ }     ^ + { /   


/   {{{{{{{{  v  }}}}}}}}                                                                       /
              \  {{{{{{{{                                                                                       \
   /+                         \             /+ {                        \
   \{{{{{{{{{ \                             \{{{{{{{{{ \
\ v }}}}}}}}} ^ !/ {{{{{{{{{ !\ !/       } v }}}}}}}}} ^ !/ {{{{{{{{{{ !\ !/   \ 
   /-                            /           /- {                          /
   \{{{{{{{{{ \                              \{{{{{{{{{ \
  \ }}}}}}}}} ^  /                         \  }}}}}}}}} ^ /
/                                                                              /
      /+ {{                         \               /+ {{{                        \
      \{{{{{{{{{ \                                  \{{{{{{{{{ \
\ }} v }}}}}}}}} ^  !/ {{{{{{{{{{{ !\ !/       }}} v }}}}}}}}} ^ !/ {{{{{{{{{{{{ !\ !/   \ 
       /- {{                           /             /- {{{                          /
       \{{{{{{{{{ \                                  \{{{{{{{{{ \
     \  }}}}}}}}} ^  /                             \  }}}}}}}}} ^ /
/                                                                                        /
        /+ {{{{                           \                 /+ {{{{{                        \
        \{{{{{{{{{ \                                        \{{{{{{{{{ \
\ }}}} v }}}}}}}}} ^    !/ {{{{{{{{{{{{{ !\ !/       }}}}} v }}}}}}}}} ^ !/ {{{{{{{{{{{{{{ !\ !/    \
         /- {{{{                             /               /- {{{{{                          /
         \{{{{{{{{{ \                                        \{{{{{{{{{ \
       \  }}}}}}}}} ^    /                                 \  }}}}}}}}} ^ /
/                                                                                                   /
          /+ {{{{{{                           \                   /+ {{{{{{{                        \
          \{{{{{{{{{ \                                            \{{{{{{{{{ \                                  !
\ }}}}}} v }}}}}}}}} ^    !/ {{{{{{{{{{{{{{{ !\ !/       }}}}}}} v }}}}}}}}} ^ !/ {{{{{{{{{{{{{{{{ !\ !/        \
           /- {{{{{{                             /                 /- {{{{{{{                          /
           \{{{{{{{{{ \                                            \{{{{{{{{{ \
         \  }}}}}}}}} ^    /                                     \  }}}}}}}}} ^ /
/                                                                                                               /
\ }}}}}}}} v }}}}}}}}}  .  !/ {{{{{{{{{{{{{{{{{                                                                       /
           \ }}}}}}}}}} . { /

And here's some of the output it produces when run:

\/////\////\//\\\\\/\/\\\\/\///\/\//\/\\\///\///\//\//\/\///\\//\/\\/\/\/\/\\/\\
///\/\\\\\//\\///////\\/\\\/\//\///\\\\\\/////\\\/\/\//\\/\/\\////\\///\\/\////\
\\\///\\\//\\\\/\\\//\//\\//\\/\\/\\\\//\/\/\\\/\\\\\\\\/\\/\//\\\////\/\/\/////
/\/\\//\\\/\\//\/////\////\//\\\\\/\/\\\\/\///\/\//\/\\\///\///\//\//\/\///\\//\
/\\/\/\/\/\\/\\///\/\\\\\//\\///////\\/\\\/\//\///\\\\\\/////\\\/\/\//\\/\/\\///
/\\///\\/\////\\\\///\\\//\\\\/\\\//\//\\//\\/\\/\\\\//\/\/\\\/\\\\\\\\/\\/\//\\
\////\/\/\//////\/\\//\\\/\\//\/////\////\//\\\\\/\/\\\\/\///\/\//\/\\\///\///\/
/\//\/\///\\//\/\\/\/\/\/\\/\\///\/\\\\\//\\///////\\/\\\/\//\///\\\\\\/////\\\/
\/\//\\/\/\\////\\///\\/\////\\\\///\\\//\\\\/\\\//\//\\//\\/\\/\\\\//\/\/\\\/\\
\\\\\\/\\/\//\\\////\/\/\//////\/\\//\\\/\\//\/////\////\//\\\\\/\/\\\\/\///\/\/
/\/\\\///\///\//\//\/\///\\//\/\\/\/\/\/\\/\\///\/\\\\\//\\///////\\/\\\/\//\///
\\\\\\/////\\\/\/\//\\/\/\\////\\///\\/\////\\\\///\\\//\\\\/\\\//\//\\//\\/\\/\
\\\//\/\/\\\/\\\\\\\\/\\/\//\\\////\/\/\//////\/\\//\\\/\\//\/////\////\//\\\\\/
\/\\\\/\///\/\//\/\\\///\///\//\//\/\///\\//\/\\/\/\/\/\\/\\///\/\\\\\//\\//////
/\\/\\\/\//\///\\\\\\/////\\\/\/\//\\/\/\\////\\///\\/\////\\\\///\\\//\\\\/\\\/
/\//\\//\\/\\/\\\\//\/\/\\\/\\\\\\\\/\\/\//\\\////\/\/\//////\/\\//\\\/\\//\////
/\////\//\\\\\/\/\\\\/\///\/\//\/\\\///\///\//\//\/\///\\//\/\\/\/\/\/\\/\\///\/
\\\\\//\\///////\\/\\\/\//\///\\\\\\/////\\\/\/\//\\/\/\\////\\///\\/\////\\\\//
/\\\//\\\\/\\\//\//\\//\\/\\/\\\\//\/\/\\\/\\\\\\\\/\\/\//\\\////\/\/\//////\/\\
//\\\/\\//\/////\////\//\\\\\/\/\\\\/\///\/\//\/\\\///\///\//\//\/\///\\//\/\\/\
/\/\/\\/\\///\/\\\\\//\\///////\\/\\\/\//\///\\\\\\/////\\\/\/\//\\/\/\\////\\//

Amusingly, the output of 10 PRINT is itself a PATH program -- one that moves the program counter around and does no other work.


Processing

10 PRINT produces an appealing visual effect. As such, it deserves the name "visual art." While computer artists have used code to make visual compositions for decades, since the turn of the millennium interest in computer-generated visual art has expanded rapidly within the digital art community. Some use widely-available commercial tools like Flash for this purpose, while others have built bespoke programming environments designed specifically for visual artists.

John Maeda's _Design by Numbers_ (2001) offers one example, but a far more popular and influential tool is Ben Fry and Casey Reas's Processing, which was inspired by Maeda's work and started within his research group at the MIT Media Lab. Processing is really just Java, with a specialized toolkit, program framework, and authoring environment laid atop. Among its goals, Processing seeks to introduce non-programmers to the practice of programming, but it also offers a set of very simple tools (such as mechanisms for drawing and coloring lines and shapes) for the creation of generative visual art.

That lineage in mind, implementing a version of 10 PRINT in Processing allows us to focus on its visual design in a way that might not be easy or even possible to do in a C64 program. In the Processing version of 10 PRINT depicted here, the program is created by drawing a left or right-facing diagonal line within a grid of enclosing squares.

[Need to add image of Casey's Processing implementation]http://mailman.mit.edu/mailman/private/10-print/attachments/20100505/92aa360e/Picture-1-0001.gif, http://reas.com/rnd/

Already that's a different way to think about the visual output of the program, since the C64 version simply outputs characters to the screen buffer, which wraps them in order to create the appearance of a maze. But Processing programs also tend to rely on code rather than assets to create their effects. That is, Processing is particularly adept at visual renderings produced entirely from geometric primitives fashioned in source code rather than from loading and manipulating image files (although it is certainly capable of the latter). When using such a technique, it is easy to make small variations on the appearance of individual elements in the output by changing the values of particular variables in the program.

The adaptation of 10 PRINT shown here offers several knobs that can be used to alter the appearance of the individual cells, among them thickness, randomness, and shape. Changing the shape used for individual cells from slashes to circles or lines results in the same sort of systemic visual changes seem in the Commodore 64 variations discussed above. However, changing the thickness or randomness of the pattern results in a totally different appearance, as shown below.

[Image of some variations]http://mailman.mit.edu/mailman/private/10-print/attachments/20100505/92aa360e/Picture-2-0001.gif, http://mailman.mit.edu/mailman/private/10-print/attachments/20100505/92aa360e/Picture-3-0001.gif

Generative art is characterized by the use of algorithms or self-automated processes to create some artistic result. From an author's perspective, the practice of creating generative art is less a matter of designing a fixed, singular outcome than in designing a machine capable of producing a variety of different outcomes. 10 PRINT is itself generative--it uses a set of instructions to create a visual effect. But as the C64 variants suggest, the manner of parametric variation possible on that platform, within a single line of BASIC code, are limited. The Processing variant of the program is not only many more lines of code, but also far more granular in its settings. When discussing generative aesthetics, it's common to think that more parametric variation is "better"--or at least more generative--than less variation.

That value in mind, the Processing program's results suggest a question: were one to create or discover 10 PRINT as a Processing program instead of a Commodore 64 one-liner, would the particular configuration of settings that correspond with the latter seem most natural or appealing? It's impossible to answer definitively, but the question does underscore how the constraints of the original program's authorship--a single line of code, the particularities of the PETSCII table, and so forth--contribute to the result partly by reducing its possible variations, rather than by increasing them.

Bibliography (not sure which of these are still in scope here)

Commodore 64 User's Guide. Wayne PA; Indianapolis, IN: Commodore Business Machines; Distributed by Howard W. Sams & Co., 1982. <http://www.commodore.ca/manuals/c64_users_guide/c64-users_guide.htm>.

Jerz, Dennis. "Somewhere Nearby is Colossal Cave: Examining Will Crowther's Original 'Adventure' in Code and in Kentucky." DHQ: Digital Humanities Quarterly 1.2 (2007). <http://digitalhumanities.org/dhq/vol/001/2/000009/000009.html>.

Krueger, Dan A., and Louis F. Sander. "Magic $93." Run Jul 1984. 13-14. <http://www.old-computer-mags.com/magazine/magazine_viewer_eng.php?idx=Run.htm&base=Run&num=007&page=13>.

Langway, Lynn. "Invasion of the Video Creatures." Newsweek 16 Nov 1981: 90+.

Latham, Aaron. "Video Games Star War." The New York Times 25 Oct 1981: 100+.

Mateas, Michael and Nick Montfort. "A Box, Darkly: Obfuscation, Weird Languages, and Code Aesthetics." In Digital Arts and Culture: Digital Experience: Design, Aesthetics, Practice (DAC 2005), Copenhagen, Denmark, 2005.

Map of Twisty Little Passages All Alike Maze. TEXTFILES. <http://www.textfiles.com/adventure/mazmap.adv>.

Zork 1 - Maze Map. TEXTFILES. <http://www.textfiles.com/adventure/maze.zk1>.

Personal tools