C++ program to show animated dancing dolls in graphics

#include<dos.h>
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
class doll
{
     public:
void dolldraw(int x)
{
int y=100;
circle(x,y+10,10);
line(x,y+20,x,y+100);
line(x,y+40,x-20,y+70);
line(x,y+40,x+20,y+70);
line(x,y+100,x-20,y+120);
line(x,y+100,x+20,y+120);
}
void dollmoll(int x)
{
int y=100;
circle(x,y+10,10);
line(x,y+20,x,y+100);
line(x,y+50,x-20,y+30);
line(x,y+50,x+20,y+30);
line(x,y+100,x-20,y+90);
line(x,y+100,x+20,y+90);
}

};
void main()
{
doll a,b,c,d,e;
int h,i,j,k;
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
int w=50;
while(!kbhit())
{
a.dolldraw(w);
h=w+45;
b.dolldraw(h);
j=h+45;
c.dolldraw(j);
i=j+45;
d.dolldraw(i);
k=i+45;
e.dolldraw(k);
delay(500);
cleardevice();
w=150;
a.dollmoll(w);
b.dollmoll(h);
c.dollmoll(i);
d.dollmoll(j);
e.dollmoll(k);
delay(500);
cleardevice();
}
getch();
closegraph();
}


12 comments:

  1. Moana Dolls
    Moana Toys .com is your one stop look for all data in regards to the hit motion picture Moana, and connections to various stock and items identified with the film.

    ReplyDelete
  2. Cheapest Smart TV
    Keen TV's are turning out to be increasingly basic in the market today yet what amount do you truly think about them… A Smart TV is basically a TV box that is worked to be associated with the web and is a PC essentially concentrated for excitement purposes.  They arrive in a scope of sizes ranging&hellip

    ReplyDelete
  3. This program compile fully no error but it doesn't give any output
    Why?

    ReplyDelete
    Replies
    1. Change the directory in the initgraph function to "C:\\TURBOC3\\BGI" or appropriate directory as per your installation.

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Excellent work.Thanks a lot.❤️⚡👍

    ReplyDelete
  6. Can I get the out put for this

    ReplyDelete
  7. Can any one explain the code??

    ReplyDelete
  8. Close group should have a prototype, error

    ReplyDelete
  9. it doesnt run! why is that, it says it doesnt open iostream.h, why

    ReplyDelete
  10. Void dollmoll
    Circle (x,y+10,10);
    Undefined symbol , x, error

    ReplyDelete