Draw A Picture Program

Author(s): Salvatore Curcio
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v4 n7 (Volume 4, Issue 7)
Date: July 1983
Pages: 11

Draw circles, diagonals and straight lines easily with this drawing program. Type in the program and RUN then ENTER. Begin your design from the blinking pixel in the lower left corner, using the key functions listed in this article. If you want to begin at a different point, press U and hold it down for several seconds. This takes the computer out of the PLOT mode and lightens the blinking pixel. Then move the pixel to the desired beginning point of your drawing. Press P for several seconds to get back into PLOT mode (dark pixel). Now begin drawing with the desired keys. Use this UNPLOT, PLOT, UNPLOT sequence to move the pixel around, and when crossing a line already drawn (to avoid erasing existing lines).

PLOTting continues until you release the directional key. When drawing circles, hold the plotting keys down until finished to prevent circle distortion. Distortion may occur if your circle hits a line.

Pressing BREAK allows you to enter keywords if desired. Hit RUN to begin drawing again.

To plot lines

Keys #5-8 for vertical or horizontal direction. Do not shift.

To plot 45° diagonal lines

Key #4 for left-right upward line
Key #3 for left-right downward line
Key #2 for right-left upward line
Key #1 for right-left downward line

To plot circles

Key C plots counterclockwise
Key D plots clockwise

Function keys

Key R returns blinking pixel to start postion in lower left corner
Key P puts computer in PLOT mode
Key U puts computer in UNPLOT mode

   5 SLOW
10 LET A=1
20 LET X=0
30 LET Y=0
40 LET P=A
50 PLOT X,Y
60 UNPLOT X,Y
70 IF P=A THEN PLOT X,Y
80 IF INKEY$="R" THEN GOTO 10
90 IF INKEY$="8" THEN LET X=X+1
100 IF INKEY$="7" THEN LET Y=Y+1
110 IF INKEY$="6" THEN LET Y=Y-1
120 IF INKEY$="5" THEN LET X=X-1
130 IF INKEY$="4" THEN GOTO 270
140 IF INKEY$="3" THEN GOTO 300
150 IF INKEY$="2" THEN GOTO 330
160 IF INKEY$="1" THEN GOTO 360
170 IF INKEY$="U" THEN LET P=0
180 IF INKEY$="P" THEN LET P=1
190 LET B=1
200 LET N=X
210 LET I=Y
220 IF INKEY$="C" THEN GOTO 390
230 IF INKEY$="D" THEN GOTO 480
240 IF X>=63 THEN LET X=63
245 IF X<=0 THEN LET X=0
250 IF Y>=43 THEN LET Y=43
255 IF Y<=0 THEN LET Y=0
260 GOTO 50
270 LET X=X+1
280 LET Y=Y+1
290 GOTO 240
300 LET X=X+1
310 LET Y=Y-1
320 GOTO 240
330 LET X=X-1
340 LET Y=Y+1
350 GOTO 240
360 LET X=X-1
370 LET Y=Y-1
380 GOTO 240
390 LET X=10+N-10*COS (B/16*PI)
400 LET Y=I-10*SIN (B/16*PI)
410 IF X>=63 THEN LET X=63
413 IF Y>=43 THEN LET Y=43
416 IF X=63 OR Y=43 THEN GOTO 50
419 IF X<=0 THEN LET X=0
422 IF Y<=0 THEN LET Y=0
425 IF X=0 OR Y=0 THEN GOTO 50
430 PLOT X,Y
440 LET B=B+1
450 IF B>32 THEN GOTO 50
460 IF INKEY$="C" THEN GOTO 390
470 GOTO 50
480 LET X=10+N-10*COS (B/16*PI)
490 LET Y=I+10*SIN (B/16*PI)
500 IF X>=63 THEN LET X=63
503 IF Y>=43 THEN LET Y=43
506 IF X=63 OR Y=43 THEN GOTO 50
509 IF X<=0 THEN LET X=0
512 IF Y<=0 THEN LET Y=0
515 IF X=0 OR Y=0 THEN GOTO 50
520 PLOT X,Y
530 LET B=B+1
540 IF B>32 THEN GOTO 50
550 IF INKEY$="D" THEN GOTO 480
560 GOTO 50
SYNTACTIC SUM: 25758, 8K ROM

Media

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.