Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  best compiler
Language: C/C++
Code:
#include<iostream>
#include<graphics.h>
using namespace std;
void bfill(int x,int y,int b_color,int f_color)
{
if(getpixel(x,y)!=b_color && getpixel(x,y)!=f_color)
{
putpixel(x,y,b_color,f_color);
bfill(x+1,y, b_color,f_color);
bfill(x,y+1,b_color,f_color);
bfill(x-1,y,b_color,f_color);
bfill(x,y-1,b_color,f_color);
bfill(x-1,y-1,b_color,f_color);
bfill(x-1,y+1,b_color,f_color);
bfill(x+1,y-1,b_color,f_color);
bfill(x+1,y+1,b_color,f_color);
}
}
int main()
{
int gm,gd=DETECT;
int x,y,radius;
cout<<"enter the x & y positions for the circle";
cin>>x>>y;
cout<<"enter the radius";
cin>>radius;
initgraph(&gd,&gm,NULL);
circle(x,y,radius);
rectangle(20,20,15,15);
bfill(100,100,9,15);
closegraph();
getch();
return 0;
}          
Comments: