-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEN-GEN.py
277 lines (265 loc) · 10.3 KB
/
EN-GEN.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os,time
input('kamu masih jomblo? [y/n] : ')
time.sleep(0.5)
os.system('cls||clear')
global menu
menu = 0
def Core():
core = 0
while True:
try:
core = int(input('\nInput Core Number => '))
DiV = core / 12
MoD = core % 12
bulatAtas = round(DiV + 0.5)
def findTube() :
if bulatAtas == 1 or bulatAtas == 0:
print('Biru')
elif bulatAtas == 2:
print('Orange')
elif bulatAtas == 3:
print('Hijau')
elif bulatAtas == 4:
print('Cokelat')
elif bulatAtas == 5:
print('Abu-Abu')
elif bulatAtas == 6:
print('Putih')
elif bulatAtas == 7:
print('Merah')
elif bulatAtas == 8:
print('Hitam')
elif bulatAtas == 9:
print('Kuning')
elif bulatAtas == 10:
print('Violet')
elif bulatAtas == 11:
print('Pink')
elif bulatAtas == 0 or bulatAtas == 12 or bulatAtas == 13:
print('Toska')
return bulatAtas
def findCore() :
if MoD == 1:
print('Biru')
elif MoD == 2:
print('Orange')
elif MoD == 3:
print('Hijau')
elif MoD == 4:
print('Cokelat')
elif MoD == 5:
print('Abu-Abu')
elif MoD == 6:
print('Putih')
elif MoD == 7:
print('Merah')
elif MoD == 8:
print('Hitam')
elif MoD == 9:
print('Kuning')
elif MoD == 10:
print('Violet')
elif MoD == 11:
print('Pink')
elif MoD == 0 or MoD == 12:
print('Toska')
return MoD
except ValueError:
print('Input tidak valid. Gunakan angka')
continue
else:
time.sleep(0.2)
print('\n===== RESULT COLOR =====')
print('Warna Tube dan Warna Core dari Core Ke-{} adalah \n'.format(core))
print('Warna Tube :')
findTube()
print('Warna Core :')
findCore()
print('===========================')
q = input('Ingin mencoba lagi ? (yes/no) => ')
if q == "yes":
Core()
elif q == "no":
return Menu()
break
def Menu():
menu = 0
while True:
try:
time.sleep(0.5)
menu = int(input('\nPILIH MENU [0. BACK TO MENU] => '))
if menu == 1 :
Core()
elif menu == 2 :
Color()
elif menu == 3 :
About()
elif menu == 4 :
exit()
elif menu == 0 :
show_menu()
else:
print('\n{} TIDAK ADA DI MENU. PILIH MENU 1 SAMPAI 4'.format(menu))
return Menu()
except ValueError:
print('Pilihan anda tidak valid. Gunakan angka')
print('Pilih menu antara 1 sampai 4')
continue
else:
print('\n{} TIDAK ADA DI MENU. PILIH MENU 1 SAMPAI 4'.format(menu))
print('Pilih menu antara 1 sampai 4')
return Menu()
def Color():
print('\n===== ALAT MENCARI CORE DARI WARNA =====')
colorTube = input('masukan warna tube nya : ')
colorCore = input('masukan warna core nya : ')
def tube():
global tube
if colorTube == 'biru':
tube = (1-1)*12
elif colorTube == 'oren':
tube = (2-1)*12
elif colorTube == 'hijau':
tube = (3-1)*12
elif colorTube == 'coklat':
tube = (4-1)*12
elif colorTube == 'abu-abu':
tube = (5-1)*12
elif colorTube == 'putih':
tube = (6-1)*12
elif colorTube == 'merah':
tube = (7-1)*12
elif colorTube == 'hitam':
tube = (8-1)*12
elif colorTube == 'kuning':
tube = (9-1)*12
elif colorTube == 'violet':
tube = (10-1)*12
elif colorTube == 'pink':
tube = (11-1)*12
elif colorTube == 'toska':
tube = (12-1)*12
return tube
def core():
if colorCore == 'biru':
core = 1 + tube()
elif colorCore == 'oren':
core = 2 + tube()
elif colorCore == 'hijau':
core = 3 + tube()
elif colorCore == 'coklat':
core = 4 + tube()
elif colorCore == 'abu-abu':
core = 5 + tube()
elif colorCore == 'putih':
core = 6 + tube()
elif colorCore == 'merah':
core = 7 + tube()
elif colorCore == 'hitam':
core = 8 + tube()
elif colorCore == 'kuning':
core = 9 + tube()
elif colorCore == 'violet':
core = 10 + tube()
elif colorCore == 'pink':
core = 11 + tube()
elif colorCore == 'toska':
core = 12 + tube()
return core
time.sleep(0.5)
print('\n===== RESULT TOOLS =====')
print('Core Ke => ',core())
q = input('\nIngin Mencoba lagi ? (yes/no) => ')
if q == 'yes':
Color()
elif q == 'no':
return Menu()
def About():
time.sleep(0.5)
print("""
==========================================[ ABOUT EN-GEN ]=================================================
Name : EN-GEN
Version : 1.0.0
Date : 2023-19-01: Purwakarta
Python Ver : 3.x
OS : Windows
Author : Reza Asriano Maulana
Instagram : rzaezaae
Github : CallMeJaja
===========================================================================================================
──────────────────────────────── Donate for support me to upgrade this APP ────────────────────────────────
──────────────────────────────── DANA : 085872792870 | OVO : 081217427056 ────────────────────────────────
===========================================================================================================
""")
time.sleep(0.5)
menu = int(input('PILIH MENU [0. BACK TO MENU] => '))
if menu == 1:
Core()
elif menu == 2:
Color()
elif menu == 3:
About()
elif menu == 4:
time.sleep(0.5)
print("""
===========================================================================================================
=============================[ Terimakasih telah menggunakan aplikasi ini :) ]=============================
===========================================================================================================
""")
time.sleep(0.5)
exit()
elif menu == 0:
show_menu()
else:
print('\n{} TIDAK ADA DI MENU. PILIH MENU 1 SAMPAI 4'.format(menu))
return Menu()
def show_menu():
print(("""
====================================[ APILKASI FIBER OPTIK ]====================================
────────────────────────────────────────────────────────────────────────────────────────────────
_______ __ _ _______ _______ __ _
| || | | | | || || | | |
| ___|| |_| | ____ | ___|| ___|| |_| |
| |___ | ||____|| | __ | |___ | |
| ___|| _ | | || || ___|| _ |
| |___ | | | | | |_| || |___ | | | |
|_______||_| |__| |_______||_______||_| |__|
──────────────────────────────────────────────────────────────────────────────── version 1.0 ──
============================================================================== author : jaja ==
"""))
print('MENU :\n')
print('[ 1 ] FIND BY CORE')
print('[ 2 ] FIND BY COLOR')
print('[ 3 ] ABOUT TOOLS')
print('[ 4 ] EXIT')
menu = 0
while True:
try:
menu = int(input('\nPILIH MENU => '))
if menu == 1:
Core()
elif menu == 2:
Color()
elif menu == 3:
About()
elif menu == 4:
time.sleep(0.5)
print("""
===========================================================================================================
=============================[ Terimakasih telah menggunakan aplikasi ini :) ]=============================
===========================================================================================================
""")
time.sleep(1)
exit()
except ValueError:
print('Pilihan anda tidak valid. Gunakan angka')
print('Pilihan anda tidak valid. Pilih menu antara 1 sampai 4')
continue
else:
print('{} TIDAK ADA DI MENU. PILIH MENU ANTARA 1 SAMPAI 4'.format(menu))
print('Pilihan anda tidak valid. Pilih menu antara 1 sampai 4')
if __name__ == "__main__":
while(True):
show_menu()