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
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();
draw_brownian_treesimulate_brownian_tree(t);
 
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:
}
 
draw_brownian_treesimulate_brownian_tree(time){
for(iter=0; iter<20PARTICLES_PER_FRAME; iter++) // Rate of particle creation
{
// set particle's initial position
63

edits