Brownian tree: Difference between revisions
m
→{{header|Evaldraw}}: draw_brownian_tree is better named simulate_brownian_tree, as the actual draw is done in main
(→{{header|Evaldraw}}: add image) |
m (→{{header|Evaldraw}}: draw_brownian_tree is better named simulate_brownian_tree, as the actual draw is done in main) |
||
Line 1,492:
<syntaxhighlight lang="c">
enum{SIZE=256, PARTICLES_PER_FRAME=10, PARTICLE_OK, GIVE_UP};
static world[SIZE][SIZE];
()
Line 1,500:
t = klock();
cls(0);
Line 1,506:
for (x = 0; x < SIZE; x++){
cell = world[y][x];
if ( cell ) {
s = 100; // color scale
setcol(128+(s*cell % 128), 128+(s*.7*cell % 128), 128+(s*.1*cell % 128) );
Line 1,514 ⟶ 1,513:
}
}
moveto(0,SIZE+15);
setcol(0xffffff);
printf("%g frames", numframes);
}
Line 1,525 ⟶ 1,527:
}
for(iter=0; iter<
{
// set particle's initial position
|