Skip to content

Instantly share code, notes, and snippets.

@eparadis
Last active June 25, 2025 16:19
Show Gist options
  • Select an option

  • Save eparadis/d4a242c8cc149f3583c303efa80532c4 to your computer and use it in GitHub Desktop.

Select an option

Save eparadis/d4a242c8cc149f3583c303efa80532c4 to your computer and use it in GitHub Desktop.
ascii art mandelbrot drawing program in BASIC
10 x1=59
11 y1=21
20 i1=-1.0
21 i2=1.0
22 r1=-2.0
23 r2=1.0
30 s1=(r2-r1)/x1
31 s2=(i2-i1)/y1
40 for y=0 to y1
50 i3=i1+s2*y
60 for x=0 to x1
70 r3=r1+s1*x
71 z1=r3
72 z2=i3
80 for n=0 to 29
90 a=z1*z1
91 b=z2*z2
100 if a+b>4.0 goto 130
110 z2=2*z1*z2+i3
111 z1=a-b+r3
120 next n
130 print chr$(62-n);
140 next x
150 print
160 next y
170 end
@lproven
Copy link

lproven commented Jun 17, 2025

-INT(N/6)*6+49)

Where did N come from here? Was it originally I?

@eparadis
Copy link
Author

Where did N come from here?
The ANSI color modification is for the original listing at the top of the page, where N is the number of iterations through the inner-most loop.

In the other listings, I is the equivalent variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment