#include #include #include #include #include using namespace std; int main() { int a,c,d,xtop,ytop,ymar,estekak,ykhat,e; a=0; e=0; estekak=30; int b; ymar=10; b=30; c=0; xtop=500; ytop=300; initwindow(1000,900); while(!kbhit()) { if(ytop==200) { a=0; ymar=10; } if((ytop==510)&&(a==0)) { a=1; } if((ytop==(300-ymar))&&(a==1)) { ymar=ymar-estekak; a=0; } if((a==1)&&(ymar<500)) { ytop=ytop-2; } if(a==0) { ytop=ytop+2; } if(((a==0)&&(c%4==0))&&(b!=1)) { b--; } if((a==1)&&(c%5==0)) { b++; } c++; circle(xtop,ytop,40); line(0,550,800,550); if(e%60==0) // to run once in 60 times { ykhat=ymar; } // adam: settextstyle(3,3,3); outtextxy(300,40,"BY: ARMAN J."); outtextxy(700,80,"Factorhaye taghir konande: sor,at ; ertefa ; daste mard"); rectangle(800,100,900,200); rectangle(860,125,880,140); rectangle(820,125,840,140); line(830,190,870,190); line(850,200,850,310); line(850,240,950,300); line(850,310,900,370); line(850,310,800,370); line(830,170,830,190); line(870,170,870,190); line(850,240,600,(300-ykhat)-40); line(300,(300-ykhat)-40,700,(300-ykhat)-40); e++; Sleep(b); cleardevice(); } getch(); return 0; }