Advertisement
Sinux1

Rock, paper, scissor, lizard, spock corrected

Feb 20th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <ctime>
  6.  
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12.         srand(time(NULL));
  13.         int Words[] = {544567129, 543519329, 544698222, 2036427888, 543649385, 1801678674, 1632641068, 745694576, 1768117024, 1919906675, 1277176947, 1918990953, 1394617444, 1801678704, 1701336074, 1819176736, 1634148473, 1752393069, 1998616431, 1701995880, 1953459744, 1735289192, 1952541984, 1936876916, 2003783178, 1919510048, 1948284019, 1914725736, 1936026741, 1393101370, 1936943459, 544436847, 544503139, 1701863792, 1342769778, 1919250529, 1987011360, 544436837, 1801678706, 1867647242, 1663069027, 1752397170, 1814066021, 1918990953, 1275660900, 1918990953, 1869619300, 1852797801, 1884495987, 174809967, 1869632265, 1931504483, 1752392045, 1931506533, 1936943459, 175338095, 1768117001, 1919906675, 1701060723, 1768972643, 1702125940, 1752440947, 1768693861, 1685217658, 1766590730, 1685217658, 1952539936, 1634738291, 175269232, 1885425673, 1679848037, 1919972201, 1936029295, 1869632288, 151677795, 1668247635, 1635131499, 1769107312, 544433530, 1801678706, 1867647242, 1663069027, 1752397170, 1948283749, 1931502952, 1936943459, 175338095, 0};
  14.         int Game[] = {544698190, 1162167628, 1414812741, 1397958484, 1344295763, 173621580, 1869572163, 1629513075, 1836412448, 544367970, 544370534, 1920298873, 1634039584, 980316016, 976292106, 1768117024, 1919906675, 839453299, 1632641082, 175269232, 540685065, 1801678674, 976488714, 2053721120, 174355041, 540685577, 1668247635, 805898859, 544175136, 1953069157, 10};
  15.         int board = 0x59268A;
  16.         cout << (char*)Words;
  17.         int choice, comp;
  18.         while(true)
  19.         {
  20.                 cout << (char*)Game;
  21.                 cin >> choice;
  22.                 if(choice == 0)
  23.                         break;
  24.                 comp = rand() % 5;
  25.                 cout << "\tComputer: " << comp +1 << endl;
  26.                 choice -= 1;
  27.                 if(comp == choice)
  28.                         cout << "You Tied the Computer" << endl;
  29.                 else if(board & (1 << (choice * 5 + comp)))
  30.                         cout << "You Won" << endl;
  31.                 else
  32.                         cout << "You Lose" << endl;
  33.         }
  34.  
  35.         return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement