import time import datetime import random import turtle print(''' **************************************** * * * Welcome to Space Adventures! * * * **************************************** ''') print('Initialization...') time.sleep(1) ship = [ '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@', '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$$$$$$$@@@@@@@@@', '@@@@@@@@@@@@@@@@@@@@@@@@@@@@$___-$$$$$$$@@@@@@@', '@@@@@@@@@@@@@@@@@@@@@@@@@@-______-$$$$$$$@@@@@@', '@@@@@@@@@@@@@@@@@@@@@@@@$__________-$$$$$@@@@@@', '@@@@@@@@@@@@@@@@@@@@@@@___-$$$$-_____--$$@@@@@@', '@@@@@@@@@@@@@@@@@@@@@$___-------$______-@@@@@@@', '@@@@@@@@@@@@@@@@@@@@_____-------$____-@@@@@@@@@', '@@@@@@@@@@@@@@$$$$-_______-$$$$$___-@@@@@@@@@@@', '@@@@@@@@@@@@$$$$$________________$@@@@@@@@@@@@@', '@@@@@@@@@@$$$$$-_____-$_______-@@@@@@@@@@@@@@@@', '@@@@@@@@@@@@@@@____$$-_____-@@@@@@@@@@@@@@@@@@@', '@@@@@@@@@@@@@@--_$$-_____-$@@@@@@@@@@@@@@@@@@@@', '@@@@@@@@@@@@$--$$-____-$$$$@@@@@@@@@@@@@@@@@@@@', '@@@@@@@@@@$$_--_-$@@@$$$$$@@@@@@@@@@@@@@@@@@@@@', '@@@@@@@@@$-__--$@@@@@$$$@@@@@@@@@@@@@@@@@@@@@@@', '@@@@@@@@$$-$$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@', '@@@@@@@$$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@', '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',] for i in range(len(ship)): print(ship[i]) time.sleep(.1) print('\nYeah! The spaceship is ready.') # Initialization spaceship name name = [] print('\n****************************************') print('\tSPACESHIP ID-', end='') for i in range(5): r = random.randint(0,9) name.append(r) print(name[i], end='') # Date print('\n\tDate: ', end='') print(datetime.date.today()) print('****************************************') print(''' Options: [1] - stars [2] - galaxy [3] - missile [4] - protection [0] - exit ''') while True: print('****************************************') print('****************************************') select = input('Your select: ') # Stars if select == '1' or select == '2': turtle.TurtleScreen._RUNNING = True turtle.bgcolor('black') turtle.speed(100) turtle.pensize(1) if select == '1': print('Stars are giant, luminous spheres of plasma.') # List of colors colors = ['white', 'yellow'] max_index = len(colors) - 1 for i in range(50): # Random color random_index = random.randint(0, max_index) new_color = colors[random_index] turtle.color(new_color) # Stars turtle.begin_fill() for i in range(5): turtle.forward(15) turtle.right(144) turtle.penup() turtle.end_fill() # Generate random location on the screen w = turtle.window_width() // 2 - 50 h = turtle.window_height() // 2 - 50 x = random.randrange(-w, w) y = random.randrange(-h, h) turtle.goto(x,y) turtle.pendown() turtle.exitonclick() # Galaxy else: print('Galaxies consist of stars, stellar remnants, dust, gas, and dark matter, bound together by gravity.') turtle.pencolor('purple') # List of colors for i in range(100): turtle.pensize(i/100 + 1) turtle.forward(i) turtle.left(59) turtle.exitonclick() # Rocket elif select == '3': print('Launching a missile...') missile = [ '#####################################@@', '##################################@$@@@', '###############################@$-@@@@#', '############################@@_$@@@@@##', '##########################@-_@@@@@@@###', '#######################@@_-@##@@@@@####', '#####################@@_-@@@--@@@@#####', '###################@@_-@@@@@@@@@#######', '##################@__@@@@@@@@@@########', '################@-_@@@@@@@@@@@#########', '##############@$_$@@@@@@@@@@###########', '#######@@$$$$@$-@@@@@@@@@@@############', '#####@$@@@@@@$@@$@@@@@@@@##############', '###@$@@@@@@@@@@@@@@@@@@################', '##@@@@@@@@@@@@@@@@@@@@#################', '#@@@##@@@@@@@@@@@@@@@@#################', '#######@@@@@@@@@@@@@@@#################', '######-#@@@@@@@@@@@@@##################', '####$$-@-####@@@@@@@###################', '##$$---$$#####@@@@#####################', '#$$--$$#######@@#######################', '$$$$$$#################################', '$$$####################################'] for i in range(len(missile)): print(missile[i]) time.sleep(.2) # Protection elif select == '4': print('An enemy spaceship is moving toward your SPACESHIP ID-', end='') for i in range(1): print(name[i], end='') print('\nStart protection...') time.sleep(1) protection = [ '....................._-$@@@$-@_................', '...................-$$$$$@@@@$$_...............', '...................$$$$@@@@$$@$$_..............', '...................-$$$$@@@$$@$-...............', '..................._@#$$@##@$$-_...............', '..................._-$$$$$$$$$_................', '..................._$$@@@@@@$_.................', '...................._-@@@@@_...................', '...................._-@@#@@$_..................', '.................._@$$@@@@@@@$_................', '................._@$$$$@@@@##@@$...............', '................_-@@$$$@@@#@#@@@@_.............', '................_@@__$$@@@@@@_.$@@-............', '..............._@@$._@$@@#@@@_..$@@_...........', '.............._$@-._-@$@@@@@@..._@@-...........', '............._$@_.._$@$@@#@@@_..._@$_..........', '.............-@@$_._@@@@@@@@$_.._@@@$..........', '.............$$.__._@@@#_@#@$...$__@$..........', '............._$_..._@@#@_$$@$._...-$_..........', '..................._@@#@_$@@@-.................', '....................$@#@@-@@@$.................', '..................._$@#@@$@@@@_................', '..................._--___@@$$@$_...............'] for i in range(len(protection)): print(protection[i]) time.sleep(.2) elif select == '0': break else: print('Error! Try again')