Remarks: Processing Mazes
From Maze
(Difference between revisions)
(Addition of code) | (Defining second Processing program) | ||
| Line 1: | Line 1: | ||
| − | [Comments/context moved to the Discussion] | + | [Comments/context moved to the Discussion, except this: I'm having trouble keep straight past and present tense in this today] |
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; lines don't need explicit x- and y-coordinates because characters 205 and 206 define them. When 10 PRINT is ported to other platform, as demonstrated in section ??, these features of the C64 need to be defined within the new platform. The primary constrains of 10 PRINT are C64 default blue on blue color palette and the 40 x 25 character screen. | 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; lines don't need explicit x- and y-coordinates because characters 205 and 206 define them. When 10 PRINT is ported to other platform, as demonstrated in section ??, these features of the C64 need to be defined within the new platform. The primary constrains of 10 PRINT are C64 default blue on blue color palette and the 40 x 25 character screen. | ||
| Line 9: | Line 9: | ||
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 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 second Processing version of 10 PRINT took more liberties with the original program. Most importantly, the number of rows and columns in the grid could | + | 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 refine the graphics, the code because longer as more definition is required... | + | With the ability to further define the graphics, the code became longer with the enhanced precision: |
| + | size(1020, 680); | ||
| + | noStroke(); | ||
| + | background(0, 0, 255); | ||
int rows = int(pow(2, int(random(1, 6)))); // 2, 4, 8, 16, 32 | int rows = int(pow(2, int(random(1, 6)))); // 2, 4, 8, 16, 32 | ||
int thickness = int(pow(2, int(random(1, 4)))); // 2, 4, 8 | int thickness = int(pow(2, int(random(1, 4)))); // 2, 4, 8 | ||
