みんなでC言語のソースを出し合おう
■ このスレッドは過去ログ倉庫に格納されています
0018笹井奈琴
2006/02/11(土) 09:36:55#include <stdio.h>
#include <stdlib.h>
int check( float c_re, float c_im ) {
int i;
float re = c_re, im = c_im, norm;
for( i = 0; i < 64 && ( norm = re*re-im*im ) < 4; i++ ) {
im = 2*re*im+c_im;
re = norm+c_re;
}
return i;
}
int main( int argc, char* argv[] ) {
int x, y, c;
for( y = 0; y < 22; y++ ) {
for( x = 0; x < 79; x++ ) {
c = check( (float)(x-50)/30, (float)(y-11)/10 );
putchar( c == 64 ? ' ' : '@' + c%16 );
}
putchar( 'n' );
}
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています