Graphics

Printing taller pattm

The next examtile shows how several’ lines of graphics can be formed into a figure taller than eight dots. It uses programming techniques for producing textured or repetitive patterns.

In the following program, the lines inside each pair of FOR and NEXT statements ara indented so that:you, can see how the program works; the spaces are not needed for the program to run.

100 WIDTH "LPT1:",255

110 LPRINT CHR$(27):"A":CHR$(S):

120 FOR R-l TO 6

130LPRINT CHR$(27):"K":CHR$(lOO):CHR$(O~:

140FOR X-l TO 50

150LPRINT CHR$(170);CHR$(85):

160NEXT X : LPRINT

170NEXT R

180LPRINT CHR$(27);"0"

If you rtm the program,, you .will see bow it combines six print lines into a pattern.

There are five basic steps that the program goes through to produce this kind of!!pa>te+:

1.The computer is prevented from adding any extra characters by the WIDTH statement (line 100).

2.The line spacing is changed to 8/72 of an inch - the height of the dot patterns used in the program (line 110).

3.The program goes through the graphics commands the required number of times (line 120 and 170).

4-16 Software and Graphics