1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
#include <cstdlib>
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
char play, PLAY, CorrectUser[100], Play, ans, user[100];
int iD, iD2;
string Ans, Ans2, Ans3, Ans4, Ans5, AnsX;
int main()
{
//Begining of the Chaos
cout<< "ChAoS ReIgN \tV0.99 \tTHE ANSW7R LIES W7THIN" << "\n"
<< "Please type in username to receive custom serial or Identify Yourself" << "\n"; //Username Insert point
cin >> user; //Username Input point
cout<< "If " << user << " is your username please Input 1 and press enter." << "\n" //Username Display
<< "If this is not your username please Input 0 and press enter." << "\n";
cin >> iD; //Begining of Question-Is Input Correct?
if(iD==1)goto Correct;
else if(iD==0)goto Wrong;
else if(iD==77)
{
cout<< "\nNothing is as it seems," << "\n"
<< "Believe no one, Trust no one." << "\n"
<< "What is 'Life'?" << "\n"
<< "The answer lies Within the Game...." << "\n";
// As mentioned before, we put the "question" outside the loop
cout<< "\n" << "Before sarcasm, man made due with OPPOSITES...\n"
<< "Sarcasm has become increasingly popular due to figures in society, \n"
<< "The most recent notability being Hugh Laurie. \n"
<< "His WORK being not so much Inspirational as Entertaining. \n"
<< "Yet he still manages to captivate and hold. A True Ambassador for Sarcasm.\n";
// Here is the loop, While Ans IS_NOT_EQUAL_TO "play", do this:
while (Ans != "play") {
cout << "Answer:";
cin >> Ans;
}
// Once Ans IS_EQUAL_TO "play", do this
// as i said before, the loop breaks once the condition is true and falls through to the next thing
cout<< "\n" << "Life, A constant Revolution Through Time.\n"
<< "From dusk till dawn, The light comes out only to hide again.\n"
<< "'For the night is long, wont you come out and play?' \n"
<< "The foolish will walk the alleys and face the consequences.\n";
while(Ans2 != "no") {
cout << "Answer:";
cin >> Ans2;
}
cout<< "\n" << "106BC-43BC.\n"
<< "In times of war, The law falls silent.\n"
<< "Lots said is mis-understood, So was Cicero.\n"
<< "Inter arma enim silent leges.\n"
<< "Sometimes you musn't look past the actual words.\n";
while(Ans3 != "silent enim leges inter arma") {
getline(cin, Ans3);
}
cout << "Heres where i've reached.";
/*
* Now it falls through and puts out the random number
* and says bye... because of the goto's
* It executes 'Correct', 'Finish' and 'END' with no discresion ...
* Bad stuff ... lol, but I'll let you fix that.
*
* In programming terms, that's what we would call
* "ugly", "evil", and "downright dispicable" code.
* Just so ya know, lol.
*
* If you want it to stop here, then use a return, like:
* return 0; (0 usually means 'successful')
* OR
* return 1; (1 usually means 'not successful')
*
* In this case you would use 'returen 0;'
*/
cout<<"Press any key to exit ...";
getch();
return 0;
}
//If the username is Correct the User lands here.
Correct:
cout <<"\n" << "Your Serial number is:" << rand() << "-" << rand() << "-" << rand() << "-" << rand() << "\n";
goto Finish;
//If the username is Wrong the User lands here.
Wrong:
cout << "Please input correct username," << "\n";
cin >> CorrectUser;
cout<< "Is " << CorrectUser << " correct?" << "\n" //Username Display
<< "Input 1 for yes, 0 for no and Press enter." << "\n";
cin >> iD2; //Begining of Question-Is Input Correct?
if(iD2==1)goto Correct;
else if(iD2!=1)goto Wrong;
//If all goes according to plan then here's the finsh line.
Finish:
cout <<"\n" << "Enjoy The Random Number :D";
goto END;
END:
cout << "\nBye";
cout <<"\n";
_getch(); /****** What is the underscore ( _ ) for?? *******/
return 0;
}
// I'll let you fix the goto's, but it should work now.
/*
* Also, you might consider re-doing all the variables...
* You can re-use the same one over and over, as long as it's the same type.
* For example, you can use 'ans' for all the cin's where you have 'Ans', 'ans', 'Ans1', 'Ans2', etc...
* But if you want to input to an int or a char then you have to use a different var.
*/
// Oh by the way, You wanna see something cool? Run the program and
// when it asks if you put in the correct name, type a letter instead of a number.
// LoL!
/* That's why i suggest you replace the int with a string... you can do:
. . .
string iD;
. . .
if (iD == 'y') goto Correct;
if (iD == 'n') goto Wrong;
Or you can do:
while (iD != 'y') {
ask for correct answer;
}
give out a not-so-random number; (it gives me the same number every time lol)
getch();
return 0;
*/
|