Unit installation
After figuring these numbers for each column in every print line,
you put them into DATA statements in the arrow graphics program.
First, here’s the whole program and its printout. Following the
printout is an explanation of a method used to reduce the number of
DATA numbers that have to be typed.
NEW
100 OPEN4,4
110 FOR K=1 TO
3
120 PRINT#4,CHR$(8);
130
READ N: IF N=0 THEN 200
140 IF N<0 THEN 170
150 IF N>127 THEN PRINT#4,CHR$(N);:
160 GOT0 130
170 READ P: FOR J=1 TO -N
180 PRINT#4,CHR$(P);: NEXT J
199 GOT0 130
200 PRINT#4: NEXT K
210 CLOSE4
220 DATA 130,134,138,146,226,-3,130
230 DATA 132,136,144,-9,160,191,130,132
240 DATA 136,144,160,192,-4,128,0
250 DATA -4,128,255,-22,128,193,162,148
260 DATA 136,0,160,176,168,164,163,-3
270 DATA 160,144,136,132,-9,130,254,160
280 DATA 144,136,132,130,129,-4,128,0
In this program the number 0 in the DATA statements signals the
end of a print line. This is the reason for the IF-THEN statement in line
130.
When a 0 is read, the program skips to line
200
and ends the print
line.
Because several of the numbers are repeated many times, lines
140
and
170-190
are included to save typing. These lines use negative
DATA numbers for repetitions. Line
140
tests for a negative number,
and if it finds one, uses lines
170
and
180
to repeat the next DATA
number. For example, in line
230,
the minus
9
causes the next number
(160)
to be repeated
9
times.
Even with this shortcut, programming graphics printing in BASIC
does require lots of data.
33