/*nube*/ /*Fernando Galindo Soria*/ #include #include #include void nube(int,int,int,int,int); void recta(int,int,int,int,int*,int*); void main() { int gd=DETECT,gm; initgraph(&gd,&gm,""); nube(280,150,55,180,9); // getch(); // closegraph(); } void nube(int x0,int y0,int l,int an,int ind) { int x1,y1; if (bioskey(2)!=0x04) if (ind > 0) { recta(x0,y0,l,an,&x1,&y1); nube(x0,y0,l/1.25,an+30,ind-1); nube(x1,y1,l/1.3,an+50,ind-1); nube(x1,y1,l/1.4,an+100,ind-1); } } void recta(int x0,int y0,int l,int an,int *x1,int *y1) { *x1=x0-(l*cos(an/57.29578)); *y1=y0-(l*sin(an/57.29578)); line(x0,y0,*x1,*y1); }