Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. while (playing = 1) {
  2. cout << "What is your name? ";
  3. cin >> name;
  4. sleep(1500);
  5. cout << "You set out for an adventure in a cave.\n";
  6. sleep(1500);
  7. cout << "As you venture deeper into the cave, you find a crate\n";
  8. sleep(1500);
  9. while (searchChest != 'y' && searchChest != 'n') {
  10. cout << "Do you wish to search the crate? y/n \n";
  11. cin >> searchChest;
  12. sleep(1500);
  13. if (searchChest == 'y') {
  14. sleep(1500);
  15. choices++;
  16. srand(static_cast<unsigned int>(time(0)));
  17. int chestPick = rand() % 4;
  18. weapon = chestInventory[chestPick];
  19. sleep(1500);
  20. if (chestPick = 0) {
  21. cout << "You found an" << weapon << "\n" << "You decide to continue on with the adventure with the newly found" << weapon << "\n";
  22. }
  23. else if (chestPick = 3) {
  24. cout << "You found nothing!\n" << "Saddened, you decide to continue on with the adventure\n";
  25. }
  26. else {
  27. cout << "You found a" << weapon << "\n" << "You decide to continue on with the adventure with the newly found" << weapon << "\n";
  28. }
  29. }
  30. else if (searchChest == 'n') {
  31. choices++;
  32. cout << "You decide not to search the crate and continue on with your adventure.\n";
  33. }
  34. else {
  35. cout << "Unknown character! retry!\n";
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement