Regularity
From Maze
(Difference between revisions)
(→The Grid: Regularity in Space) | (Add "Temporal Repetition in the Arts" to Repeating: Regularity in Time and Process to hold the arts discussion) | ||
| Line 47: | Line 47: | ||
= Repeating: Regularity in Time and Process = | = Repeating: Regularity in Time and Process = | ||
| − | === The Flow of Control === | + | == Temporal Repetition in the Arts == |
| + | |||
| + | [This section will cover time-based processes across music, video, and performance (including dance). See the discussion page for the outlines and ideas.] | ||
| + | |||
| + | |||
| + | == The Flow of Control == | ||
In any imperative programming language, commands are processed in a particular order that relates to the left-to-right, then top-to-bottom path that the Western reader's eyes stereotypically take along a page. If one types in two PRINT commands directly to the Commodore 64's BASIC interpreter, with a colon between them, like so: | In any imperative programming language, commands are processed in a particular order that relates to the left-to-right, then top-to-bottom path that the Western reader's eyes stereotypically take along a page. If one types in two PRINT commands directly to the Commodore 64's BASIC interpreter, with a colon between them, like so: | ||
| Line 69: | Line 74: | ||
At the low level of machine code and its execution by the processor, the way program flow works is similar. Machine language is a sequence of numbers, and the next number is usually processed. However, an executing machine language program, like a high-level program in BASIC or another imperative language, can either continue to process the next instruction or can move out of sequence to process a different instruction. The standard case is when a processor continues to the next machine language instruction, just as the reader of a text moves to the next word or line. This involves incrementing the program counter so that it points to the place where the next instruction is located in memory. If the current instruction is one that can change the flow of control, however, the program may jump to a new memory location and a new piece of code. | At the low level of machine code and its execution by the processor, the way program flow works is similar. Machine language is a sequence of numbers, and the next number is usually processed. However, an executing machine language program, like a high-level program in BASIC or another imperative language, can either continue to process the next instruction or can move out of sequence to process a different instruction. The standard case is when a processor continues to the next machine language instruction, just as the reader of a text moves to the next word or line. This involves incrementing the program counter so that it points to the place where the next instruction is located in memory. If the current instruction is one that can change the flow of control, however, the program may jump to a new memory location and a new piece of code. | ||
| − | === Conditional and Unconditional Branching === | + | == Conditional and Unconditional Branching == |
There are two essential ways that the flow of control can change and a program can "branch," or continue at a new point. An unconditional branch always directs the program to jump to a new location, like the instruction "Go directly to Jail -- do not pass Go" in Monopoly. The assembly mnemonic for an unconditional branch is JMP; the corresponding BASIC keyword is GOTO. | There are two essential ways that the flow of control can change and a program can "branch," or continue at a new point. An unconditional branch always directs the program to jump to a new location, like the instruction "Go directly to Jail -- do not pass Go" in Monopoly. The assembly mnemonic for an unconditional branch is JMP; the corresponding BASIC keyword is GOTO. | ||
| Line 96: | Line 101: | ||
Although there is no IF ... THEN statement in 10 PRINT, and the program does not by any interpretation contain a conditional branch, this short program does accomplish a very small-scale sort of variation. By computing 205.5+RND(1) and passing that value to the function CHR$, the program prints either PETSCII character 205 or PETSCII character 206. This variation between two characters is a one-bit variation, a selection from the smallest possible set of options. Yet, in combination with the regularity of a repeating processes and the regularity of the Commodore 64's screen grid, these selections take shape as something evocative and visually interesting. | Although there is no IF ... THEN statement in 10 PRINT, and the program does not by any interpretation contain a conditional branch, this short program does accomplish a very small-scale sort of variation. By computing 205.5+RND(1) and passing that value to the function CHR$, the program prints either PETSCII character 205 or PETSCII character 206. This variation between two characters is a one-bit variation, a selection from the smallest possible set of options. Yet, in combination with the regularity of a repeating processes and the regularity of the Commodore 64's screen grid, these selections take shape as something evocative and visually interesting. | ||
| − | === Bounded and Unbounded Loops === | + | == Bounded and Unbounded Loops == |
10 PRINT works as it does because of its repetition of the PRINT statement, repetition that is unconditional: It will continue until something outside the program interrupts it, such as the user pressing the key labeled RUN STOP or unplugging the computer. | 10 PRINT works as it does because of its repetition of the PRINT statement, repetition that is unconditional: It will continue until something outside the program interrupts it, such as the user pressing the key labeled RUN STOP or unplugging the computer. | ||
| Line 123: | Line 128: | ||
</nowiki> | </nowiki> | ||
| − | === FOR ... TO ... STEP (Sidebar) === | + | == FOR ... TO ... STEP (Sidebar) == |
The FOR loop in BASIC is a bit more general than is shown in the example in the main text. It can be used not only to increment a variable, but also to change its value each time by any amount. A different increment is set using the STEP keyword. To show only the even numbers between 2 and 10: | The FOR loop in BASIC is a bit more general than is shown in the example in the main text. It can be used not only to increment a variable, but also to change its value each time by any amount. A different increment is set using the STEP keyword. To show only the even numbers between 2 and 10: | ||
| Line 144: | Line 149: | ||
</nowiki> | </nowiki> | ||
| − | === Is 10 PRINT Iterating? === | + | == Is 10 PRINT Iterating? == |
From the discussion so far, it should be clear that 10 PRINT has an unbounded loop thanks to the unconditional branch at the end. There is nothing in the code, however, to indicate that 10 PRINT is an example of iteration. There are no variables like A that change value from one pass to the next -- there are no variables at all, in fact -- and the code inside the loop, and the way that code works, never changes. In the most strightforward sense, the BASIC program <code>10 PRINT CHR$(205.5+RND(1)); : GOTO 10</code> does not iterate. | From the discussion so far, it should be clear that 10 PRINT has an unbounded loop thanks to the unconditional branch at the end. There is nothing in the code, however, to indicate that 10 PRINT is an example of iteration. There are no variables like A that change value from one pass to the next -- there are no variables at all, in fact -- and the code inside the loop, and the way that code works, never changes. In the most strightforward sense, the BASIC program <code>10 PRINT CHR$(205.5+RND(1)); : GOTO 10</code> does not iterate. | ||
