Advertisement
Guest User

DZ_10

a guest
Dec 15th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.15 KB | None | 0 0
  1. import time
  2. import datetime
  3. import random
  4. import turtle
  5. print('''
  6. ****************************************
  7. * *
  8. * Welcome to Space Adventures! *
  9. * *
  10. ****************************************
  11. ''')
  12. print('Initialization...')
  13. time.sleep(1)
  14.  
  15. ship = [
  16. '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',
  17. '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$$$$$$$@@@@@@@@@',
  18. '@@@@@@@@@@@@@@@@@@@@@@@@@@@@$___-$$$$$$$@@@@@@@',
  19. '@@@@@@@@@@@@@@@@@@@@@@@@@@-______-$$$$$$$@@@@@@',
  20. '@@@@@@@@@@@@@@@@@@@@@@@@$__________-$$$$$@@@@@@',
  21. '@@@@@@@@@@@@@@@@@@@@@@@___-$$$$-_____--$$@@@@@@',
  22. '@@@@@@@@@@@@@@@@@@@@@$___-------$______-@@@@@@@',
  23. '@@@@@@@@@@@@@@@@@@@@_____-------$____-@@@@@@@@@',
  24. '@@@@@@@@@@@@@@$$$$-_______-$$$$$___-@@@@@@@@@@@',
  25. '@@@@@@@@@@@@$$$$$________________$@@@@@@@@@@@@@',
  26. '@@@@@@@@@@$$$$$-_____-$_______-@@@@@@@@@@@@@@@@',
  27. '@@@@@@@@@@@@@@@____$$-_____-@@@@@@@@@@@@@@@@@@@',
  28. '@@@@@@@@@@@@@@--_$$-_____-$@@@@@@@@@@@@@@@@@@@@',
  29. '@@@@@@@@@@@@$--$$-____-$$$$@@@@@@@@@@@@@@@@@@@@',
  30. '@@@@@@@@@@$$_--_-$@@@$$$$$@@@@@@@@@@@@@@@@@@@@@',
  31. '@@@@@@@@@$-__--$@@@@@$$$@@@@@@@@@@@@@@@@@@@@@@@',
  32. '@@@@@@@@$$-$$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',
  33. '@@@@@@@$$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',
  34. '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',]
  35.  
  36. for i in range(len(ship)):
  37. print(ship[i])
  38. time.sleep(.1)
  39. print('\nYeah! The spaceship is ready.')
  40. name = []
  41. print('\n****************************************')
  42. print('\tSPACESHIP ID-', end='')
  43. for i in range(5):
  44. r = random.randint(0,9)
  45. name.append(r)
  46. print(name[i], end='')
  47. print('\n\tDate: ', end='')
  48. print(datetime.date.today())
  49. print('****************************************')
  50. print('''
  51. Options:
  52. [1] - stars
  53. [2] - galaxy
  54. [3] - missile
  55. [4] - protection
  56. [5] - event
  57. [0] - exit
  58. ''')
  59. while True:
  60. print('****************************************')
  61. print('****************************************')
  62. select = input('Your select: ')
  63. if select == '1' or select == '2':
  64. turtle.TurtleScreen._RUNNING = True
  65. turtle.bgcolor('black')
  66. turtle.speed(0)
  67. turtle.pensize(1)
  68.  
  69. if select == '1':
  70. print('Stars are giant, luminous spheres of plasma.')
  71. colors = ['white', 'yellow']
  72. max_index = len(colors) - 1
  73.  
  74. for i in range(50):
  75. random_index = random.randint(0, max_index)
  76. new_color = colors[random_index]
  77. turtle.color(new_color)
  78.  
  79. turtle.begin_fill()
  80. for i in range(5):
  81. turtle.forward(15)
  82. turtle.right(144)
  83. turtle.penup()
  84. turtle.end_fill()
  85. w = turtle.window_width() // 2 - 50
  86. h = turtle.window_height() // 2 - 50
  87. x = random.randrange(-w, w)
  88. y = random.randrange(-h, h)
  89. turtle.goto(x,y)
  90. turtle.pendown()
  91. turtle.exitonclick()
  92. else:
  93. print('Galaxies consist of stars, stellar remnants, dust, gas, and dark matter, bound together by gravity.')
  94. turtle.pencolor('purple')
  95. colors = ['white', 'yellow']
  96. max_index = len(colors) - 1
  97.  
  98. for i in range(100):
  99. turtle.pensize(i/100 + 1)
  100. turtle.forward(i)
  101. turtle.left(59)
  102. turtle.exitonclick()
  103. elif select == '3':
  104. print('Launching a missile...')
  105. missile = [
  106. '##################################@$@@@',
  107. '###############################@$-@@@@#',
  108. '############################@@_$@@@@@##',
  109. '##########################@-_@@@@@@@###',
  110. '#######################@@_-@##@@@@@####',
  111. '#####################@@_-@@@--@@@@#####',
  112. '###################@@_-@@@@@@@@@#######',
  113. '##################@__@@@@@@@@@@########',
  114. '################@-_@@@@@@@@@@@#########',
  115. '##############@$_$@@@@@@@@@@###########',
  116. '#######@@$$$$@$-@@@@@@@@@@@############',
  117. '#####@$@@@@@@$@@$@@@@@@@@##############',
  118. '###@$@@@@@@@@@@@@@@@@@@################',
  119. '##@@@@@@@@@@@@@@@@@@@@#################',
  120. '#@@@##@@@@@@@@@@@@@@@@#################',
  121. '#######@@@@@@@@@@@@@@@#################',
  122. '######-#@@@@@@@@@@@@@##################',
  123. '####$$-@-####@@@@@@@###################',
  124. '##$$---$$#####@@@@#####################',
  125. '#$$--$$#######@@#######################',
  126. '$$$$$$#################################',
  127. '$$$####################################'
  128. ]
  129.  
  130. for i in range(len(missile)):
  131. print(missile[i])
  132. time.sleep(.2)
  133. elif select == '4':
  134. print('An enemy spaceship is moving toward your SPACESHIP ID-', end='')
  135. for i in range(5):
  136. print(name[i], end='')
  137. print('\nStart protection...')
  138. time.sleep(1)
  139. protection = [
  140. '....................._-$@@@$-@_................',
  141. '...................-$$$$$@@@@$$_...............',
  142. '...................$$$$@@@@$$@$$_..............',
  143. '...................-$$$$@@@$$@$-...............',
  144. '..................._@#$$@##@$$-_...............',
  145. '..................._-$$$$$$$$$_................',
  146. '..................._$$@@@@@@$_.................',
  147. '...................._-@@@@@_...................',
  148. '...................._-@@#@@$_..................',
  149. '.................._@$$@@@@@@@$_................',
  150. '................._@$$$$@@@@##@@$...............',
  151. '................_-@@$$$@@@#@#@@@@_.............',
  152. '................_@@__$$@@@@@@_.$@@-............',
  153. '..............._@@$._@$@@#@@@_..$@@_...........',
  154. '.............._$@-._-@$@@@@@@..._@@-...........',
  155. '............._$@_.._$@$@@#@@@_..._@$_..........',
  156. '.............-@@$_._@@@@@@@@$_.._@@@$..........',
  157. '.............$$.__._@@@#_@#@$...$__@$..........',
  158. '............._$_..._@@#@_$$@$._...-$_..........',
  159. '..................._@@#@_$@@@-.................',
  160. '....................$@#@@-@@@$.................',
  161. '..................._$@#@@$@@@@_................',
  162. '..................._--___@@$$@$_...............'
  163. ]
  164.  
  165. for i in range(len(protection)):
  166. print(protection[i])
  167. time.sleep(.2)
  168. elif select == '5':
  169. event = ['Входим в особую зону, где происходит рождение звезд!', 'Приближаемся к Галактике Андромеды!', 'Внимание! Летит астероид. ', 'Обнаружены космические пираты!']
  170. print(random.choice(event))
  171. print('Предпринять меры?\n[y] - Yes\n[n] - No')
  172. ct = input('Your choice: ')
  173. if ct == 'y':
  174. print('''
  175. ....................._-$@@@$-@_................
  176. ...................-$$$$$@@@@$$_...............
  177. ...................$$$$@@@@$$@$$_..............
  178. ...................-$$$$@@@$$@$-...............
  179. ..................._@#$$@##@$$-_...............
  180. ..................._-$$$$$$$$$_................
  181. ..................._$$@@@@@@$_.................
  182. ...................._-@@@@@_...................
  183. ...................._-@@#@@$_..................
  184. .................._@$$@@@@@@@$_................
  185. ................._@$$$$@@@@##@@$...............
  186. ................_-@@$$$@@@#@#@@@@_.............
  187. ................_@@__$$@@@@@@_.$@@-............
  188. ..............._@@$._@$@@#@@@_..$@@_...........
  189. .............._$@-._-@$@@@@@@..._@@-...........
  190. ............._$@_.._$@$@@#@@@_..._@$_..........
  191. .............-@@$_._@@@@@@@@$_.._@@@$..........
  192. ............._$_..._@@#@_$$@$._...-$_..........
  193. ..................._@@#@_$@@@-.................
  194. ....................$@#@@-@@@$.................
  195. ..................._$@#@@$@@@@_................
  196. ..................._--___@@$$@$_...............''')
  197. print('Вы спаслись!')
  198. continue
  199. if ct == 'n':
  200. print('Вы не спаслись... Game Over')
  201. break
  202. elif select == '0':
  203. break
  204. else:
  205. print('Error!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement