Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v4 n10 (Volume 4, Issue 10)
Date: October 1983
Pages: 9
This program lets you draw on your screen using arrow keys and stores your drawing in an array. Type in the listing, then RUN in SLOW. Use the arrow keys to move the square in the lower left corner, leaving a line behind.
When you finish, press R. The computer clears the screen and retraces your steps, then stops. You can quit early by pressing BREAK.
10 CLS
20 DIM X(1000)
30 DIM Y(1000)
40 FOR Z=1 TO 1000
50 IF INKEY$="5" THEN LET X(Z)=X(Z)-1
60 IF INKEY$="8" THEN LET X(Z)=X(Z)+1
70 IF INKEY$="6" THEN LET Y(Z)=Y(Z)-1
80 IF INKEY$="7" THEN LET Y(Z)=Y(Z)+1
90 PLOT X(Z),Y(Z)
100 IF INKEY$="R" THEN GOSUB 5000
110 LET X(Z+1)=X(Z)
120 LET Y(Z+1)=Y(Z)
130 NEXT Z
5000 CLS
5010 FOR Z=1 TO 1000
5020 PLOT X(Z),Y(Z)
5030 NEXT Z
5040 STOP
SYNTACTIC SUM: 20083, 8K ROM
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.