Describing The 2-Dimensional; Pattern Sets - Epson FX-80 User Manual

Hide thumbs Also See for FX-80:
Table of Contents

Advertisement

All that is a one-line array; it just wraps around when printed. It
shows how the FOR-NEXT loops use variables to create patterns. The
overall pattern gets made up of five sets of pattern I, four sets of 2,
three sets of 3, ... as shown in Figure 16-3.
1 Repeat of 4
10101001100110001110001111000011111000011110001110001100110010101
11111'2
' 2 ' 2
' 2
'!{
\3' '3'
''1/
''4/
''5//
''4/ ''4/
'3
1
'3
1
'3' ¥
~
' 2
¥
11111_ L
=
1 to N
VV V
V
I V
W
"'W~
5
4
3
2
1
2
3
4
5 _
K
=
010 MAX·N
Figure 16·3. Pattern sets.
Before proceeding, modify line 110 so that it prints to the screen in-
stead of to the printer:
11~
FOR K=l TO C: PRINT A(K);:
NEXT K: PRINT: PRINT "C="C
Describing the 2-Dimensional Matrix (Pause)
The I-line array just created will be used to generate a 2-dimen-
sional pattern on the paper. This represents a significant saving of
memory compared to the method of generating an array that we used
in the last chapter.
To do this, we simulate (without actually creating) a 2-dimensional
array in a 3-step mental process:
1) Convert ones and zeros to dots and blank spaces.
2) Duplicate the array vertically.
3) Define a "times table" -where the intersection of a row and col-
umn is the "product" of the two values. The product of two dots of
the same color is a black dot; the product of two dots of different
colors is a white dot.
Figure 16-4 depicts this "times table."
186

Advertisement

Table of Contents
loading

Table of Contents