C Program – Kite flying

by Nideesh C on April 17, 2011 · 0 comments

in C Programming




#include<stdio.h>
#include<time.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
 
void main()
{
	int gd=DETECT,gm;
	int x=10,y=480;
	initgraph(&gd,&gm,"..\\bgi");
	while(!kbhit())
	{
		cleardevice();
		if(y==0)
		{
			y=random(480);
			x=random(640);
		}
		else
		{
			y=y-1;
			x=x+1;
			line(x-50,y,x,y-70);
			line(x,y-70,x+50,y);
			line(x+50,y,x,y+70);
			line(x,y+70,x-50,y);
			line(x,y-70,x,y+70);
			line(x,y+70,x+10,y+140);
			line(x,y+70,x-10,y+140);
			line(x-50,y,x+50,y);
			line(x,y,x+130,y+640);
		}
		delay(20);
	}
	closegraph();
	restorecrtmode();
}



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Fish Movement Using C Program
  2. C Program – Display a line graph using midpoint line algorithm.
  3. C Program – Create a house and perform the operations.
  4. C program – Bar Graph
  5. C Program – Draw a rectangle and perform the operations.

Leave a Comment

Previous post:

Next post: