Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
|
|
@ -0,0 +1,42 @@
|
|||
()
|
||||
{
|
||||
cls(0);
|
||||
setcol(0xffffff);
|
||||
srand(1234);
|
||||
for(i=0; i<1000; i++) {
|
||||
rad = int( abs(nrnd*10) );
|
||||
x=rnd*xres;
|
||||
y=rnd*yres;
|
||||
drawcircle(x,y,rad);
|
||||
//drawsph(x,y,-rad);
|
||||
}
|
||||
}
|
||||
|
||||
drawcircle(cx,cy,r) {
|
||||
if (cx+r < 0 || cy+r < 0) return;
|
||||
if (cx-r > xres || cy-r > yres) return;
|
||||
r = int(r);
|
||||
if (r<=0) return;
|
||||
r2 = r+r;
|
||||
x = r; y = 0;
|
||||
dy = -2; dx = r2+r2 - 4;
|
||||
d = r2-1;
|
||||
while(y<=x) {
|
||||
setpix(cx-x, cy-y);
|
||||
setpix(cx+x, cy-y);
|
||||
setpix(cx-x, cy+y);
|
||||
setpix(cx+x, cy+y);
|
||||
setpix(cx-y, cy-x);
|
||||
setpix(cx+y, cy-x);
|
||||
setpix(cx-y, cy+x);
|
||||
setpix(cx+y, cy+x);
|
||||
d += dy;
|
||||
dy -= 4;
|
||||
++y;
|
||||
if (d<0) {
|
||||
d += dx;
|
||||
dx -= 4;
|
||||
--x;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue