rodan0818

Graphics Lab 1

Dec 7th, 2019
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <graphics.h>
  4. #include <dos.h>
  5. void main(){
  6. int gd = DETECT,gm ;
  7. initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
  8. //housepart (hp) starts here
  9. line(100,50,30,100);//hp1
  10. line(100,50,400,50);//hp2
  11. line(400,50,330,100);//hp4
  12. line(400,50,470,100);//hp3
  13. line(30,100,470,100);//hp5
  14. line(30,100,30,250);//hp8
  15. rectangle(50,130,70,170);//leftdoor
  16. rectangle(300,130,320,170);//rightdoor
  17. line(30,250,470,250);//hp6
  18. line(330,100,330,250);//hp9
  19. line(470,100,470,250);//hp7
  20. line(130,250,130,170);//hp10
  21. line(180,250,180,170);//hp12
  22. line(130,170,180,170);//hp11
  23. //house ends here
  24. //car part (cp) starts here
  25. line(320,290,570,290);//cp1
  26. line(350,340,610,340);//cp5
  27. line(570,290,610,340);//cp6
  28. line(610,340,630,380);//cp20
  29. line(320,290,350,340);//cp4
  30. line(320,290,300,350);//cp2
  31. line(350,340,330,380);//cp3
  32. line(300,350,330,380);//cp7
  33. line(250,380,630,380);//cp9
  34. line(300,350,220,350);//cp8
  35. line(220,350,250,380);//cp10
  36. line(220,350,220,380);//cp12
  37. line(250,380,250,410);//cp14
  38. line(220,380,250,410);//cp13
  39. line(250,410,400,410);//cp11
  40. circle(425,410,25);//cp15
  41. line(450,410,520,410);//cp16
  42. circle(545,410,25);//cp17
  43. line(570,410,630,410);//cp18
  44. line(630,380,630,410);//cp19
  45. //car ends here
  46. //man starts here
  47. circle(150,300,20);//head
  48. line(150,320,150,370);//body
  49. line(150,370,130,450);//leftleg
  50. line(150,370,170,450);//rightleg
  51. line(150,330,130,370);//lefthand
  52. line(150,330,170,370);//righthand
  53. getch();
  54. closegraph();
  55. }
Add Comment
Please, Sign In to add comment