DECLARE STRUCTURE struct5: 5 OF NUMERIC
DECLARE STRUCTURE struct2: 2 OF NUMERIC
DECLARE SHARED buff OF struct5
DECLARE SHARED buff2 OF struct2
PARACT part1
OPTION ARITHMETIC NATIVE
DECLARE EXTERNAL SUB Julia
LET a=-.747
LET b= .094
LET left = -1.6
LET right = 1.6
LET h = (right - left)
SET WINDOW left,right,-h/2,h/2
ASK PIXEL SIZE(left,-h/2;right,h/2) px,py
LET px=px-1
LET py=py-1
LET dx=(right-left)/px/8
LET dy=h/py/8
SET POINT STYLE 1
PUT TO buff2 FROM left,right
PUT TO buff FROM a,b,dx,h,dy
START part2
CALL Julia(left,(left+right)/2)
END PARACT
PARACT part2
OPTION ARITHMETIC NATIVE
DECLARE EXTERNAL SUB Julia
GET FROM buff2 TO left, right
CALL Julia((left+right)/2, right)
END PARACT
EXTERNAL SUB Julia(x1,x2)
OPTION ARITHMETIC NATIVE
GET FROM buff TO a,b,dx,h,dy
FOR u= x1 TO x2 step dx
   FOR v = -h/2 to h/2 step dy
      LET xx = u
      LET yy = v
      FOR n = 1 TO 1000
         LET x = xx
         LET y = yy
         LET xx = x*x - y*y + a
         LET yy = 2 * x * y + b
         IF xx^2+yy^2>4 THEN EXIT FOR
      NEXT n
      IF n>1000 THEN PLOT POINTS: u,v
   NEXT v
NEXT u
END SUB

