#bbcbasic

eds@diaspora.glasswings.com

Today's coding, a Mandelbrot using integer variables only - for speed!

(Is it still structured Basic if you pack two IFs, a REPEAT and two FORs onto one line?)

100MODE7:REM A BASIC, ASCII MANDELBROT
110REM This implementation copyright (c) 2019-2021, Gordon Henderson
120REM Permission to use/abuse anywhere for any purpose granted, but
130REM it comes with no warranty whatsoever. Good luck!
140C$=".,'~=+:;[/<&?oxOX# " : REM Lightest to darkest...
150S=-2.0:T=1.25:P=2.5:Q=-2.5
160W%=32:H%=24:S%=2^13:M%=4*S%:B%=1:L%=LEN(C$)+1
170J=P/W%:U=Q/H%:Q%=TIME
180FORY%=0TOH%:R%=(U*Y%+T)*S%:V%=(S-J)*S%:FORX%=0TOW%:V%=V%+J*S%:D%=0:E%=0:A%=B%:REPEATIFA%<L% J%=D%*D%DIVS%:K%=E%*E%DIVS%:IFJ%+K%<M% Z%=J%-K%+V%:E%=(D%+D%)*E%DIVS%+R%:D%=Z%:A%=A%+1:UNTILFALSE
190UNTILTRUE:PRINT MID$(C$,A%-B%,1);
200NEXT:PRINT:NEXT
210PRINT:PRINT (TIME - Q%) / 100:END

#BBCBasic #retroComputing #8bit #BBCMicro #mos6502