Horizontal and Vertical graphics lets you draw lines by direct input and loops so you can draw until you run out of memory.
Line 10, INPUT A$, selects the type of line you want to draw–horizontal or vertical.
For horizontal lines INPUT A controls the Y-pixel coordinate, INPUT B controls the beginning X coordinate and INPUT C controls the end X coordinate.
For vertical lines, INPUT A controls X-pixel coordinate, INPUT B controls the beginning of the line, and INPUT C controls the end of the line (Y-pixel coordinates).
After you enter the listing, press RUN and “L” appears. Press H or V to select the mode and ENTER. The L cursor appears again–enter coordinates A, B, and C one at a time and your ZX/TS will draw the line. To stop, hit STOP and ENTER twice. Try this example which draws a small rectangle (hit ENTER after each mode and number):
1) Select H mode and press 9, 4 and 13. Select H mode again and hit 4, 4, 13.
2) Press V for vertical mode and hit 4, 4, and 9. Select V again and hit 13, 4, 9.
10 INPUT A$
20 IF A$="H" THEN GOTO 50
30 IF A$="V" THEN GOTO 130
40 GOTO 10
50 INPUT A
60 INPUT B
70 INPUT C
80 LET Y=A
90 FOR X=B TO C
100 PLOT X,Y
110 NEXT X
120 GOTO 10
130 INPUT A
140 INPUT B
150 INPUT C
160 LET X=A
170 FOR Y=B TO C
180 PLOT X,Y
190 NEXT Y
200 GOTO 10
SYNTACTIC SUM: 14097, 8K ROM
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.