Talk:Regularity

From Maze

(Difference between revisions)
Jump to: navigation, search
(Moved Iteration text and notes here; some of this will be incorporated back into draft text in the Regularity chapter)
(Removed text that has been incorporated into Repetition)
Line 21:Line 21:
- Early computer core memory in a grid: http://en.wikipedia.org/wiki/File:Ferrite_core_memory.jpg
- Early computer core memory in a grid: http://en.wikipedia.org/wiki/File:Ferrite_core_memory.jpg
−
= Earlier text and notes on iteration =
+
= Text Remaining from "Iteration" =
''Perhaps the single most important programming idea is that of a loop.''
''Perhaps the single most important programming idea is that of a loop.''
- ''BASIC: A Manual for BASIC, the elementary algebraic language designed for use with the Dartmouth Time Sharing System,'' 1 October 1964
- ''BASIC: A Manual for BASIC, the elementary algebraic language designed for use with the Dartmouth Time Sharing System,'' 1 October 1964
−
 
−
=== GOTO and the Unbounded Loop ===
 
−
 
−
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.
 
−
 
−
At a high level, programs can contain two types of loops: bounded (also called "finite") and unbounded (or "infinite"). 10 PRINT has the latter kind, an infinite loop. If one is writing a program that is intended to exit and to produce some result, an unbounded loop represents a mistake on the programmer's part. The unbounded loop does have legitimate uses, however. It can be used to keep an application, usually an interactive one, running and accepting input until the system is shut off or rebooted. This can be done even on a single-threaded system such as the Commodore 64.
 
−
 
−
Bounded loops are those that end under certain conditions. The exact conditions vary; some will continue until the program reaches a pre-defined exit state while others execute a specific number of times no matter what the result. No matter what the exit conditions are for a specific loop, the fact that there are exit conditions at all implies the programmer is expecting some kind of change in the program to be introduced as the program executes.
 
−
 
−
A common use of finite loops is to create an iterative process. Iteration is a special type of loop where the result of one pass through the loop influences the result of succeeding passes. The simplest example of an iterative process is nothing more than counting. Beginning with an initial value, 1, and adding 1 to it to produces 2. Taking the output from that operation, 2, and performing the same operation again, adding 1, results in 3, and so on until the sequence 1, 2, 3… emerges. Counting to 10, 100, or for one hour no matter what number you end up at are all finite iterative processes; counting until you pass out is an infinite iterative process, even if you never quite make it to infinity.
 
−
 
−
=== Is the Program Iterating? ===
 
−
 
−
Based on this description of iteration, it may not be entirely clear that 10 PRINT is an example of iteration. There are no variables in the code that change value from one pass to the next–there are no variables at all–and the functionality of the code inside the loop never changes. Watching the program execute on screen shows hints that there is something changing beneath the surface, though: the position of the cursor changes every time the loop executes, moving one position to the right.
 
−
 
−
The position of the cursor is not being managed by 10 PRINT itself; it is a function of the Commodore 64's kernal, a layer of software that lies between BASIC and the machine code executed by the processor to handle input/output functions. Since 10 PRINT's BASIC code is not controlling the iterative aspect of its function it would be accurate to say that 10 PRINT is operationally iterative, but the BASIC code is not. This should not preclude examination of 10 PRINT's iterative nature, however; many iterative processes are dependent upon external or implicit factors influencing their output, and 10 PRINT's simplicity exposes the power of using simple iterative steps to create a complex construction.
 
−
 
−
(tk not sure if it would be confusing here to describe RND as an iterative process since it is deterministic...RND(1) is little different than iterating through a stored list of numbers...)
 
−
 
−
=== FOR ... TO ... STEP ===
 
−
 
−
(tk add variant that rewrites 10 PRINT to manually manage the cursor position by poking specific grid locations using BASIC's built-in iteration structure.)
 
−
 
−
== Iteration Permeates Computing ==
 
=== Transistors and processors ===
=== Transistors and processors ===
Line 69:Line 45:
Further away from the heart of the processor, another type of memory also uses iterative cycles to simulate a constant state. Dynamic Random Access Memory (DRAM) is a simpler but slower solution that uses far fewer transistors than the flip-flops in the processors. Instead, DRAM fills a capacitor with electrons to represent a high state. The capacitor quickly discharges though, returning it to a low state. Before it can discharge completely, control circuitry checks to see if it was full on the previous clock cycle and immediately refills the capacitor, effectively creating a loop that holds a state until the memory loses power.
Further away from the heart of the processor, another type of memory also uses iterative cycles to simulate a constant state. Dynamic Random Access Memory (DRAM) is a simpler but slower solution that uses far fewer transistors than the flip-flops in the processors. Instead, DRAM fills a capacitor with electrons to represent a high state. The capacitor quickly discharges though, returning it to a low state. Before it can discharge completely, control circuitry checks to see if it was full on the previous clock cycle and immediately refills the capacitor, effectively creating a loop that holds a state until the memory loses power.
−
===Example: Adding with an Accumulator===
 
−
(This section will be done with a diagram.)
 
−
 
−
==Iteration – code and structures==
 
==="Go To Statement Considered Harmful"===
==="Go To Statement Considered Harmful"===
Line 127:Line 99:
=== Fractals and Chaos ===
=== Fractals and Chaos ===
=== Life ===
=== Life ===
−
==Works Cited==
 
−
Anon. 1964. BASIC. Dartmouth College: Computation Center.
+
= Notes for Grid (Casey) =
−
 
−
 
−
Notes for Grid (Casey):
 
- As a visual work, 10 PRINT follows from Constructivism.
- As a visual work, 10 PRINT follows from Constructivism.

Revision as of 13:52, 19 July 2011

View this revision of Talk:Regularity.

Personal tools