-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimportant_settings.py
125 lines (105 loc) · 3.91 KB
/
important_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Important file for BOAT's correct function
import numpy as np
import os
import time
import getpass
bird = """
_.--.__ _.--.
./' `--.__ ..-' ,'
,/ |`-.__ .' ./
:, : `--_ __ .' ,./'_.....
: : / `-:' _\. .' ./..-' _.'
: ' ,' : / \ : .' `-'__...-'
`. .' . : \@/ : .' '------.,
._....____ ./ : .. ` : .-' _____.----'
`------------' : | `..-' `---.
.---' : ./ _._-----'
.---------._____________ `-.__/ : /` ./_-----/':
`---...--. `-_| `.`-._______-' / / ,-----.__----.
,----' ,__. . | / `\.________./ ====__....._____.'
`-___--.-' ./. .-._-'----\. ./.---..____.--.
:_.-' '-' `.. .-'===.__________.'
`--...__.--'
"""
banner = """
____ ___ _ _____ _____ _ _ _ _ ____ _
| __ ) / _ \ / \|_ _| ___| (_) __ _| |__ | |_/ ___|(_)_ __ ___
| _ \| | | |/ _ \ | | | |_ | | |/ _` | '_ \| __\___ \| | '_ ` _ \
| |_) | |_| / ___ \| | | _| | | | (_| | | | | |_ ___) | | | | | | |
|____/ \___/_/ \_\_| |_| |_|_|\__, |_| |_|\__|____/|_|_| |_| |_|
|___/
"""
high_score = """
_ _ _ _ ____ _
| | | (_) __ _| |__ / ___| ___ ___ _ __ ___| |
| |_| | |/ _` | '_ \ \___ \ / __/ _ \| '__/ _ \ |
| _ | | (_| | | | | ___) | (_| (_) | | | __/_|
|_| |_|_|\__, |_| |_| |____/ \___\___/|_| \___(_)
|___/
"""
plane = """
__
\ \ _ _
\**\ ___\/ \\
X*#####*+^^\_\\
o/\ \\
\__\\
"""
plane_2 = """
__
\ \ _ _
\**\ ___\/ \\
+*#####*+^^\_\\
o/\ \\
\__\\
"""
def high_performance_flight_simulator():
shapes = ['-', '/', '|', "\\"]
file_sort = ['texture', 'world', 'colorscheme', 'model', 'physics engine', 'avionics', 'Navier-Stokes solver']
file_type = ['configuration file', 'license', 'libraries', 'executables']
planes = [plane, plane_2]
os.system('clear')
count = 0
while count < 13:
print(banner)
print(15*" " + shapes[count % len(shapes)] + " Loading {} {}...".format(np.random.choice(file_sort), np.random.choice(file_type)))
time.sleep(np.random.uniform(0.2, 0.7))
os.system('clear')
count += 1
print(banner)
print(15*" " + "Loading done!")
time.sleep(1)
distance = 45
while distance > 4:
frame = planes[distance%2]
os.system('clear')
for line in frame.splitlines():
print(distance*" " + line)
time.sleep(0.15)
distance -= 1
time.sleep(0.85)
os.system('clear')
score = np.random.randint(100, 5000)
try:
with open("important_config.boat", "r") as f:
current_hs = f.readline()
current_hs_holder = f.readline()
except IOError:
current_hs = "2500"
current_hs_holder = "River"
if not current_hs.rstrip().isnumeric():
print("Corrupt score file. Resetting to previous champion.")
current_hs = 2500
current_hs_holder = "River"
else:
current_hs = int(current_hs)
if score > current_hs:
print(high_score)
print(2*" " + "You've got the high score with {} points, "
"and displaced {}!\n".format(score, current_hs_holder))
with open("important_config.boat", "w") as f:
f.write(str(score) + "\n")
f.write(getpass.getuser())
else:
print(5*" " + "HIGH SCORE: {} - {}".format(current_hs_holder, current_hs))
print(5*" " + "You've won with {} points! Try again?\n".format(score))