Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <stdlib.h>
  4. #include <time.h>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11. cout << "Do you think that you're a psychic?" << endl;
  12. cout << "Try and guess the correct sequence of shapes that appear!" << endl;
  13. cout << "Type in one of these shapes: Circle, Cross, Wave, Square, or Star\n" << endl;
  14.  
  15. srand (time(NULL));
  16. string deck[5] = {"Circle", "Cross", "Wave", "Square", "Star"};
  17. int RandIndex = rand()%5;
  18.  
  19. string solution = deck[RandIndex];
  20. string guess;
  21.  
  22. while(true){
  23. cout << "Please enter a card: " << endl;
  24. getline(cin, guess);
  25. cout << "\n" << endl;
  26. cout << "The card you picked was: " << guess << endl;
  27. cout << "The card the computer picked was: " << solution << endl;
  28.  
  29. if(guess != solution){
  30.  
  31. cout << "You failed!" << endl;
  32.  
  33. }
  34. else {
  35.  
  36. cout << "You got one! Good job!" << endl;
  37. }
  38. srand (time(NULL));
  39.  
  40. }
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement