Advertisement
Shailrshah

Christmas Tree

Oct 30th, 2014
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include <graphics.h>
  2. #include <stdio.h>
  3. #include <conio.h>
  4.  
  5. void startgraphics(){
  6.     int gd = DETECT, gm;
  7.     initgraph(&gd, &gm, "");
  8.     cleardevice();
  9. }
  10.  
  11. void main(){
  12.     startgraphics();
  13.     moveto(320, 50);
  14.  
  15.     linerel(50, 50);
  16.     linerel(-20, 0);
  17.     linerel(20, 50);
  18.     linerel(-20, 0);
  19.     linerel(20, 50);
  20.     linerel(-50, 0);
  21.  
  22.     linerel(0, 40);
  23.     linerel(0, 0);
  24.     linerel(0, -40);
  25.  
  26.     linerel(-50, 0);
  27.     linerel(20, -50);
  28.     linerel(-20, 0);
  29.     linerel(20, -50);
  30.     linerel(-20, 0);
  31.     linerel(50, -50);
  32.  
  33.     setfillstyle(HATCH_FILL, GREEN);
  34.     floodfill(320, 100, 15);
  35.  
  36.  
  37.     getch();
  38.     closegraph();
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement