answersLogoWhite

0

#include


#include


#include


#include


#include


void main()


{


int dr,md,midx,i, midy,dx,dy,mx, my,k,x,y,xdir,ydir,oldx,oldy;


double pi,tpi,a,t;


void *ball;



unsigned imgsize;


dr = DETECT;



initgraph(&dr, &md, "c:\\tc\\bgi");


midx = getmaxx()/2; midy = getmaxy()/2;


pi = 3.14159;


tpi = pi * 2.0;


setcolor(13);


circle(midx,midy,10);


imgsize = imagesize(midx-10, midy-10, midx+10, midy+10);


ball = malloc(imgsize);


getimage(midx-10, midy-10, midx+10, midy+10,ball);


putimage(midx-10, midy-10, ball,XOR_PUT);




xdir = -5; ydir=5;



do


{


oldx = midx; oldy = midy;


midx = midx + random(xdir);


midy = midy + random(ydir) ;



if (midx < 0)


{


midx = midx + 5;


xdir =5;


}


if (midx > getmaxx())


{


midx = midx - 5;


xdir = -5;


}


if (midy < 0)


{


midy = midy + 5;


ydir = 5;


}


if (midy > getmaxy())


{


midy = midy - 5;


ydir = -5;


}



putimage(midx-10, midy-10,ball,XOR_PUT);


for (a=1.0; a<30000.0; a=a+0.1);


{


}


putimage(midx-10, midy-10,ball,XOR_PUT);




} while (!kbhit());



getch();


}


User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the code number for code c on forever lost?

In the office room with the computer without keyboard. If you wait just a bit, the screensaver will come on. And the screensaver is your answer "C : 8008"


Where can I get th code for Koi Fish 3D Screensaver 1.0?

You can typically find the code for Koi Fish 3D Screensaver 1.0 on the official website of the software developer or through authorized software distribution platforms. If you're looking for source code or a specific version, consider checking repositories like GitHub or forums dedicated to software development. Always ensure that you are downloading from trusted sources to avoid malware or unauthorized versions.


How do you convert C source code into a screensaver for Linux?

Most screensavers on Linux are modules run by Xscreensaver: http://en.wikipedia.org/wiki/XScreenSaver I don't know exactly how to convert a program to a module, check the Xscreensaver documentation.


Is having a unsecured load a moving violation in Texas?

No. Source: Texas Administrative Code, 37 TAC &sect;15.89(b).


What is the pin code of Jacob Circle?

The pin code of Jacob Circle is 400011.


What is the python code for drawing a circle?

circle(radius)


What is the airport code for Circle City Airport?

The airport code for Circle City Airport is IRC.


Is Source Code the same as CSS Code?

It can be but source code is just the code of a webpage. Whatever format it is.


What is the airport code for Circle Hot Springs Airport?

The airport code for Circle Hot Springs Airport is CHP.


Where does source code come from in java?

Source code comes from the programmer...


Where can you get source code of Linux?

The source code for the Linux kernel is hosted at kernel.org.


When was Source Code released?

Source Code was released on 04/01/2011.