Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- #include<conio.h>
- #include<graphics.h>
- void bound(int x,int y,int fillcolor,int bcolor){
- int color=getpixel(x,y);
- if(color!=fillcolor && color != bcolor){
- putpixel(x,y,fillcolor);
- bound(x+1,y,fillcolor,bcolor);
- bound(x-1,y,fillcolor,bcolor);
- bound(x,y-1,fillcolor,bcolor);
- bound(x,y+1,fillcolor,bcolor);
- }
- }
- void main(){
- clrscr();
- int gd=DETECT,gm;
- initgraph(&gd,&gm,"C:\\TC\\bgi");
- line(300,300,350,300);
- line(300,300,300,350);
- line(300,350,350,350);
- line(350,300,350,350);
- bound(310,310,MAGENTA,BLUE);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement