mandelbrot.frink

Download or view mandelbrot.frink in plain text format

/** This is a very simple demonstration program that shows the basics of
    calculating the Mandelbrot set and displaying it as text. */


chars = [".", ",", "\"", "-", ":", "/", "(", "*", "|", "$", "#", "@", "%", "~"]

for im = -1.2 to 1.2 step .05
{
   imag = i * im
   for real = -2 to 1 step .04
   {  
      C = real + imag
      z = 0
      count = -1

      do
      {
         z = z^2 + C
         count=count+1;
      } while abs[z] < 4 and count < 14

      print[chars@(count-1)]
   }
   println[]
}


Download or view mandelbrot.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20145 days, 5 hours, 52 minutes ago.