Fish Movement Using C Program

by Nideesh C on April 17, 2011 · 0 comments

in C Programming




#include<stdio.h>
#include<time.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
#include<graphics.h>
 
void main()
{
	int gd=DETECT,gm;
	int x=10,y=200,x1=675,y1=380;
	int stangle=35,endangle=140,radius=90;
 
	initgraph(&gd,&gm,"..\\bgi");
 
	while(!kbhit())
	{
		cleardevice();
		setbkcolor(BLACK);
 
		if(x<640)
		{
			x+=5;
			y+=1;
			arc(x,y,stangle,endangle+35,radius);
			arc(x,y-110,190,323,radius+2);
			circle(x+40,y-60,5);
			line(x-90,y-90,x-90,y-8);
		}
		else
		{
			x1-=5;
			y1-=1;
			arc(x1,y1,stangle-30,endangle+4,radius);
			arc(x1,y1-110,217,350,radius+2);
			circle(x1-40,y1-60,5);
			line(x1+90,y1-90,x1+90,y1-10);
		}
		setcolor(YELLOW);
		delay(90);
	}
	closegraph();
}



Not Satisfied ? Just search & get the result

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

Related posts:

  1. C Program – Implement the midpoint circle drawing algorithm
  2. C program to find the area of a circle, given the radius
  3. C program – Moving Car
  4. Sample – Program to draw circles.
  5. C program to accept a figure code and find the ares of different geometrical figures such as circle, square, rectangle etc using switch

Leave a Comment

Previous post:

Next post: