answersLogoWhite

0


Best Answer

#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

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Source code in C for moving circle screensaver?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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"


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 airport code for Circle City Airport?

The airport code for Circle City Airport is IRC.


What is the python code for drawing a circle?

circle(radius)


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.


Where does source code come from in java?

Source code comes from the programmer...


What is the airport code for Circle Hot Springs Airport?

The airport code for Circle Hot Springs Airport is CHP.


Where can you get source code of Linux?

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


What was the Production Budget for Source Code?

The Production Budget for Source Code was $32,000,000.


When was Source Code released?

Source Code was released on 04/01/2011.