Advertisement
zoro-10

2B. Draw a simple hut on the screen

Apr 1st, 2024
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include<graphics.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int gd=DETECT,gm;
  6. initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
  7.  /* Draw Hut */
  8. setcolor(WHITE);
  9. rectangle(150,180,250,300);
  10. rectangle(250,180,420,300);
  11. rectangle(180,250,220,300);
  12. line(200,100,150,180);
  13. line(200,100,250,180);
  14. line(200,100,370,100);
  15. line(370,100,420,180);
  16. /* Fill colours */
  17. setfillstyle(SOLID_FILL, BROWN);
  18. floodfill(152, 182, WHITE);
  19. floodfill(252, 182, WHITE);
  20. setfillstyle(SLASH_FILL, BLUE);
  21. floodfill(182, 252, WHITE);
  22. setfillstyle(HATCH_FILL, GREEN);
  23. floodfill(200, 105, WHITE);
  24. floodfill(210, 105, WHITE);
  25. getch();
  26. closegraph();
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement