Raised This Month: $ Target: $400
 0% 

C++ Gaben test [Done]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 02-14-2007 , 21:59   Re: C++ help
Reply With Quote #7

you gotta return 0 back to the calling program so it knows to end.

Code:
//*Britt Jamerson - Gaben, Take or go test! - v1.0*
#include <iostream>
using namespace std;   
int main( void )
{
    cout << "\n A code by Britt Jamerson aka Da_sk8rboy--no0bsawce!" 
            "\n+-----------------------------------------------------------------------+"
            "\n| Welcome to the Gaben take or go test!.                                |"
            "\n| Gaben has stolen your computer and it is up to you to get it back.    | "
            "\n| Gaben say's you must pass the Gaben take or go test! ! !              |"
            "\n+-----------------------------------------------------------------------+";
    bool clamsTaken, picklesTaken, killedByGaben;
    cout << "\n\nYou enter the first chamber."
            "\nIt's full of purple clam's, "
            "you cannot believe."
            "\nDo you take the clam's (1=Yes, 0=No)? ";
    cin >> clamsTaken;
    
    if(clamsTaken) 
    {
        cout << "\nYou keep the clams, but you have failed the first test."
                "\nGame 0ver. . .\n\n";

		return 0;
    }
    else 
    {
        cout << "Congratulations, "
                "you have passed the first test!"
                "\n\nYou enter the second chamber."
                " It is full of shining Pickles! ! !"
                "\nDo you take the shining pickles"
                "(1=Yes, 0=No)?";

        cin >> picklesTaken;

        if(picklesTaken) 
        {
            cout << "You take the Shining Pickles, "
                    "but you have failed the second test!"
                    "\nYou've proven you're GREED. . ."
                    "\nGame 0ver. . .\n\n";

			return 0;
        }
        else
        {
            cout << "Congratulations, you have passed the Second test!"
                    "\n\n You enter the Third chamber. "
                    "\n A no0b is being attacked by a MiniGaben!"
                    "\nDo you ignore the no0b & move on (1=Yes, 0=No)?";

            cin >> killedByGaben;
            if(killedByGaben)
            {
                cout << "\nAs you sneak by, the MiniGaben turn's his attenetion "
                        "to you."
                        "\nHe grabs you & eat's you whole with one bite. . ."
                        "You are now dead."
                        "\nGame 0ver. . .\n\n";

				return 0;
            }
            else
            {
                cout << "Congratualations, you"
                        " have passed all three tests!\n\n"
                        "You exit the chamber & "
                        "confront Gaben.\n\n"
                        "He tries to eat you whole "
                        "but you move on.\n"
                        "With one swing of your trout it is over.\n\n"
                        "You and your computer live happily ever after.\n\n"
                        "The End. . .\n\n";
            }
        }         
        system("PAUSE");
    }
    return 0;
}
__________________
It is stupid to be stupid, and stupid to not be stupid
LittleDude is offline
Send a message via AIM to LittleDude
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode