munin
+ Reply to Thread
Results 1 to 5 of 5

Thread: C++ Program help

  1. #1
    minaadel1994 Guest

    Lightbulb C++ Program help

    Hi im kinda of a newbie in C++ but i need help... i have made a calculator and inside it a matrix effect... ex: press * for calc , press 2 for matrix... thats the output! ive made a loop for the calc and it works perfectly fine! but in the matrix i have a prob... i cant close it once opened i want a function to return me back to the main page when i press any key.. (tryed system("PAUSE") but it messed up my code ) heres the Code:

    Code:
    #include<iostream>
    #include<math.h>
    #include<conio.h>
    #include<string>
    #include<windows.h>
    #include<ctime>
    using namespace std;
    void full()
    {
        keybd_event(VK_MENU,0x*8,0,0);
        keybd_event(VK_RETURN,0x*c,0,0);
        keybd_event(VK_RETURN,0x*c,KEYEVENTF_KEYUP,0);
        keybd_event(VK_MENU,0x*8,KEYEVENTF_KEYUP,0);
    }
    void randChar()    //randChar function
    {
               char symbol = rand()%*26+**;
               cout<<symbol<<"\b";}
               void randCharEnd()
               {
                         char symbol = rand()%*26+**;
                         cout<<symbol;}
                         int spaceMaker(int a)
                         {
                              for(int i =0; i<=a; i++)
                              cout<<" ";}int timeWaster (int a)
                              {
                                   a = a * *0;
                                   for(int i=0; i<= a; i++)
                                   cout<<" \b";
    }
    
    
    
    void matrix()//matrix function
    {
         system("COLOR 0A");
         srand((unsigned)time(NULL));
         int lineFeedCtr =0;
         int charCtr;    int clearCtr = 0;    char randChar2;    int ctr;    int spaceCtr = 0;            cout<<"M";    timeWaster(200);    cout<<"I";    timeWaster(200);    cout<<"N";    timeWaster(200);    cout<<"A";    timeWaster(200);    cout<<"'";    timeWaster(200);        cout<<"S ";    timeWaster(200);    cout<<"C";    timeWaster(200);    cout<<"R";    timeWaster(200);        cout<<"E";    timeWaster(200);    cout<<"A";    timeWaster(200);    cout<<"T";    timeWaster(200);    cout<<"I";    timeWaster(200);    cout<<"O";    timeWaster(200);    cout<<"N ";    timeWaster(*00);        cout<<".";    timeWaster(200);    cout<<"..";    timeWaster(200);    cout<<"..";    timeWaster(200);  cout<<"."; timeWaster(200);
    
    cout<<".";    timeWaster(*00);    cout<<".";    timeWaster(*00);     cout<<".";
    timeWaster(*00);    cout<<".\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";    timeWaster(*200);  randChar();  randChar();    randChar();    randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();    randChar();    randCharEnd();    timeWaster(200);        randChar();    randChar();    randChar();    randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();    randCharEnd();    timeWaster(*75);        randChar();    randChar();    randChar();    randChar();  randChar(); randChar(); randChar();      randChar();       randChar();       randChar();       randChar();       randChar();       randChar();    randCharEnd(); randCharEnd();    timeWaster(*50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();      randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();       randChar();     timeWaster(*25);        randChar();    randChar();    randChar();       randChar();       randChar();       randChar();       randChar();       randChar();    randChar();    randCharEnd();    timeWaster(*20);          randChar();       randChar();       randChar();       randChar();       randChar();       randChar();     randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(**0);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(*00);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(*0);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(80);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(70);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(60);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);        randChar();    randChar();    randChar();    randChar();    randCharEnd();    timeWaster(50);    randChar();    randChar();    randChar();    randChar(); randChar(); randChar();   randChar(); randChar(); randChar(); randChar(); randChar(); randChar(); randChar(); randChar(); randChar(); randChar(); randChar();  randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();randChar();  randCharEnd();    timeWaster(50);     while(***7>0)    {       ctr = 0;       charCtr = rand()%*0+5;       spaceCtr = rand()%75;
    
    if(clearCtr>=280)         {
    
    clearCtr = 0;           }
    while(ctr <= charCtr)
    
    {
    
    spaceMaker(spaceCtr);
    
    ctr++;
    
    
    randChar2 = static_cast<char>(rand()%*26+**);
    
    
    cout<<randChar2<<endl;
    
    clearCtr++;
    for(int b=0; b<=200;b++)
    cout<<" \b";
    }
     }
    }
    
    
    double calculator()
    {
        double x;
        double y;
        char cChar;
        cin>>x>>cChar>>y;
        cin.ignore();
        switch (cChar)
        {
            case '+':
            cout<<"The Answer is: "<< x << " + " << y << " = " <<(x + y) <<endl;
            break;
            case '-':
            cout<<"The Answer is: "<< x << " - " << y << " = " <<(x - y) <<endl;
            break;
            case '/':
            cout<<"The Answer is: "<< x << " / " << y << " = " <<(x / y) <<endl;
            break;
            case '*':
            cout<<"The Answer is: "<< x << " * " << y << " = " <<(x * y) <<endl;
            break;
            case '%':
            cout<<"The Answer is: "<< x << " % " << y << " = " <<(y/*00 *x) <<endl;
            break;
            case '^':
            cout<<"The Answer is: "<< x << " ^ " << y << " = " <<pow(x , y) <<endl;
            break;
        }
    }
    
    int main()
    {
        full();
        char doa;
        char answer;
        do{
        system("CLS");
        system("TITLE Mina's Calculator 2");
        system("COLOR *");
        cout<<"   *) To Calculate Use These Signs : \n       (+,-,*,/,^,%)  \n    \n   2) To Exit   \n\n   *) To Do The Matrix Effect...  \n"<<endl;
        timeWaster(200);timeWaster(*00);cout<<"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"<<endl;
        cin>>answer;
        if (answer=='*')
        {
            cout<<"    ****  U choose calculator... ****\n"<<endl;
            calculator();
        }
        else if (answer=='2')
        {
            Sleep (*);
            timeWaster(250);cout<<"      ***   Exiting in *  ***"<<endl;
            Sleep (2);
            timeWaster(500);cout<<"      ***          2      ***"<<endl;
            Sleep (*);
            timeWaster(500);cout<<"      ***          *      ***"<<endl;
            timeWaster (*00);
            cin.get();
            return 0;
        }
        if (answer=='*')
        {
            cout<<"     ****  U choose the Matrix Effect **** "<<endl;
            matrix();
        }
    
        cout<<"would u like to restart? y or n? "<<endl;
        cin>>doa;
        cin.ignore();
        }while (doa=='y' ||doa=='Y');
        if (doa=='n' || doa=='N')
        {
            cout<<"         *** Thanks for using my calculator ***      "<<endl;
        }
    
        cin.get();
       return 0;
    }
    The output is a full screen console app.. so i need a function to close the matrix when i press any key (or a specific key would be better)...
    add this function to my code and repost it plz , thanks in advance
    Last edited by minaadel1994; 11-03-2008 at 02:00 PM. Reason: miss-spelling

  2. #2
    minaadel1994 Guest

    lil help!

    GUYS a lil help would be appreciated...

  3. #3
    Join Date
    Sep 2006
    Posts
    1,649
    I don't really know much C++.
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  4. #4
    minaadel1994 Guest

    Clusterfucked

    wot does clusterfucked mean.... and my code is fine! but long thats all :P!

  5. #5
    minaadel1994 Guest

    i found the answer to my first question

    The answer to my question is i wanted an exit function in the matrix ... well there it is :
    Code:
    void esc()
    {
    if (GetAsyncKeyState(VK_ESCAPE))
    {
    return 0;
    }
    }

+ Reply to Thread

Similar Threads

  1. Need a program
    By Goem in forum Programming
    Replies: 2
    Last Post: 04-08-2008, 09:43 PM
  2. Crack this program :D
    By gojuphace in forum Security & Encryption
    Replies: 3
    Last Post: 12-28-2007, 09:12 PM
  3. Program Too Big To Post
    By JayT in forum Programming
    Replies: 8
    Last Post: 09-25-2007, 03:29 AM
  4. My Very First Program!
    By SyntaXmasteR in forum Programming
    Replies: 12
    Last Post: 09-16-2007, 04:47 AM
  5. Help me to take a keylogger on a program or something
    By Blindspit in forum Security & Encryption
    Replies: 7
    Last Post: 02-16-2006, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts