Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 KB | None | 0 0
  1. #Dragon Realm
  2.  
  3. import random
  4.  
  5. import time
  6.  
  7.  
  8.  
  9. def displayIntro():
  10.  
  11.     print('You are in a land full of dragons. In front of you,')
  12.  
  13.     print('you see two caves. In one cave, the dragon is friendly')
  14.  
  15.     print('and will share his treasure with you. The other dragon')
  16.  
  17.     print('is greedy and hungry, and will eat you on sight.')
  18.  
  19.  
  20.  
  21.     print()
  22.  
  23.  
  24.  
  25. def chooseCave():
  26.  
  27.     cave = ''
  28.  
  29.     while cave != '1' and cave != '2':
  30.  
  31.           print('Which Cave will you go into? (1 or 2)')
  32.  
  33.           cave = input()
  34.  
  35.  
  36.  
  37.     return cave
  38.  
  39.  
  40.  
  41. def checkCave (chosenCave):
  42.  
  43.     print('let us see what you got')
  44.  
  45.     time.sleep(1)
  46.  
  47.     print('Oooh spookey')
  48.  
  49.     time.sleep(1)
  50.  
  51.     print('A large dragon jumps out of nowhere...')
  52.  
  53.     print()
  54.  
  55.     time.sleep(1)
  56.  
  57.  
  58.  
  59.     friendlyCave = random.randint(1, 2)
  60.  
  61.  
  62.  
  63.     if chosenCave == str(friendlyCave):
  64.  
  65.         print('wohooo! You got the treasure and a huge cock in bonus!')
  66.  
  67.         return 0
  68.  
  69.  
  70.  
  71.    
  72.  
  73.     else:
  74.  
  75.         print("he want's to kill you!.")
  76.  
  77.         print('Do you want to draw your sword? yes or no?')
  78.  
  79.         return 1
  80.  
  81.        
  82.  
  83.  
  84.  
  85.          
  86.  
  87. def chooseSword():
  88.  
  89.     Sword = ''
  90.  
  91.     while Sword != 'y' and Sword != 'yes' and Sword != 'n' and Sword != 'no':
  92.  
  93.         Sword = input()
  94.  
  95.  
  96.  
  97.     return Sword
  98.  
  99.        
  100.  
  101. def checkSword (chooseSword):
  102.  
  103.     if chooseSword == 'yes' or chooseSword == 'y':
  104.  
  105.         print('You will now try to kill the dragon')
  106.  
  107.     else:
  108.  
  109.         print('Run and hide!')
  110.  
  111.        
  112.  
  113.        
  114.  
  115. PlayAgain = 'yes'
  116.  
  117. while PlayAgain == 'yes' or PlayAgain == 'y':
  118.  
  119.  
  120.  
  121.     displayIntro()
  122.  
  123.  
  124.  
  125.     caveNumber = chooseCave()
  126.  
  127.    
  128.  
  129.     if checkCave(caveNumber) == 1:
  130.  
  131.         swordLetter = chooseSword()
  132.  
  133.         checkSword(swordLetter)
  134.  
  135.  
  136.  
  137.     print('do you want to play again? (yes or no)')
  138.  
  139.     PlayAgain = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement