|
|
mandelbrot
# The Computer Language Shootout
# http://shootout.alioth.debian.org/ use stdio use stdlib routine main( width=100 ) { height = width; wscale = 2.0/width; m = 50; limit2 = 4.0; stdio.print("P4\n", width, " ", height, "\n"); for( y = 0 : height-1 ){ Ci = (2.0 * y) / height - 1; for( xb = 0 : 8 : width-1 ){ bits = 0; xbb = xb + 7; for( x = xb : ( (xbb < width) and xbb ) or (width-1) ){ bits = bits + bits; Zr = 0.0; Zi = 0.0; Zrq = 0.0; Ziq = 0.0; Cr = x * wscale - 1.5; for( i = 1 : m ){ Zri = Zr * Zi; Zr = Zrq - Ziq + Cr; Zi = Zri + Zri + Ci; Zrq = Zr * Zr; Ziq = Zi * Zi; if( ( Zrq + Ziq ) > limit2 ){ bits = bits + 1; break; } } } if( xbb >= width ){ for( x = width : xbb ) bits = bits + bits + 1; } print( pack( 255 - bits ) ); } } }
view count 1216 times
created at 2009-02-20, 16:27 GMT |
fu: ... I forgot to say something about the plan for the whole new year in my previous reply. Well, besides w ... (Jan.19,01:40) fu: ... Happy new dragon year (which will start from this sunday)! Actually, it was a busy month (I wish th ... (Jan.18,22:46) ybabel: What's the plan for the new year ? Hello 'vry budy :- ) happy new year (when is the new year for you Fu ?) I saw you come back and comm ... (Jan.18,18:59) |