Remarks: Processing Mazes
From Maze
(Difference between revisions)
(Clarified intro and fixed tense problems.) | |||
| Line 1: | Line 1: | ||
| − | [Notes from Mark S. to add: color, speed, line weight] | + | [Notes from Mark S. to add: color, speed, line weight] [MORE: Add text about the use of \ and / characters and how they make it work.] |
The algorithm that defines the 10 PRINT maze exists independently from the Commodore 64 (C64) platform. In fact, the algorithm can be simply executed with a sheet of graph paper, a pen, and a coin to toss. The act of running the algorithm on a number of different platforms reveals what is essential to the algorithm from the specific constraints and affordances of the C64. The concision of 10 PRINT originates from its clever exploitation of the C64, as explained in section ??. For example, the code need not instruct the lines to wrap to the next line when they reach the edge of the screen because it's built into the system. The lines don't need explicit x- and y-coordinates because each character is drawn precisely next to the previous character to form the grid. More subtle defaults of the C64 include the color (light blue on blue) and the speed at which each new section of the maze is added. When 10 PRINT is ported to other platform, as demonstrated in section ??, these features of the C64 must to be defined consciously within the new platform. The precise color, resolution, and speed of the maze are open to new ideas. While many elements of the C64 program can be modified, some are constraints of the system. Primarily, the 40 x 25 character screen that defines the resolution of the grid is fundamental to the hardware architecture and defines the number of units that can comprise the maze. | The algorithm that defines the 10 PRINT maze exists independently from the Commodore 64 (C64) platform. In fact, the algorithm can be simply executed with a sheet of graph paper, a pen, and a coin to toss. The act of running the algorithm on a number of different platforms reveals what is essential to the algorithm from the specific constraints and affordances of the C64. The concision of 10 PRINT originates from its clever exploitation of the C64, as explained in section ??. For example, the code need not instruct the lines to wrap to the next line when they reach the edge of the screen because it's built into the system. The lines don't need explicit x- and y-coordinates because each character is drawn precisely next to the previous character to form the grid. More subtle defaults of the C64 include the color (light blue on blue) and the speed at which each new section of the maze is added. When 10 PRINT is ported to other platform, as demonstrated in section ??, these features of the C64 must to be defined consciously within the new platform. The precise color, resolution, and speed of the maze are open to new ideas. While many elements of the C64 program can be modified, some are constraints of the system. Primarily, the 40 x 25 character screen that defines the resolution of the grid is fundamental to the hardware architecture and defines the number of units that can comprise the maze. | ||
| Line 5: | Line 5: | ||
When the C64 was launched in 1982, it was a powerful home computer for creating computers graphics. Contemporary hardware is an interesting place to re-imagine the 10 PRINT algorithm because it has changed substantially from its predecessors. For this exploration into re-imaging 10 PRINT, we used Processing, a programming system first designed in 2001. It's built on top of Java, one of the dominant modern programming languages, but Processing is specialized for making graphics and simplifies some of the native Java syntax. Java was first introduced in 1995 and is most similar to C++, which originated in 1983. C++ is an object-oriented programming language built on top of C, a procedural language that originated in the early 1970s. | When the C64 was launched in 1982, it was a powerful home computer for creating computers graphics. Contemporary hardware is an interesting place to re-imagine the 10 PRINT algorithm because it has changed substantially from its predecessors. For this exploration into re-imaging 10 PRINT, we used Processing, a programming system first designed in 2001. It's built on top of Java, one of the dominant modern programming languages, but Processing is specialized for making graphics and simplifies some of the native Java syntax. Java was first introduced in 1995 and is most similar to C++, which originated in 1983. C++ is an object-oriented programming language built on top of C, a procedural language that originated in the early 1970s. | ||
| − | The first Processing version of 10 PRINT was written to take advantage of the increased resolution of contemporary screens. It does this by making the thickness and ends of the lines into variables that can be changed while the program runs. The lines of the maze can range from 0.5 to 10 pixels wide and the lines can terminate with a rounded or square end. Like 10 PRINT, it maintains the grid of lines at 40 x 25 units, but unlike 10 PRINT it doesn't add each grid unit in sequence from left to right and top to bottom. In this new high-resolution version, the entire grid is refreshed in unison. Without thinking about it, we set used the default Processing colors to create white lines and a black background. In hindsight, this imbued the program a distinctly different feel from the original lower-contrast blues of the C64. The result is shown in figures ?? to ??. | + | The first Processing version of 10 PRINT was written to take advantage of the increased resolution of contemporary screens. It does this by making the thickness and ends of the lines into variables that can be changed while the program runs. The lines of the maze can range from 0.5 to 10 pixels wide and the lines can terminate with a rounded or square end. Like 10 PRINT, it maintains the grid of lines at 40 x 25 units, but unlike 10 PRINT it doesn't add each grid unit in sequence from left to right and top to bottom. In this new high-resolution version, the entire grid is refreshed in unison. Without thinking about it, we set used the default Processing colors to create white lines and a black background. In hindsight, this imbued the program with a distinct feel from the original lower-contrast blues of the C64. The result is shown in figures ?? to ??. |
| − | The line endings are a subtle, but crucial change within this program. In the original 10 PRINT image (see fig ??), notice how each line terminates into a point. This is required because each of the 40 x 25 tiles that comprise the image are constrained to its 8 x 8 pixels area. This is is created by tiling these lines, fixed into their 64 pixels boxes. In the Processing program, each line is free to extend beyond and into the other lines area. This is because the lines are defined by x- and y-coordinates (precise locations on screen) rather than tile positions. Any number of shapes and colors can appear at any given pixel on screen. | + | The line endings are a subtle, but crucial change within this program. In the original 10 PRINT image (see fig ??), notice how each line terminates into a point. This is required because each of the 40 x 25 tiles that comprise the maze are constrained to an 8 x 8 pixel area. This maze is created by tiling the lines, each constrained within a a 64 pixel square. In the Processing program, each line is free to extend beyond the boundaries that define a line. The screen in Processing is a continuous surface of pixels, each of which can be addressed precisely with an x- and y-coordinate rather than a tile position. The 10 PRINT program is comprised of 320 x 200 pixels, but the actual controllable resolution is 40 x 25, for a total of 1000 elements. A Processing version of the program can utilize all of the pixels on a contemporary screen which makes it possible to access millions of pixels. For example, a standard 1080p screen, provides 2,073,600 pixels to control. |
| − | [MORE: Add text about the use of \ and / characters and how they make it work.] | + | With this enhanced resolution in mind, we wrote a third version of 10 PRINT in Processing that took more liberties with the original program. The number of rows and columns in the grid were variable, the direction of the line defined its color (black or white), each line was defined as a quadrilateral to give more flexibility of the shape, and a third color was used for the background. Each time the code is run, the size of the grid unit is defined at random as a power of 2 (2, 4, 8, 16, or 32) and the thickness of the lines are set randomly to 2, 4, or 8. Figures ?? to ?? show some of the varied results. With the ability to further define the graphics, the code became longer than the C64 one-liner: |
| − | |||
| − | The second Processing version of 10 PRINT took more liberties with 10 PRINT. Most importantly, the number of rows and columns in the grid were variable, the direction of the line defined its color (black or white), each line was defined as a quadrilateral to give more flexibility of the shape, and a third color was used for the background. Each time the code is run, the size of the grid unit is defined at random as a power of 2 (2, 4, 8, 16, or 32) and the thickness of each line is set by a random number. Figures ?? to ?? show some of the varied results. With the ability to further define the graphics, the code became longer than the C64 one-liner 10 PRINT with the enhanced precision and variability: | ||
size(1020, 680); | size(1020, 680); | ||
| Line 34: | Line 32: | ||
} | } | ||
| − | The decision to display one direction of lines as white and the other as black triggers our evolved perception to create depth within this two-dimensional image. Our eyes inform us that there is a light source that is reflecting off one directional edge and creating a shadow on the other. The angle at which the lines terminate in this program enhance the affect by occlusion and terminating at the edge. This creates an isometric perspective which further enhances the perceived dimensionality in the image. These effects work better in some configurations and are subverted by others. | + | The decision to display one direction of lines as white and the other as black triggers our evolved perception to create depth within this two-dimensional image. Our eyes inform us that there is a light source that is reflecting off one directional edge and creating a shadow on the other. The angle at which the lines terminate in this program enhance the affect by occlusion and terminating at the edge. This creates an isometric perspective which further enhances the perceived dimensionality in the image. These effects work well in some of the randomly determined configurations and are subverted by others. |
[[File:P5-10PRINT-03.png|400px|thumb|center|]] | [[File:P5-10PRINT-03.png|400px|thumb|center|]] | ||
