Remarks: Maze Walker

From Maze

(Difference between revisions)
Jump to: navigation, search
Line 68:Line 68:
This finally results in the generation of a pristine rectangular maze sitting on a screen by itself [reference figure depicting clean maze]. The next step is to fill the entire screen with a stabilized maze pattern.
This finally results in the generation of a pristine rectangular maze sitting on a screen by itself [reference figure depicting clean maze]. The next step is to fill the entire screen with a stabilized maze pattern.
−
Before moving onto this step, however, let us reflect on the additional complexity that has been introduced in our efforts to stabilize the maze. Our original one line program has grown to five lines, though the original kernel of the program, which randomly prints a forward slash or a backslash, still appears on line 10. [We should have consistent terminology for referring to the two graphical characters in the 10-print program. Forward and backslash aren't quite right, since this is ambiguous with the ASCII forward and backslashes.] The additional complexity comes from the need to produce a finite number of forward and back slashes, and from the formatting requirements of placing the maze on a blank screen. To produce a finite number of symbols, the FOR and NEXT statements, with their corresponding count variable X, are introduced. To place the maze on a clear screen, the CLR control character is printed and an infinite loop that prevents the return to the BASIC interpreter is introduced. [In my experience this is representative of a general principle of programming - that I/O, formatting and interface, the "surface" of the program, requires more programming complexity than the logical kernel (the functional computation performed by the program - simulation, calculation, etc.), or "depth", of the program. Does anybody know of any references to this phenomenon?).
+
Before moving onto this step, however, let us reflect on the additional complexity that has been introduced in our efforts to stabilize the maze. Our original one line program has grown to five lines, though the original kernel of the program, which randomly prints a forward or backward slanting character, still appears on line 10. The additional complexity comes from the need to produce a finite number of forward and back slashes, and from the formatting requirements of placing the maze on a blank screen. To produce a finite number of symbols, the FOR and NEXT statements, with their corresponding count variable X, are introduced. To place the maze on a clear screen, the CLR control character is printed and an infinite loop that prevents the return to the BASIC prompt is introduced. This is a common experience in programming, that the input and output behavior of the program, the formatting and interface, the "surface" of the program, requires more programming complexity than the simulation or calculation that defines the kernel or "depth" of the program.

Revision as of 18:37, 29 July 2011

View this revision of Remarks: Maze Walker.

Personal tools