Program For A Circle; The Circle - Epson FX-80 User Manual

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

Advertisement

Understanding the subroutine is easy if you take
it
one step at a time.
This subroutine calculates the pin firing pattern (F) for each column of
seven dots. The array is examined vertically, one cell at a time. When
a one is encountered, the appropriate power of 2 is added to F in line
190. The exponent is the difference between the current row (R) and
the last row in this pass of the print head (P
+
6
*
5). Inline 220, F is
sent to the printer as a graphics pin pattern.
Check your listing against Figure 15-7 to make sure you have
it
all.
If everything checks out, type RUN.
1~
DEFINT A: N=21: DIM A(N,N)
2~
FOR R=l TO N: FOR C=l TO N
3~
D=SQR( (R-ll)A2 + (C-11)A2 )
4~
IF
INT(D+.5)=1~
THEN A(R,C)=l
5~
NEXT C
6~
PRINT "ROW "jR: NEXT R
7~
LPRINT CHR$(27)"1"jCHR$(7);
1~~
B=l: E=N-6: S=l
11~
FOR P=B TO ESTEP 7*S
12~
PRINT "LOADING ROWS "jPj" TO "jP+6*S
13~
LPRINT
CHR$(27)*"CHR$(5)CHR$(N)CHR$(~);
15~
FOR C=l TO N: GOSUB
18~:
NEXT C
16~
LPRINT: NEXT P
17~
LPRINT CHR$(27)1!@1!: STOP
18~ F=~:
FOR R=P TO P+6*S STEP S
19~
IF A(R,C)=l THEN F=F+2 A ABS(P+6*S-R)
2~~
NEXT R
22~
LPRINT CHR$(F)j: RETURN
Figure 15·7. Program for a circle.
Figure 15·8. The circle.
Ahal 50 the array looks like Figure 15-8 when it's translated into dots.
At least it does if you didn't run into any trouble codes.
174

Advertisement

Table of Contents
loading

Table of Contents