I want to write elevator program. Can you help me. Please...

#include <iostream>
#include <windows.h>

using namespace std;

int main(void){
    bool updown = false;
    while(1){
        if(!updown){
            for(int x = 0; x < 100; x++){
                for(int y = 0; y < x; y++)
                    cout << endl;
             cout << "      .---.      "<< endl;
             cout << "     /__\\__\\     "<< endl;
             cout << ".---------------."<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "'---------------'"<< endl;
             Sleep(10);
             system("cls");
            }
            updown = !updown;
        }else{
            for(int x = 100; x > 0; x--){
                for(int y = 0; y < x; y++)
                    cout << endl;
             cout << "      .---.      "<< endl;
             cout << "     /__\__\     "<< endl;
             cout << ".---------------."<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "||      |      ||"<< endl;
             cout << "'---------------'"<< endl;
             Sleep(10);
             system("cls");
            }
            updown = !updown;
        }
    }
    return 0;
}

It's a bit broken but I'm sure you can fix it!


ASCII ARt: http://www.geocities.com/SoHo/7373/electro.htm#elevator

Chris

Comments
:) Nice

Attached is an exe file written in C# and works on .net platform. Exercise it and if you like it get in touch with me at [email removed]

where is the source?

Comments
It should be here - http://www.daniweb.com/forums/thread244695.html if you want to learn that is. As it stands, you're a sponge.
This article has been dead for over six months. Start a new discussion instead.