Skip to content

Instantly share code, notes, and snippets.

Created March 4, 2015 16:24
Show Gist options
  • Save anonymous/d234cb338971b3e958e0 to your computer and use it in GitHub Desktop.
Save anonymous/d234cb338971b3e958e0 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
int n = 200,x = 50, y = 50, r=30;
void move()
{
setcolor(GREEN);
circle(x,y,r);
delay(70);
setcolor(BLACK);
setfillstyle(1,BLACK);
circle(x,y,r);
floodfill(x,y,BLACK);
delay(50);
putpixel(x,y,8);
return;
}
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\tc\BGI");
while(n>0)
{
while(y<450)
{
move();
y = y+25;
x=x+5;
putpixel(x,y,8);
} while (y>n)
{ move();
y=y-25;
x=x+5;
putpixel(x,y,8);
} n=n+50;
}setcolor(GREEN);
circle(x,y,r);
getch();
closegraph();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment