Post: [C++] Mystery Login Game.
02-26-2011, 09:55 PM #1
Girby2K11
☮ ☯ ☢ ✔ ➝
(adsbygoogle = window.adsbygoogle || []).push({}); guys. i don't know if that title fits in with this game i made. but basically. theres a secret user. you must enter his details.

but you wont know it so you have to write guest in either username or password. and you will be granted access to this terminal that asks you questions and gives you the username and password, once logged into the database you have to find one more question. then... well find out for yourself.

heres the code for the game but where you see *ENTER* that is where you put your own stuff.

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

using namespace std;

void Ryan();
void credits();

void curtis()
{

string codes = "*NAME*";
string userCode;
int countdown = 0;

cout << "Hello *NAME*, Have you got the illegal document's code yet? Enter the code. \n\n";

code:

cout << "%DATA%: ";
cin >> userCode;

if (userCode == codes)
{
cout << "Access Granted, Launching Vehktainian Nuclear Missile \nTowards United States America.";
do
{
cout << " .";
_sleep(1000);
++countdown;
continue;
} while (countdown < 10);

while (countdown == 10)
{
cout << "\n\nMission Successful!\n\n";
cout << "*RADIOIN* Well done *NAME*, We have won. the US has been nuked... You're a Hero.\n\n\n\n";
credits();
++countdown;
exit(1);

}

}


else
{
cout << "\n\n*NAME* You have entered the wrong code - \nEnter the right code before its two late!\n\n";
goto code;
}
}

void guest()
{
string atomic;
int countdown = 0;

cout << "To find the account, we have to play a mind game.";
cout << "\n\nWhat is the top secret military base in the United States? \nyou have 5 guesses. No Space's e.g killerguy not killer guy.\n\n";

area51:

cout << "Guess: ";

cin >> atomic;

if (countdown == 4)
{
cout << "\n\nYou have ran out of guesses. \ncomeback when you have found the answer.\n\n";
exit(1);
}


if (atomic == "*NAME*")
{
cout << "\n\n*************************************************************\n\nYou have entered the correct answer. the account ID is NAME**. Write it down.\n\n";
*NAME*();
}

else
{
++countdown;
cout << "Sorry Wrong answer - Try Again\n";
goto area51;

}


}


int main()
{

string username;
string password;

tAgain:

cout << "Username: ";
cin >> username;

cout << "Passord: ";
cin >> password;
cout << "\n\n";

if (username == "*NAME*" && password == "*NAME*")
{
cout << "Access Granted, Welcome *NAME*.\n\n";
curtis();

}


if (username == "guest" || password == "guest")
{
cout << "Welcome Guest. I Guess you are here to find the account and crack the the code.\n\n";
guest();
}

else
{
cout << "Login Failed, Try Again\n\n";
goto tAgain;
}



cout << "Now that you have *NAME* Login Info, \nyou can proceed to crack the code and launch the nuke.\n\n\n\n";
goto tAgain;

}


void NAME**()
{
cout << "So know that you know the account ID is '*NAME*' we need the password, \n";
cout << "looks like another mind game. Joy oh Joy.\n\n";

string future = "*NAME*";
string guess;
int gLeft = 0;

cout << "This time it is a riddle. You have 5 guesses.\n\n";
cout << "I am always in front of you but can never be seen. \nThink of tomorrow and you will know what I mean. What am I?\n\n";

tryagain:

cout << "Guess: ";
cin >> guess;

if (gLeft == 4)
{
cout << "You have ran out of guesses, come back when you have found the answer.\n\n";
exit(1);
}

if (guess == "*NAME*")
{
cout << "Well done, you have figured out the answer. \nso you deserve the password as promised.\n\n";
cout << "The password is *NAME*.\n";
}

else if (guess != ""*NAME*)
{
cout << "Nope\n";
++gLeft;
goto tryagain;
}
}

void credits()
{
cout << "\n\n*****CREDITS*****\n\n\n\n";
_sleep(1000);
cout << "This Game was made entirely from *NAME*.\n";
cout << "Thanks for playing. Smile\n\n";
}
02-26-2011, 09:57 PM #2
Originally posted by Girby2K11 View Post
guys. i don't know if that title fits in with this game i made. but basically. theres a secret user. you must enter his details.

but you wont know it so you have to write guest in either username or password. and you will be granted access to this terminal that asks you questions and gives you the username and password, once logged into the database you have to find one more question. then... well find out for yourself.

heres the code for the game but where you see *ENTER* that is where you put your own stuff.

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

using namespace std;

void Ryan();
void credits();

void curtis()
{

string codes = "*NAME*";
string userCode;
int countdown = 0;

cout << "Hello *NAME*, Have you got the illegal document's code yet? Enter the code. \n\n";

code:

cout << "%DATA%: ";
cin >> userCode;

if (userCode == codes)
{
cout << "Access Granted, Launching Vehktainian Nuclear Missile \nTowards United States America.";
do
{
cout << " .";
_sleep(1000);
++countdown;
continue;
} while (countdown < 10);

while (countdown == 10)
{
cout << "\n\nMission Successful!\n\n";
cout << "*RADIOIN* Well done *NAME*, We have won. the US has been nuked... You're a Hero.\n\n\n\n";
credits();
++countdown;
exit(1);

}

}


else
{
cout << "\n\n*NAME* You have entered the wrong code - \nEnter the right code before its two late!\n\n";
goto code;
}
}

void guest()
{
string atomic;
int countdown = 0;

cout << "To find the account, we have to play a mind game.";
cout << "\n\nWhat is the top secret military base in the United States? \nyou have 5 guesses. No Space's e.g killerguy not killer guy.\n\n";

area51:

cout << "Guess: ";

cin >> atomic;

if (countdown == 4)
{
cout << "\n\nYou have ran out of guesses. \ncomeback when you have found the answer.\n\n";
exit(1);
}


if (atomic == "*NAME*")
{
cout << "\n\n*************************************************************\n\nYou have entered the correct answer. the account ID is NAME**. Write it down.\n\n";
*NAME*();
}

else
{
++countdown;
cout << "Sorry Wrong answer - Try Again\n";
goto area51;

}


}


int main()
{

string username;
string password;

tAgain:

cout << "Username: ";
cin >> username;

cout << "Passord: ";
cin >> password;
cout << "\n\n";

if (username == "*NAME*" && password == "*NAME*")
{
cout << "Access Granted, Welcome *NAME*.\n\n";
curtis();

}


if (username == "guest" || password == "guest")
{
cout << "Welcome Guest. I Guess you are here to find the account and crack the the code.\n\n";
guest();
}

else
{
cout << "Login Failed, Try Again\n\n";
goto tAgain;
}



cout << "Now that you have *NAME* Login Info, \nyou can proceed to crack the code and launch the nuke.\n\n\n\n";
goto tAgain;

}


void NAME**()
{
cout << "So know that you know the account ID is '*NAME*' we need the password, \n";
cout << "looks like another mind game. Joy oh Joy.\n\n";

string future = "*NAME*";
string guess;
int gLeft = 0;

cout << "This time it is a riddle. You have 5 guesses.\n\n";
cout << "I am always in front of you but can never be seen. \nThink of tomorrow and you will know what I mean. What am I?\n\n";

tryagain:

cout << "Guess: ";
cin >> guess;

if (gLeft == 4)
{
cout << "You have ran out of guesses, come back when you have found the answer.\n\n";
exit(1);
}

if (guess == "*NAME*")
{
cout << "Well done, you have figured out the answer. \nso you deserve the password as promised.\n\n";
cout << "The password is *NAME*.\n";
}

else if (guess != ""*NAME*)
{
cout << "Nope\n";
++gLeft;
goto tryagain;
}
}

void credits()
{
cout << "\n\n*****CREDITS*****\n\n\n\n";
_sleep(1000);
cout << "This Game was made entirely from *NAME*.\n";
cout << "Thanks for playing. Smile\n\n";
}



AHHHHHHH GOTO!!!!! AHHHHHH AHHHHHHH *self destructs*
02-26-2011, 10:19 PM #3
Girby2K11
☮ ☯ ☢ ✔ ➝
Originally posted by TheUberFail View Post
AHHHHHHH GOTO!!!!! AHHHHHH AHHHHHHH *self destructs*


lol i was remembering what you said about goto's. but i forgot what to use. so i thought goto's!

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo