This program shows the ZX81’s ability to draw pictures under BASIC control. Run the program and enter the title of your work. Hit NEWLINE or ENTER, and you get a flashing cursor in the center of the screen. This is the editing cursor. Control the direction of this cursor in real-time with keys 5-8. The cursor moves in the direction of the arrows on the keys. In this mode you can move anywhere on the screen.
To start drawing, press 1. This puts the computer in plot mode. Again, you have real-time directional control by pressing keys 5-8. To erase, go back to edit mode (hit 0) and move the cursor over the line to erase.
When you finish a masterpiece, you can save it on tape. Turn on your recorder and press S. It saves under the title you gave it.
You can exit just about any time by pressing BREAK. This program should run in 2K RAM for those of you who have modified your ZX81’s or added a 16K RAM pack.
5 LET X=32
10 LET Y=20
15 PRINT "ENTER TITLE."
20 INPUT A$
25 CLS
30 PLOT X,Y
40 UNPLOT X,Y
50 IF INKEY$="5" THEN LET X=X-1
60 IF INKEY$="6" THEN LET Y=Y-1
70 IF INKEY$="7" THEN LET Y=Y+1
80 IF INKEY$="8" THEN LET X=X+1
90 IF INKEY$="1" THEN GOTO 100
95 GOTO 30
100 PLOT X,Y
110 IF INKEY$="5" THEN LET X=X-1
120 IF INKEY$="6" THEN LET Y=Y-1
130 IF INKEY$="7" THEN LET Y=Y+1
140 IF INKEY$="8" THEN LET X=X+1
150 IF INKEY$="0" THEN GOTO 30
160 IF INKEY$="S" THEN SAVE A$
170 GOTO 100
SYNTACTIC SUM: 23487, 8K
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.