Advertisement
tryingtolearn1

Untitled

Jan 28th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <time.h>
  5. using namespace std;
  6.  
  7. int Aiming() {
  8. if (rand() % 67 < 10)
  9. return 11;
  10. else
  11. return rand() % 10 + 1;
  12. }
  13. int main() {
  14. srand(time(NULL));
  15. char enter;
  16.  
  17. int Hunter = true;
  18. int HunterSkill = 9;
  19. int HuntedDuck = 1;
  20. string HunterName = "";
  21. int DuckCount = 0;
  22. int DuckKilled = 0;
  23.  
  24. cout << "Welcome to Bird Hunting Season!." << endl << "Do you already have a license to hunt for this season? \nPress [ ENTER ] if you do!.";
  25. cin.get();
  26.  
  27. cout << "Please enter your name: ";
  28. cin >> HunterName;
  29.  
  30. cout << "How Many Ducks you wanna Hunt? ";
  31. cin >> DuckCount;
  32.  
  33. cout << "Get ready to Hunt!" << HunterName << "!" << endl;
  34.  
  35. while (Hunter && DuckKilled < DuckCount) {
  36.  
  37. int Duck = Aiming();
  38.  
  39. if (Duck > 10) {
  40. cout << endl << "Here comes a pack of DUCKS!" << endl;
  41. }
  42. else {
  43. cout << endl << "You better AIM that Duck! " << DuckKilled + 1 << endl;
  44. }
  45. cout << "Aiming... \nBe Careful! Not only ducks are flying around!" << endl;
  46. sleep(2);
  47.  
  48. if (HunterSkill < Duck) {
  49. Hunter = false;
  50. cout << "Oh! SHOOT! You've' missed the target and nearly shot the other bird! it might be an ENDANGERED ONE!'." << endl;
  51. }
  52. else {
  53. if (HunterSkill - Duck > 7) {
  54. cout << "Impressive!" << endl;
  55. HuntedDuck = HuntedDuck * 2;
  56. }
  57. else if (HunterSkill - Duck > 5) {
  58. cout << "Nice SHOT!" << endl;
  59. HuntedDuck = HuntedDuck * 2;
  60. }
  61.  
  62. else if (HunterSkill - Duck > 0) {
  63. cout << "That was a good AIM!" << endl;
  64. HuntedDuck = HuntedDuck * 2;
  65. }
  66. else {
  67. cout << "You killed a DUCK but you need to focus on our target, You might hurt or killed other Bird!." << endl;
  68. }
  69.  
  70. DuckKilled++;
  71. }
  72. cout << endl;
  73. sleep(1);
  74. }
  75. if (DuckKilled == DuckCount) {
  76.  
  77. cout << "Congratulation!" << endl;
  78. }
  79. else {
  80. cout << "Sorry, But we need to Stop. Your Aiming is not that Good you might HURT other Animal!. \nComeback Again Next Time and Practice Your AIMING SKILL!" << endl;
  81. }
  82. cout << "Duck killed: " << DuckKilled << endl;
  83. cout << "Final score: " << HuntedDuck << endl << endl;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement