Anonymous user
Brownian tree: Difference between revisions
no edit summary
(Created page with '{{Wikipedia|Brownian_tree|en}} Category:Raster graphics operations {{task|Fractals}}Generate and draw a Brownian Tree. =={{header|C}}== This code uses …') |
No edit summary |
||
Line 29:
py = rand() % SIZE;
// randomly choose a direction
dx = rand() % 3 - 1;
Line 41 ⟶ 40:
}else if (world[py + dy][px + dx] != 0){
// bumped into something
hit = 1;▼
world[py][px] = 1;
}else{
py += dy;
Line 57 ⟶ 56:
int x, y;
memset(world, 0, sizeof
srand((unsigned)time(NULL));
|