Generally SYNC prefers articles in some depth to help you get more out of your computer. However, we receive many short programs that illustrate a point, demonstrate a technique, or show something the reader has found interesting. “Just for Fun” shares these programs with you. If you learn something, great. If you have some fun, great. If you have some that you want to share, send them to: Just for Fun, SYNC, 39 E. Hanover Ave., Morris Plains, NJ 07950.
Graphics Loop I
Bernard Bush
One technique for squeezing more into the limited memory of the basic ZX81 is to use a loop. The following program illustrates the method applied to create a continually changing graphics display. Enter the program. Then be sure you are in SLOW mode. Hit RUN and ENTER and enjoy the show.

10 REM GRAPHICS LOOP
20 LET A=INT (RND*10)+1
30 LET B=INT (RND*10)+1
40 LET C=INT (RND*10)+1
50 LET D=INT (RND*10)+1
60 LET E=INT (RND*10)+1
70 PRINT
80 PRINT
90 PRINT
100 PRINT
110 FOR J=1 TO 58
120 PRINT CHR$ A;
130 PRINT CHR$ B;
140 PRINT CHR$ C;
150 PRINT CHR$ D;
160 PRINT CHR$ E;
170 NEXT J
180 UNPLOT J,J-16
190 GOTO 10
200 REM STOP WITH BREAK
Graphics Loop II
James Grosjean
The same screen display developed in “Graphics Loop I” can be achieved by the following program which establishes the loop through a technique suggested by Ken Berggren in his “Handling Strings from another DIMension” in this issue.
10 FOR I=1 TO 5
20 LET A=RND*9+1
30 POKE 16537,38+I
40 NEXT I
50 POKE 16537,38
60 PRINT AT 5,0
70 FOR J=1 TO 58
80 PRINT CHR$ A;CHR$ B;CHR$ C;CHR$ D;CHR$ E;
90 NEXT J
100 RUN
Draw It
Robert S. Boynton
Many drawing programs require you to encode a picture and then display it, but this short program allows you to draw and edit a detailed picture even in 1K. Enter the program, be sure you are in SLOW mode, and press RUN and NEWLINE. A black pixel will be displayed at center screen. You can move the pixel by using the arrow keys (no need to shift). If you make a mistake or you want to move without leaving a mark, press RUBOUT and the pixel will flash. You can now move it to a new location or backwards to erase. Press RUBOUT again to return to plotting. You can also put any keyboard character into your picture by pressing the EDIT key (no shift), and insert the character you want in the quotation marks. Press NEWLINE and the character will appear at the pixel location. The RUBOUT feature works on the printed characters. Do not go beyond the normal machine plotting area or error B will result. If you do not want to use the characters, you can omit lines 110 and 130 to 150.
10 LET Z=0
20 LET X=32
30 LET Y=22
40 PLOT X,Y
50 IF Z THEN UNPLOT X,Y
60 IF INKEY$="5" THEN LET X=X-1
70 IF INKEY$="8" THEN LET X=X+1
80 IF INKEY$="6" THEN LET Y=Y-1
90 IF INKEY$="7" THEN LET Y=Y+1
100 IF INKEY$="0" THEN LET Z=NOT Z
110 IF INKEY$="1" THEN GOSUB 130
120 GOTO 40
130 INPUT A$
140 PRINT A$
150 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.