Remarks: Processing Mazes

From Maze

(Difference between revisions)
Jump to: navigation, search
(Started second program paragraph.)
(Text about console Processing version.)
Line 3:Line 3:
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 with a mood distinct 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 the new high-resolution version, the entire maze is refreshed in unison. Without thinking about it, we used the default Processing colors to create white lines and a black background. In hindsight, this imbued the program with a mood distinct from the original lower-contrast blues of the C64. The result is shown in figures ?? to ??.
[NOTE 9 July. Add the second Processing port, which includes making the maze move up the screen, changing the symbol to black and white boxes to show how the effect is lost, change the weight of the random number. Note which can be rewritten for the C64 and which are unique to Processing.]
[NOTE 9 July. Add the second Processing port, which includes making the maze move up the screen, changing the symbol to black and white boxes to show how the effect is lost, change the weight of the random number. Note which can be rewritten for the C64 and which are unique to Processing.]
−
After writing this first program that focuses entirely on the image of the maze, it because clear that watching the maze build one unit at a time on the C64 is a major component of the program. This behavior doesn't naturally work with Processing because it's for creating graphics rather than text. The way to make 10 PRINT work as it does on the C64 is to write the program to the console of the Processing Development Environment. This is more like the native C64 basic interpreter. The code for this Processing version follows:
+
After writing this first program that focuses entirely on the image of the maze, it because clear that watching the maze build one unit at a time on the C64 is a major component of the program. This behavior doesn't naturally work with Processing because the entire screen updates as a whole, rather than character by character. [MORE]
−
 
−
 
−
 
[MORE] This a akin to using one's native language to write; thoughts flow directly and smoothly.
[MORE] This a akin to using one's native language to write; thoughts flow directly and smoothly.
 +
 +
There is a way within Processing to make the 10 PRINT work more similarly to the C64. This method uses the text Console of the Processing Development Environment (PDE) instead of the pixels in the display window. The Console in the PDE is typically used for error messages and writing debug statements through the print() and println() functions which are similar to CHR$() in BASIC. This technique may seem more like the C64, but the console can only print text; programs can't be written there. The other primary difference is the lack of the graphic characters of PETSCII (see p. ??) in the native console font for the PDE. As a result the / and \ characters need to be used in place of diagonal graphics. The result it spaces between the lines, which ruins the illusion of a continuous maze as seen in figure ??).
 +
 +
[ADD FIGURES]
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.
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.

Revision as of 18:17, 9 July 2011

View this revision of Remarks: Processing Mazes.

Personal tools