Line 40 completes the loop.

Line 50 doesn’t print anything-it just forces a carriage return at the end of the print line, overriding the semicolon of line 30. Forcing the carriage return is not really necessary since the line is the last one of this program. It’s just a good habit to develop.

Notice that the printer doesn’t print each time it receives a CHR$(l). The FX stores data in its print buffer until it receives as many numbers as it expects-in this case, 100.

Slash

Using the form 2^X, you can fire individual pins by letting X vary between 0 and 7 (0 and 6 for 7-bit systems). Here’s how it works. To exercise the pins in a pattern (a slash) that shows off their placement, enter:

NEW

40 LPRINT CHR$(27)"K"CHR$(7)CHR$(0);80 FOR X=0 TO 6

ll0 LPRINT CHR$(2^X); 120 NEXT X

When X equals 0,2^X is 1-so the bottom graphics pin is fired. When X equals 1,2^X is 2--SOthe second pin is fired. This pattern continues right up through X equals 6, which fires the seventh pin. We purposely omit X equals 7 to accommodate systems that are limited to 7 bits.

Large caret

The next step is to change the direction of the slash. Can you guess how it’s done? Sure, just reverse the order of the exponents, and the same routine can be used. In fact, let’s turn it into a subroutine:

10 F=040 LPRINT CHR$(27)"K"CHR$(14)CHR$(0);50 GOSUB 80: F=1: GOSUB 8070 LPRINT CHR$(27)"@": END

80 FOR X=0 TO 6

90 N=X: IF F=1 THEN N=6-X

139