Advertisement
Guest User

Untitled

a guest
Feb 25th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. int main()
  2. {
  3. // Declare Variables
  4. int pigDice = 0;
  5. int gamerDice = 0;
  6. int gamerTurn = 0;
  7. int computerTurn = 0;
  8. int gamerInput = 0;
  9. int totalScore;
  10. const int SCORE_LIMIT = 100;
  11. char choice = ' ';
  12. int gamerScore = 0;
  13. int turnScore = 0;
  14. int pigScore = 0;
  15.  
  16. cout << "Welcome to ARCADEMANIA" << endl;
  17. cout << "Enter 1 to play Pig " << endl;
  18. cout << "Enter 2 to play Blackjack dice" << endl;
  19. cin >> gamerInput;
  20.  
  21. srand(static_cast<int>(time(0)));
  22. pigDice = (rand() % 6) + 1;
  23.  
  24. if
  25. (gamerInput == 1)
  26. {
  27. char gamerName[12];
  28. cout << "WELCOME TO PIG GAME" << endl;
  29. cout << "Hi welcome to Pig you will be trying to beat Wilbert to 100 pts. Rember you cannot roll a 1 or you will lose a turn and will not get any points";
  30. cout << "Wilbert is excited to play goodluck and roll on" << endl;
  31. cout << "Please enter your gamer name" << endl;
  32. cin >> gamerName;
  33. cout << " Welcome to Pig " << gamerName << " Lets see what you got!!!!!" << endl;
  34.  
  35. cout << "Press r to roll.\n" << endl;
  36. do
  37. {
  38. do
  39. {
  40. cin >> choice;
  41. gamerDice = (rand() % 6) + 1;
  42. gamerScore = gamerScore + gamerDice;
  43.  
  44. cout << "Your roll is a " << gamerDice << endl;
  45. cout << "Your total score is " << gamerScore << endl;
  46.  
  47. } while (gamerDice != 1 && gamerScore <= 100);
  48.  
  49. if (gamerScore <= 100)
  50. {
  51. cout << endl << "Now you're in pig Dice" << endl << endl;
  52. cout << "Press r to roll.\n" << endl;
  53.  
  54. do
  55. {
  56. cin >> choice;
  57. pigDice = (rand() % 6) + 1;
  58. gamerScore = gamerScore + pigDice;
  59. cout << "Your roll is a " << pigDice << endl;
  60. cout << "Your total score is " << gamerScore << endl;
  61. cout << gamerScore << endl;
  62.  
  63. } while (pigDice != 1 && gamerScore <= 100);
  64.  
  65. if (gamerScore <= 100)
  66. {
  67. cout << "You lose your turn Pig!!! Back to Gamer Dice you go " << gamerName << " press 'r' to roll die. \n" << endl;
  68. }
  69. }
  70. } while (gamerScore <= 100);
  71.  
  72. cout << " Congragulation" << gamerName << "Your the winner" << endl;
  73. }
  74.  
  75. system("pause");
  76. return 0;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement