Chapter 14

Symmetrical Graphics Patterns

In this chapter we continue to explore the generation of graphics patterns in memory. As in the last chapter, you will use ones and zeros in an array to generate pin patterns, but this time you will save memory by using a one-dimensional array to print a two-dimensional figure. You will construct one long program in which an array containing less than 300 elements will produce a pattern made up of many thousands of dots. Because of the length of the program we will only occasionally ask you to run it.

Begin by defining variables:

NEW

10 DIM A(480): X=1: C=0

20 MAX=5: MIN=1: RE=4: N=0

For easy reference, Table 14-1lists, in alphabetical order, the variables you will use for this program. The array A, which is DIMensioned in line 10, will store the pattern. Program loops will use the variables in line 20 to control the size and shape of the figure. You can change these values later to create your own variations on the pattern.

Here are the loops:

30 FOR J=1 TO RE

40N=N+1

50GOSUB 300

60IF N<MAX THEN 40

70N=N-1

80GOSUB 300

189