Advertisement
jayblankthethird

Rock, Paper, Scissors

Jan 18th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <time.h>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8.  
  9.  
  10. int main() {
  11.    
  12.     char ch;
  13.    
  14.    
  15.     int win = 0;
  16.     int tie = 0;
  17.     int lose = 0;
  18.    
  19.    
  20.     do {
  21.         int choice;
  22.  
  23.  
  24.         cout << "Welcome to the game, by which there are no rules" << endl;
  25.         cout << "        Lets play Rock, Paper, Scissors!        " << endl;
  26.  
  27.  
  28.  
  29.         cout << "Rock ('1'), Paper ('2'), Scissors ('3'):" << endl;
  30.         cin >> choice;
  31.  
  32.  
  33.  
  34.         int ai = rand() % 3 + 1;
  35.         cout << "The computer chose: " << ai << endl;
  36.  
  37.  
  38.         if (choice == 1 && ai == 1)
  39.         {
  40.             cout << "You done playing with your balls? Both Rocks, tie." << endl;
  41.             tie++;
  42.         }
  43.  
  44.         else if (choice == 1 && ai == 2)
  45.         {
  46.             cout << "You let the guy beat you with paper? Pathetic; you lose." << endl;
  47.             lose++;
  48.         }
  49.  
  50.         else if (choice == 1 && ai == 3)
  51.         {
  52.             cout << "Congrats, you almost literally fisted the compitition, you win." << endl;
  53.             win++;
  54.         }
  55.  
  56.         else if (choice == 2 && ai == 1)
  57.         {
  58.             cout << "Paper sucks. You got lucky. You won." << endl;
  59.             win++;
  60.         }
  61.  
  62.         else if (choice == 2 && ai == 2)
  63.         {
  64.             cout << "Both you got a bunch of stupid fingers pointing out, geniuses. Tie." << endl;
  65.             tie++;
  66.         }
  67.  
  68.         else if (choice == 2 && ai == 3)
  69.         {
  70.             cout << "Paper? What kind of loser chooses paper? You. You lose. Again. Probably..." << endl;
  71.             lose++;
  72.         }
  73.  
  74.         else if (choice == 3 && ai == 1)
  75.         {
  76.             cout << "You couldn't pick something other than Scissors? You lose this round." << endl;
  77.             lose++;
  78.         }
  79.  
  80.         else if (choice == 3 && ai == 2)
  81.         {
  82.             cout << "Paper was a bad choice on AI's part, I suppose you win." << endl;
  83.             win++;
  84.         }
  85.  
  86.         else if (choice == 3 && ai == 3)
  87.         {
  88.             cout << "Simplistic 'Live long and Prosper' for all, a tie." << endl;
  89.             tie++;
  90.         }
  91.  
  92.         else if (ch != 'y' || 'Y' || 'n' || 'N')
  93.         {
  94.             cout << "Stop doing dumb shit, man.";
  95.         }
  96.  
  97.  
  98.         else
  99.         {
  100.             cout << "You didn't select a valid option, dude." << endl;
  101.             cout << "what's wrong with you?" << endl;
  102.         }
  103.  
  104.         cout << "Wins: " << win << endl;
  105.         cout << "Ties:" << tie << endl;
  106.         cout << "Losses:" << lose << endl;
  107.         cout << "Would you like to play again? Y/N" << endl;
  108.         cin >> ch;
  109.  
  110.  
  111.     }
  112.  
  113.  
  114.        
  115.         while (ch == 'Y' || ch == 'y');
  116.         system("CLS");
  117.    
  118.         return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement