A SERVICE OF

logo

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 mem-
ory by using a one-dimensional array to print a two-dimensional
figure. You will construct one long program in which an array con-
taining 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-1
lists, 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
40 N=N+1
50
GOSUB 300
60
IF N<MAX THEN 40
70
N=N-1
80
GOSUB 300
189