100 IF Z=2 THEN B=1: E=N-6: S=1

110 FOR P=B TO E STEP 7*S

120 PRINT "LOADING ROWS";P;"TO"; P+6*S
130LPRINT CHR$(27) "*"CHR$(5)CHR$(2*N)CHR$(0);
140FOR C=N TO 1 STEP -1: GOSUB 180: NEXT C150FOR C=1 TO N: GOSUB 180: NEXT C160LPRINT: NEXT P: NEXT Z170LPRINT CHR$(27)"@": END180F=0: FOR R=P TO P+6*S STEP S190IF A(R,C)=1 THEN F=F+2^ABS(P+6*S-R)200NEXT R220LPRINT CHR$(F);: RETURN
Go ahead and RUN it to see how it works.

There are two important points here: 1) instead of tracing the circle like a plotter, the program gathers the pattern in the computer’s mem- ory, then prints it line by line; 2) the program takes advantage of symmetry to print a figure four times the size of the original array.

Exploding galaxy

With a few more program changes, you can turn this mundane circle into a design for an exploding galaxy. First change the size so that you can see the full impact of the figure (note that 105 is a multiple of seven):

10 DEFINT A: N=105: DIM A(N,N)

Yes, that 105 means this will take even longer to print out than the circle did, but that’s the price you pay for largeness.

If your computer system requires a WIDTH statement to prevent the printer from issuing a carriage return before the graphics line is complete, add it now:

7 WIDTH LPRINT 255

The format for this statement may be different for your BASIC; see your software documentation.

Next modify the distance formula slightly. Type:
30 D=SQR(R^2+C^2)/N: D=D*D

184