mIRC on Fractals — File Browser

mIRConFractalsv1.0 / mIRConFractalsv1.0 / fractal.mrc

fractal.mrc — 1.46 KB — Download this file

alias mandelbrot {
  window -ap @Mandelbrot 50 50 208 227
  set %start $ctime
  drawtext @Mandelbrot 1 Fixedsys 9 1 1 This may take a while...
  drawtext @Mandelbrot 1 Fixedsys 9 1 13 Hit Ctrl + Break to quit
  %x = 0
  %y = 0
  :x
  inc %x
  %y = 0
  :y
  inc %y
  %r = %x * 0.01625 + -2.2
  %i = %y * 0.0125 + -1.25
  %it = 0
  %a = 0
  %b = 0
  :It
  %da = %a
  %a = $calc(%da ^ 2 - %b ^ 2 + %r)
  %b = $calc(2 * %da * %b + %i)
  %l = $calc(%a ^ 2 + %b ^ 2)
  inc %it
  if (%l > 5) || (%it > 16) { goto draw }
  goto it
  :draw
  DrawDot -n @Mandelbrot %it 1 %x %y
  if (%y < 200) { goto y }
  drawdot @Mandelbrot
  if (%x < 200) { goto x }
  echo Duration: $duration($calc($ctime - %start))
}
alias julia {
  window -ap @Julia 50 50 208 227
  drawtext @Julia 1 Fixedsys 9 1 1 This may take a while...
  drawtext @Julia 1 Fixedsys 9 1 13 Hit Ctrl + Break to quit
  %dx = 0.01
  %dy = %dx
  %cx = -2
  %x = 0
  %start = $ctime
  :x
  inc %x
  drawdot @Julia
  %cy = -1
  %y = 0
  :y
  inc %y
  %it = 0
  %r1 = %cx
  %i1 = %cy
  :it
  %r2 = $calc((%r1 + %i1) * (%r1 - %i1))
  %i2 = $calc(2 * %r1 * %i1 + 1)
  %r = $calc(%r1 ^ 2 + %i1 ^ 2)
  inc %it
  %r1 = %r2
  %i1 = %i2
  if (%r > 100) || (%it > 16) { goto draw }
  goto it
  :draw
  DrawDot -n @Julia %it 1 %x %y
  %cy = %cy + %dy
  if (%y < 200) { goto y }
  %cx = %cx + %dx
  %cx = %cx + %dx
  if (%x < 200) { goto x }
  echo Duration: $duration($calc($ctime - %start))
}