Frooster

Smiley :)

May 17th, 2015
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. /*This programme is done using graphics.h and is exclusively done using turbo c++ ide
  2.  
  3. this is the code for the 1st output seen in the page
  4.  
  5. working :
  6. for loop is used for animation of movement of the circle and the ellipse
  7.  
  8. ellipse function used for eyes and circle for head as well as eye balls
  9.  
  10. arc function used for displaying the mouth of the smiley
  11.  
  12. delay function used for decreasing the speed of simulation of the animated drawing  
  13.  
  14. */
  15. #include<conio.h>
  16. #include<graphics.h>
  17. #include<stdio.h>
  18. #include<stdlib.h>
  19. #include<dos.h>
  20. void main()
  21. {
  22.   int gdriver=DETECT,gmode;
  23.  
  24.   initgraph(&gdriver,&gmode,"C:\\TC\\bgi");
  25.  
  26. /*  setcolor(YELLOW);
  27.   for(int i=1;i<=200;i++)//for right triangle 3d effect
  28.   {
  29.      line(i,300,200,i);
  30.      delay(10);
  31.      }*/
  32.     // setcolor(RED);
  33.   for(int i=1;i<=360;i++)
  34. {
  35.  
  36.  arc(400,250,0,i,210);//THE FACE MAIN PART
  37.  
  38. setcolor(CYAN);
  39.  ellipse(300,200,0,i,100,40);
  40.  
  41.  
  42.  
  43.     circle(300,200,30);//THE FIRST EYE
  44.  
  45.      ellipse(500,200,0,i,100,40);//THE SECOND EYE ELLIPSE 2
  46.     setcolor(CYAN);
  47.      setcolor(CYAN);
  48.     circle(500,200,30);//THE SECOND EYE
  49.     arc(400,300,180,360,100); //THE MOUTH
  50.  
  51.  
  52.      delay(10);
  53.  
  54.      }
  55.      getch();
  56.      closegraph();
  57.      }
Advertisement
Add Comment
Please, Sign In to add comment