Advertisement
Guest User

textgame1

a guest
Apr 18th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     for (;;)
  10.     {
  11.  
  12.         /*these are the variables for use later*/
  13.         int Health = 100, Damage = 100;
  14.  
  15.  
  16.         //intro
  17.  
  18.        
  19.         cout << "Welcome fella, this is the world of bacon, what is your name? " << endl;
  20.         string YourName;
  21.         cin >> YourName;
  22.  
  23.  
  24.         cout << "Are you sure that your name is: " << endl;
  25.         cout << YourName << "? " << "Type Yes or No" << endl;
  26.         string NameTrue;
  27.         cin >> NameTrue;
  28.  
  29.         if (NameTrue == "No")
  30.             continue;
  31.  
  32.         cout << "Allright then " << YourName << " Let's Begin your adventure! " << endl;
  33.         cin.get();
  34.         cin.get();
  35.         cout << "This is the world of Bacon " << YourName << " This is the center of the universe, and we are, leading the biggest crystal mines in this world." << endl;
  36.         cin.get();
  37.        
  38.         cout << "Well before i continue, what is your age: " << endl;
  39.         int AgeNumber = 0;
  40.         cin >> AgeNumber;
  41.  
  42.         cin.get();
  43.        
  44.  
  45.  
  46.         cout << "Let me continue, i am Sir Nubshsshshshslola, and i am the leader of bacon." << endl;
  47.  
  48.         cout << "Your objective is to answer these questions correctly, but if you wont, you will loose your health..." << endl;
  49.  
  50.         cin.get();
  51.        
  52.  
  53.             cout << "You have 100 health, if you loose everything, you have lost the game." << endl;
  54.         cout << "Good Luck " << YourName << endl;
  55.  
  56.         cout << "Now " << YourName << " You will get some questions: " << endl;
  57.        
  58.         //questions and functions
  59.        
  60.         string Answer = "yes";
  61.         string Response;
  62.         cout << "1. Am i a boy?(yes or no) " << endl;
  63.         cin >> Response;
  64.         if (Response == Answer)
  65.             cout << "Yey Its correct! Let's Continue! " << endl;
  66.        
  67.         else
  68.         {
  69.             cout << "You dumb person! You are wrong, you lost died health" << endl;
  70.             cout << " Health(100) " << " - " << " Damage(100) " << " = " << Health - Damage << endl;
  71.             string Die = "yes";
  72.             string DieAnswer;
  73.             cout << "Want to restart the game? " << endl;
  74.             cin >> DieAnswer;
  75.             if (DieAnswer == Die)
  76.                 continue;
  77.        
  78.             else
  79.             {
  80.                 cout << "whatever sir, goodbye !" << endl;
  81.                 break;
  82.             }
  83.            
  84.            
  85.         }
  86.        
  87.        
  88.  
  89.        
  90.         string Answer1 = "integer";
  91.         string Response1;
  92.         cout << "2. What does int stand for? " << endl;
  93.         cin >> Response1;
  94.         if (Response1 == Answer1)
  95.             cout << "Yey Its correct! Let's Continue! " << endl;
  96.        
  97.         else
  98.         {
  99.             cout << "You dumb person! You are wrong, you lost died health" << endl;
  100.             cout << " Health(100) " << " - " << " Damage(100) " << " = " << Health - Damage << endl;
  101.             string Die = "yes";
  102.             string DieAnswer;
  103.             cout << "Want to restart the game? " << endl;
  104.             cin >> DieAnswer;
  105.             if (DieAnswer == Die)
  106.                 continue;
  107.  
  108.             else
  109.             {
  110.                 cout << "whatever sir, goodbye !" << endl;
  111.                 break;
  112.             }
  113.  
  114.  
  115.         }
  116.  
  117.        
  118.        
  119.         string Answer2 = "bacon";
  120.         string Response2;
  121.         cout << "3. What is my favorite food? " << endl;
  122.         cin >> Response2;
  123.         if (Response2 == Answer2)
  124.             cout << "Yey Its correct! Let's Continue! " << endl;
  125.        
  126.         else
  127.         {
  128.             cout << "You dumb person! You are wrong, you lost died health" << endl;
  129.             cout << " Health(100) " << " - " << " Damage(100) " << " = " << Health - Damage << endl;
  130.             string Die = "yes";
  131.             string DieAnswer;
  132.             cout << "Want to restart the game? " << endl;
  133.             cin >> DieAnswer;
  134.             if (DieAnswer == Die)
  135.                 continue;
  136.  
  137.             else
  138.             {
  139.                 cout << "whatever sir, goodbye !" << endl;
  140.                 break;
  141.             }
  142.  
  143.         }
  144.  
  145.            
  146.            
  147.             string Answer3 = "yes";
  148.             string Response3;
  149.             cout << "Do you like bacon? " << endl;
  150.             cin >> Response3;
  151.             if (Response3 == Answer3)
  152.                 cout << "Yey Its correct! Let's Continue! " << endl;
  153.             else
  154.             {
  155.                 cout << "You dumb person! You are wrong, you died ! " << endl;
  156.                 cout << " Health(100) " << " - " << " Damage(100) " << " = " << Health - Damage << endl;
  157.                 string Die = "yes";
  158.                 string DieAnswer;
  159.                 cout << "Want to restart the game? " << endl;
  160.                 cin >> DieAnswer;
  161.                 if (DieAnswer == Die)
  162.                     continue;
  163.  
  164.                 else
  165.                 {
  166.                     cout << "whatever sir, goodbye !" << endl;
  167.                     break;
  168.                 }
  169.             }
  170.  
  171.  
  172.                
  173.                 string Answer4 = "Norway";
  174.                 string Response4;
  175.                 cout << "Now.. Your Last Question, if you answer correctly,  you have won the game! " << endl;
  176.                 cin.get();
  177.                 cin.get();
  178.                 cout << "What is my location?" << endl;
  179.                 cin >> Response4;
  180.                 if (Response4 == Answer4)
  181.                     cout << "Congratulations, you freaking won the game! " << endl;
  182.                 else
  183.                 {
  184.                     cout << "You dumb person! You are wrong, you lost died health" << endl;
  185.                     cout << " Health(100) " << " - " << " Damage(100) " << " = " << Health - Damage << endl;
  186.                     string Die = "yes";
  187.                     string DieAnswer;
  188.                     cout << "Want to restart the game? " << endl;
  189.                     cin >> DieAnswer;
  190.                     if (DieAnswer == Die)
  191.                         continue;
  192.  
  193.                     else
  194.                     {
  195.                         cout << "whatever sir, goodbye !" << endl;
  196.                         break;
  197.                     }
  198.  
  199.  
  200.                 }
  201.                
  202.                 cin.get();
  203.                 cin.get();
  204.                
  205.                 string GameRestart = "yes";
  206.                 string RestartAnswer;
  207.                 cout << "Congratulations again sir, you won this." << endl;
  208.  
  209.                 cin.get();
  210.                
  211.                 cout << "Want to restart the game?" << endl;
  212.                 cin >> RestartAnswer;
  213.                 if (RestartAnswer == GameRestart)
  214.                     continue;
  215.  
  216.                 else
  217.                 {
  218.                     cout << "Allright then, goodbye! Thanks for playing. " << endl;
  219.                     break;
  220.                 }
  221.            
  222.        
  223.         cin.get();
  224.         cin.get();
  225.  
  226.         return 0;
  227.     }
  228.  
  229.     cout << "Press Any Key to quit ;)" << endl;
  230.     cin.get();
  231.     cin.get();
  232.     return 0;
  233.  
  234. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement