DECLARE STRUCTURE struct2: 2 OF NUMERIC
DECLARE MESSAGE buff OF struct2

PARACT part1
START part2
LET left = -2
LET right= .8                             
LET h = (right - left) 
SET WINDOW left, right,-h/2,h/2  
DRAW axes  
SET POINT STYLE 1
ASK PIXEL SIZE(left,-h/2;right,h/2) px,py
SEND TO buff FROM px,py
DECLARE EXTERNAL SUB mandelb
call mandelb(0,int(px/2),int(py/2),py)
END PARACT

PARACT part2
RECEIVE FROM buff TO px,py
DECLARE EXTERNAL SUB mandelb
CALL mandelb(INT(px/2)+1,px,INT(py/2),py)
END PARACT

EXTERNAL SUB mandelb(a0,a1,b0,b1)
FOR a=a0 TO a1
   LET u=problemx(a)
   FOR b=b0 TO b1
      LET v=problemy(b)
      LET x = 0                                
      LET y = 0                                
      FOR n = 1 TO 250                        
         LET x1 = x^2 - y^2 + u       
         LET y1 = 2 * x * y + v               
         LET x = x1                           
         LET y = y1                           
         IF x^2+y^2>4 THEN
            SEIZE colorpoint
               SET POINT COLOR MIN(n,15)
               PLOT POINTS: u,v
               PLOT POINTS: u,-v
            END SEIZE
            EXIT FOR
         END IF  
      NEXT n                                  
   NEXT b                                      
NEXT a                                        
END SUB


