PROGRAM MANDELBROT ( OUTPUT ); (* Angepasst fuer den JOYCE *) CONST PCW_X = 230; PCW_Y = 95; LIMIT = 100; LONG = TRUE; (*$I GR.PAS *) VAR X, Y, X_ALT, Y_ALT, RE_C, IM_C, DC : REAL; K, L, N : INTEGER; FUNCTION RUNPLOT:BOOLEAN; BEGIN CASE LONG OF FALSE : RUNPLOT := ( N > LIMIT ); TRUE : RUNPLOT := ( N > LIMIT ) OR ( ( N < 11 ) AND ( N MOD 2 = 0 ) ); END; END; BEGIN GRAPHIC; COLOR ( WHITE ); DC := 3 / PCW_X; FOR K := 0 TO PCW_X DO BEGIN RE_C := -2.25 + K * DC; FOR L := 0 TO PCW_Y DO BEGIN IM_C := L * DC; X := 0; Y := 0; N := 0; REPEAT X_ALT := X; Y_ALT := Y; X := SQR( X_ALT ) - SQR ( Y_ALT ) + RE_C; Y := 2 * X_ALT * Y_ALT + IM_C; N := N + 1; UNTIL ( N > LIMIT ) OR ( ( SQR( X ) + SQR( Y ) ) > LIMIT ); IF RUNPLOT THEN BEGIN PLOT ( K, PCW_Y + L ); PLOT ( K, PCW_Y - L ) END END END; (* WHILE NOT KEYPRESSED DO; *) TEXT; END.