This program draws patterns by itself. It traces a continuous line, starting at the left-hand center edge of the screen, bouncing off the edges, and stopping only if the line leads into one corner.
ETCH fits in 1K RAM. Start the program using RUN (ENTER). When the cursor appears, enter the slope of the line; 0 yields a horizontal line; 1, a 45 diagonal up; -1, a 45 diagonal down. Values may be any number, including decimal or fractional values, but those between plus or minus 5 seem to be the most productive.
When an interesting pattern appears, type “M” to pause; hit any key to resume operation.
BREAK followed by ENTER will stop the program. To restart, just press RUN and ENTER again.
110 LET X=0
120 LET Y=0
130 PLOT X, Y+20
140 INPUT Z
160 LET U = 1
165 LET T = 2
170 LET Y = Y+1
180 LET X = X+1
185 GOSUB 800
220 GOTO 170
260 LET U = 0
265 LET T = 3
270 LET Y = Y-1
280 LET X = X+1
285 GOSUB 800
320 GOTO 270
360 LET U = 3
365 LET T = 0
370 LET Y = Y+1
380 LET X = X+1
385 GOSUB 800
420 GOTO 370
460 LET U = 2
465 LET T = 1
470 LET Y = Y-1
480 LET X = X-1
485 GOSUB 800
520 GOTO 470
800 LET B=20+Z*Y
805 IF INKEY$ = "M" THEN PAUSE 10000
810 IF ABS B > 43 THEN GOTO (460-100*T)
820 IF ABS X = 64 THEN GOTO (460-100*U)
830 UNPLOT X,B
840 PLOT X,B
850 RETURN
SYNTACTIC SUM: 33948, 8K/1K
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.