Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
42
Task/Mandelbrot-set/FutureBasic/mandelbrot-set.basic
Normal file
42
Task/Mandelbrot-set/FutureBasic/mandelbrot-set.basic
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
_xmin = -8601
|
||||
_xmax = 2867
|
||||
_ymin = -4915
|
||||
_ymax = 4915
|
||||
_maxiter = 32
|
||||
_dx = ( _xmax - _xmin ) / 79
|
||||
_dy = ( _ymax - _ymin ) / 24
|
||||
|
||||
void local fn MandelbrotSet
|
||||
printf @"\n"
|
||||
SInt32 cy = _ymin
|
||||
while ( cy <= _ymax )
|
||||
SInt32 cx = _xmin
|
||||
while ( cx <= _xmax )
|
||||
SInt32 x = 0
|
||||
SInt32 y = 0
|
||||
SInt32 x2 = 0
|
||||
SInt32 y2 = 0
|
||||
SInt32 iter = 0
|
||||
while ( iter < _maxiter )
|
||||
if ( x2 + y2 > 16384 ) then break
|
||||
y = ( ( x * y ) >> 11 ) + (SInt32)cy
|
||||
x = x2 - y2 + (SInt32)cx
|
||||
x2 = ( x * x ) >> 12
|
||||
y2 = ( y * y ) >> 12
|
||||
iter++
|
||||
wend
|
||||
print fn StringWithFormat( @"%3c", iter + 32 );
|
||||
cx += _dx
|
||||
wend
|
||||
printf @"\n"
|
||||
cy += _dy
|
||||
wend
|
||||
end fn
|
||||
|
||||
window 1, @"Mandelbrot Set", ( 0, 0, 820, 650 )
|
||||
WindowSetBackgroundColor( 1, fn ColorBlack )
|
||||
text @"Impact", 10.0, fn ColorWithRGB( 1.000, 0.800, 0.000, 1.0 )
|
||||
|
||||
fn MandelbrotSet
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue