Skip to content

Instantly share code, notes, and snippets.

@houmei
Created September 29, 2018 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save houmei/fa774c2586003ccae165d09a75dac15e to your computer and use it in GitHub Desktop.
Save houmei/fa774c2586003ccae165d09a75dac15e to your computer and use it in GitHub Desktop.
MachiKania Type M sample BASIC program / Mandelblot https://rosettacode.org/wiki/Mandelbrot_set#Processing
USEGRAPHIC 5
W=288
H=216
I=0
J=0
F=10
X=W/4
Y=H/8
V=2
Z=1
K=0
L=0
FOR K=0 TO W
T#=(FLOAT#(K)+FLOAT#(I))/FLOAT#(X)-FLOAT#(V)
FOR L=0 TO H
U#=FLOAT#(Z)-(FLOAT#(L)+FLOAT#(J))/FLOAT#(W)
R#=0
S#=0
P#=0
Q#=0
N=1
WHILE (P#+Q#)<4
IF N>255 THEN BREAK
Q#=S#*S#
P#=R#*R#
S#=2*S#*R#+U#
R#=P#-Q#+T#
N=N+1
WEND
PSET K,L,N
NEXT
NEXT
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment