The next line loads the beginning (B), ending (E), and step (S) values for the loop that will read and print the array.

100 B=1: E=N-6: S=1

We have you use variables here so that you can change them later. That way you can make your program read the array in a number of directions.

Using 7 pins of the print head on each pass, the program will take 3 passes to print a 21-row array. If you change the array size, remember to use a multiple of 7.

Continue by adding these five lines:110 FOR P=B TO E STEP 7*S120 PRINT "LOADING ROWS";P;"TO";P+6*S

130 LPRINT CHR$(27)"*"CHR$(0)CHR$(N)CHR$(0); 150 FOR C=1 TO N: GOSUB 180: NEXT C

160 LPRINT: NEXT PLine 110 loads the array rows from beginning (B) to end (E) in sets of seven.Line 120 prints to the screen an update of the computer’s progress.

Line 130 enters Graphics Mode and reserves N columns for graphics (N is the width of the array).

Line 150 accesses the subroutine (to be added next) that calculates the pin patterns for each column.

And line 160 closes the loop for each pass (P) of the print head.

Pin firing sequences

The last step before printing the figure is to convert those ones and zeros to pin firing sequences. Add this subroutine to your program:

170 LPRINT CHR$(27)"@": END

180 F=0: FOR R=P TO P+6*S STEP S190 IF A(R,C)=1 THEN F=F+2^ABS(P+6*S-R)200 NEXT R220 LPRINT CHR$(F);: RETURN

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. It examines the array vertically, one cell at a time. When it

179