-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexemple_calculating_clocks.py
More file actions
122 lines (97 loc) · 3.27 KB
/
exemple_calculating_clocks.py
File metadata and controls
122 lines (97 loc) · 3.27 KB
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
from fractions import Fraction
from math import ceil
def print_fraction(num):
print("{:0.3f} ( {} )".format(float(num), num))
def new_fraction(str):
res = Fraction(0.0)
for a in str.split():
# print('a = ', type(a), a)
res += Fraction(a)
return res
######################################
#
# main
if __name__ == "__main__":
item_per_sec = Fraction("0") + Fraction("1/6")
print()
print("==================")
print("")
print()
print(item_per_sec / 1 / 60)
print()
print("==================")
print("")
print()
print_fraction(Fraction(4) / (Fraction(4) + Fraction("8/25")))
print_fraction(Fraction(7) * new_fraction("1701/2500") / new_fraction("4 463/1160"))
print()
print("==================")
print("")
print()
print(Fraction(5 * 15, 1) / new_fraction("12 13/36"))
# print_fraction(Fraction(8) * Fraction("2187/2000"))
print()
print("==================")
print("соотношение сторон у монитора")
print()
print_fraction(new_fraction("3840/2160"))
print_fraction(new_fraction("640/360"))
print_fraction(new_fraction("640/480"))
print()
print("==================")
print("")
print()
print_fraction(new_fraction("1 1/10") / 9 / 60)
print_fraction(1000000 / new_fraction("256 1/2"))
ore = 4000
delta = 100
while ore > 0:
if ore % 24 == 0:
print(ore / delta, ore, ore % 24)
ore -= delta
print()
print("==================")
print("RC")
print()
for rc in range(100, 5000):
copper = new_fraction("1 1/49") * rc
copper = new_fraction("2 6/7") * rc
gc = new_fraction("1 3/7") * rc
plastic = new_fraction("1 3/7") * rc
s1 = ceil(copper / 100)
s1 = ceil(copper / 200)
s2 = ceil(gc / 200)
s3 = ceil(plastic / 100)
slots = s1 + s2 + s3
print(
"rc = {:5d} copper = {:<10.3f} gc = {:<10.3f} plastic = {:<10.3f} slots = {}".format(
rc, float(copper), float(gc), float(plastic), slots
)
)
print("\tcopper = {} gc = {} plastic = {}".format(s1, s2, s3))
print("разгрузка = {:<10.2f}s".format((s1 * 100 + s2 * 200 + s3 * 100) / 27))
print("производство = {:<10.2f}".format(float(rc / new_fraction("1 17/60"))))
if slots > 37:
break
print()
print("==================")
print("solar panels")
print()
for panel in range(100, 5000):
copper = new_fraction("5") * panel
gc = new_fraction("15") * panel
steel = new_fraction("5") * panel
s1 = ceil(copper / 100)
s2 = ceil(gc / 200)
s3 = ceil(steel / 100)
slots = s1 + s2 + s3
print(
"panel = {:5d} copper = {:<10.3f} gc = {:<10.3f} plastic = {:<10.3f} slots = {}".format(
panel, float(copper), float(gc), float(steel), slots
)
)
print("\tcopper = {} gc = {} steel = {}".format(s1, s2, s3))
# print("разгрузка = {:<10.2f}s".format((s1 * 100 + s2 * 200 + s3 * 100) / 27))
# print("производство = {:<10.2f}".format(float(rc / new_fraction("1 17/60"))))
if slots > 39:
break