Iterative Graphics Fractal by Frank:
Here is a fun program that i wrote to explore iterative fractal graphics based on A. K. Dewdney's algorithms in Scientific American magazine. It is a fully interactive program. Tap up / down/ left/ right/ center of screen to adjust view and change patterns. Tap and drag to move patterns around on screen. Left/right tap generates new random patterns. Up/down tap zooms in/out. Center tap resets pattern. Works in portrait mode using iPhone retina mode screen 2 (640x920).
10 REM -- FRACTAL FUN --
20 GOSUB 4000
100 REM -MAIN LOOP-
101 POKE TAP,0
102 IF PEEK(TAP)=1 THEN 1000
103 IF PEEK(TAP)=2 THEN 500
110 X1=(SC*X)+MX
120 IF X1<0 OR X1>WIDTH THEN 160
130 Y1=(SC*Y)+MY
140 IF Y1<0 OR Y1>HEIGHT THEN 160
150 PSET X1,Y1,C1
160 CNT=CNT+1:IF CNT<300 GOTO 200
180 CNT = 0
190 C1=C1+1:IF C1>15 THEN C1=0
200 REM XX=Y-SQR(ABS(B*X-C))
202 XX = Y - SGN(X) * SQR(ABS(B * X - C))
210 YY = A - X
220 X = XX
230 Y = YY
240 GOTO 102
245 REM ---------------
500 REM TAP DRAG
501 MX=FN PK(XT) : MY=FN PK(YT)
503 X=0:Y=0:CNT=0:C1=0
504 RECT 0,0,WIDTH,HEIGHT,4
510 GOTO 100
1000 REM ---------------
1010 REM SCREEN WAS TAPPED
1020 XS=FN PK(XT) : YS=FN PK(YT)
1025 ALERT 2
1040 IF YS<(H2-CTR) THEN 1120
1050 IF YS>(H2+CTR) THEN 1150
1060 IF XS<(W2-CTR) THEN 1180
1070 IF XS>(W2+CTR) THEN 1185
1080 REM IN SCREEN CENTER
1090 A=3.14:B=3.2:C=6.28
1100 SC=15
1105 CIRCLE W2,H2,50,1,0:SLEEP 25
1110 GOTO 1190
1120 REM ZOOM IN
1122 DRAW "BM320,300C1R25U100R50H106G106R50D100R25":SLEEP 30
1125 SC=SC+3
1130 IF SC>100 THEN 1135
1131 GOTO 1190
1135 ALERT 5:SC=100:GOTO 1190
1150 REM ZOOM OUT
1152 DRAW "BM320,700C1R25D100R50G106H106R50U100R25":SLEEP 30
1155 SC=SC-3
1160 IF SC<1 THEN 1175
1170 GOTO 1190
1175 ALERT 5:SC=1:GOTO 1190
1180 REM RANDOM SEEDS
1181 DRAW "BM200,460C1U25L100U50G106F106U50R100U25":SLEEP 30
1182 GOTO 1189
1185 DRAW "BM440,460C1U25R100U50F106G106U50L100U25":SLEEP 30
1189 A=RND(TI)*6:B=RND(TI)*5:C=RND(TI)*6.28
1190 REM CLEAR SCREEN & VARS
1200 RECT 0,0,WIDTH,HEIGHT,4
1210 X=0:Y=0:CNT=0:C1=0
1220 GOTO 100
1230 REM -------------------
4000 REM SET UP SCREEN
4010 SCREEN 2:CLS
4020 TITLE "Fractal Fun"
4030 WIDTH=640:HEIGHT=920
4040 W2=WIDTH/2:H2=HEIGHT/2
4042 MX=W2:MY=H2
4045 CTR =180
4050 RECT 0,0,WIDTH,HEIGHT,4
4060 DEF FN PK(A)=PEEK(A)+PEEK(A+1)*256
4070 XT=1030:YT=1032:TAP=1024
4080 A=3.14:B=3.2:C=6.28
4090 X=0:Y=0:CNT=0:C1=0:SC=15
4100 LSET 3,0 REM PIXEL SIZE
4110 RETURN
20 GOSUB 4000
100 REM -MAIN LOOP-
101 POKE TAP,0
102 IF PEEK(TAP)=1 THEN 1000
103 IF PEEK(TAP)=2 THEN 500
110 X1=(SC*X)+MX
120 IF X1<0 OR X1>WIDTH THEN 160
130 Y1=(SC*Y)+MY
140 IF Y1<0 OR Y1>HEIGHT THEN 160
150 PSET X1,Y1,C1
160 CNT=CNT+1:IF CNT<300 GOTO 200
180 CNT = 0
190 C1=C1+1:IF C1>15 THEN C1=0
200 REM XX=Y-SQR(ABS(B*X-C))
202 XX = Y - SGN(X) * SQR(ABS(B * X - C))
210 YY = A - X
220 X = XX
230 Y = YY
240 GOTO 102
245 REM ---------------
500 REM TAP DRAG
501 MX=FN PK(XT) : MY=FN PK(YT)
503 X=0:Y=0:CNT=0:C1=0
504 RECT 0,0,WIDTH,HEIGHT,4
510 GOTO 100
1000 REM ---------------
1010 REM SCREEN WAS TAPPED
1020 XS=FN PK(XT) : YS=FN PK(YT)
1025 ALERT 2
1040 IF YS<(H2-CTR) THEN 1120
1050 IF YS>(H2+CTR) THEN 1150
1060 IF XS<(W2-CTR) THEN 1180
1070 IF XS>(W2+CTR) THEN 1185
1080 REM IN SCREEN CENTER
1090 A=3.14:B=3.2:C=6.28
1100 SC=15
1105 CIRCLE W2,H2,50,1,0:SLEEP 25
1110 GOTO 1190
1120 REM ZOOM IN
1122 DRAW "BM320,300C1R25U100R50H106G106R50D100R25":SLEEP 30
1125 SC=SC+3
1130 IF SC>100 THEN 1135
1131 GOTO 1190
1135 ALERT 5:SC=100:GOTO 1190
1150 REM ZOOM OUT
1152 DRAW "BM320,700C1R25D100R50G106H106R50U100R25":SLEEP 30
1155 SC=SC-3
1160 IF SC<1 THEN 1175
1170 GOTO 1190
1175 ALERT 5:SC=1:GOTO 1190
1180 REM RANDOM SEEDS
1181 DRAW "BM200,460C1U25L100U50G106F106U50R100U25":SLEEP 30
1182 GOTO 1189
1185 DRAW "BM440,460C1U25R100U50F106G106U50L100U25":SLEEP 30
1189 A=RND(TI)*6:B=RND(TI)*5:C=RND(TI)*6.28
1190 REM CLEAR SCREEN & VARS
1200 RECT 0,0,WIDTH,HEIGHT,4
1210 X=0:Y=0:CNT=0:C1=0
1220 GOTO 100
1230 REM -------------------
4000 REM SET UP SCREEN
4010 SCREEN 2:CLS
4020 TITLE "Fractal Fun"
4030 WIDTH=640:HEIGHT=920
4040 W2=WIDTH/2:H2=HEIGHT/2
4042 MX=W2:MY=H2
4045 CTR =180
4050 RECT 0,0,WIDTH,HEIGHT,4
4060 DEF FN PK(A)=PEEK(A)+PEEK(A+1)*256
4070 XT=1030:YT=1032:TAP=1024
4080 A=3.14:B=3.2:C=6.28
4090 X=0:Y=0:CNT=0:C1=0:SC=15
4100 LSET 3,0 REM PIXEL SIZE
4110 RETURN