Advertisement
Shailrshah

Flower

Oct 30th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <graphics.h>
  4. #define F 1
  5. void startgraphics(){
  6.     int gd = DETECT, gm;
  7.     initgraph(&gd, &gm, "");
  8.     cleardevice();
  9. }
  10.  
  11. void main(){
  12.     int x = 300, y = 200, r = 40*F, r2=30*F; //Change F to scale
  13.     startgraphics();
  14.  
  15.     setcolor(RED); //middle circle
  16.     circle(x, y, r);
  17.     setfillstyle(HATCH_FILL, YELLOW);
  18.     floodfill(x, y, RED);
  19.  
  20.     setcolor(GREEN); //petals
  21.     arc(x+r, y, 250, 110, r2);
  22.     arc(x-r, y, 65, 295 , r2);
  23.     arc(x, y-r, 340, 200, r2);
  24.     arc(x, y+r, 155, 25, r2);
  25.  
  26.     setcolor(BROWN); //stem
  27.     line(x, y+r+r2, x, y+2*(r+r2));
  28.     getch();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement