forked from MyProjectEEON/RandomProjects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGorn.py
More file actions
259 lines (240 loc) · 10.1 KB
/
Gorn.py
File metadata and controls
259 lines (240 loc) · 10.1 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
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
s = """Ruim alon im tavu es bekivu Enter Arena with thought of death 1 2 3 4 5
Kimbe ro ta roki uprotaki Moron will be fight repeatedly 6 7 8 9
Odvu roki kimbe ro ta im bekivu One Fight Moron will be with death 10 8 6 7 2 5
Be ta otabe estabe es ubkibe alimro I am want climb of giant champion 42 11 12 4 13 14
Kirobei ta taraoki Happiness is guaranteed 15 16 17
O ta kirobeta imod odkiroim Nothing is funny without surprise 18 16 19 20 21
Vu rokibe ta kimbe imes beki Most fighter is idiot like you 22 23 16 6 24 25
Roa tavu es bero odkiroim Never think of my surprise 26 3 4 27 21
Teod alkibe kitabe takivu ub imrotave up kirobeta Isn’t difficult give pain and take’ many laugh 28 29 30 31 32 33 34 19
Alimta kiodim im odvutavu Faker forever with deception 35 36 2 37
Rokibe rota tave odvu ro rotaki Fighter will have only first loss 23 7 38 10 39 40
Ta taroki im vu rokibe Is true with all fighter 16 17 2 22 23
Ota be kita taki rokim alimta However I was win versus faker 41 42 43 44 45 35
Be kita taki im ub ub rokimes I was win with many many duels 42 43 44 2 34 34 46
Alki rokio kies imta odkies ub imtavuro Choose weapon sharp or dull and understand’ 47 48 49 50 51 32 52
Kiod takivu im kiod rokio teod kivu Wrong strike with wrong weapon isn’t kill 31 2 48 28 53
Ubkin teod kies ub imubkies teod kim Hammer isn’t sword and spear isn’t rock 55 28 49 32 56 28 57
Ontaroki im kivu imod tavuro ota taroki alkibe Might with kill without understanding but certainly difficult 54 2 53 20 52 41 17 29
Rokimvu ta up kivu taro Free-for-all is much deadly event 16 34 58 59
Vu rokibe ta roki im alon All fighter is fight in arena 22 23 16 8 2 1
Odkium imrokiod ub imkivu odvube vutabe Create distance and kill alone prey 60 32 53 61
Ubvuta rokibe rota bevu imod ubvuta kivu Best fighter will be without most kill 62 23 7 63 20 62 53
Kimbe od tavuro Moron not understand 6 18 52
Ubvuim ta kirokibe Everywhere is trial 64 16 65
Im alimrota vu bevu es odavu ro ta rokivu With freedom all beings of world will be enemy 2 66 22 63 4 67 7 68
Oda teod rokimes Reality isn’t duel 67 28 46
Rokiotavube kita kibe rotabeim The-clown was good thief 69 43 70 71
Vu rokibe odros es rokium im rokiotavu Many fighter drop of weapon from prank 22 23 72 4 48 4 73
Imrota od im estakivu kita rotabe es rokium After miss of strike was take of weapon 67 4 31 43 33 4 48
Up kirobeta es vu Many laugh from all 34 19 4 22
Ta kimbe tavuro es tavues kirodroki Is moron know of writing language 16 6 52 4 74
Be kita taim beupim ubim tavues I was use paint and words 42 43 75 76 32 74
Odkiub tavuesta es roki Create book of fight 77 4 8
Rotakivu bekiro rokivu im alod Trap your enemy in arena 78 79 68 2 1
Taim alod ub imkivu imes rovuta Use arena and kill like animal 75 1 32 53 24 81
Rokibe eskibe es esteodkivu kirota Fighter hate of accidental touch 23 80 4 82 83
Otabe otaki up rokinta ines Want loss more than that 11 40 34 45 84
Kiodimki teod ki Oblivion isn’t end 85 28 86
Ki teod ki End isn’t end 86 28 86
Vu rokibe ta bekivu All fighter is dying 22 23 16 5
Im bekivu kiodro avuta With dying become meat 2 5 87 88
Es avuta kiodro kiavuta From meat become dust 4 88 87 89
Es kiavuta ta imvuta From soil is plant 4 89 16 90
Im imvuta ro ta rovuta With plant will be animal 2 90 7 81
Rovuta kiodro rovutabe Animal become pet 81 87 91
Rovutabe tave alodbe Pet have master 91 38 93
Alodbe rokim rokibe Master compare fighter 93 45 23
Rokibe roki rokibe uprotaki Fighter fight fighter again 23 8 23 9
Be ta otabe kialodbe I am want sleeping 115 11 94
Kimbe od kiru Moron not sound 6 18 92
Rokia im ub rokium ota kimbe od tavuro taim Practice with all weapon or moron not understand use 95 2 34 48 41 6 18 52 75
Vues rokio ta alkibe es taim More weapon is hard of use 48 16 29 4 75
Roemeskie kibekies imta vukies Battledisc greatsword or axe 50 96
Ota im roesta kimbe ta kibe However with preparation moron is strong 41 2 71 6 16 70
Kimbe teod tave odrokibe Moron isn’t have lover 6 28 38 97
Kimbe ub imod albe Moron very without beauty 6 34 20 98
Ub rokibe imod able tave odroki Many fighter without beauty have love 34 23 20 98 38 99
Ota kimbe ta - odtavube im kiroim But moron is also insane with shitsmell 41 6 16 32 100 2 101
Kimbe kiro im rokium ub imubroki im roes Moron see of weapon and fast with collect 6 102 2 48 32 103 2 104
Roes ubvuta iroki rokio Pickup best close weapon 104 62 105 48
Imod rokio ta ub rotakivu Without weapon is much danger 20 48 16 34
Vu rokibe tavuro es odalbe All fighter know of prisoner 22 23 52 4 106
Ota vu odbe kiotavu es be However all others forget of me 41 22 107 4 42
Rota kimbe alta imrota alimrotas Will moron remember after freedom 7 6 108
Vu rokibe rota taroki teodkivu esvu All fighter will accident with time 22 23 7 17 82
Ontaroki imod ubroki ota im kiodim ta ro Might without fast but with forever is true 54 20 103 41 2 36 16 39
Imesvu ub im kimbe taroki taki Wait and moron will certainly win 32 6 17 44
Taki imes kibe alimro rokiotavube Win like great champion the-clown 44 24 70 14 69
Ta kimbe tavuro es be-kirood Is moron now of be-kirood 16 6 53 4 41
Be otabe rokim be-kirood I want fight be-kirood 42 11 45 42 92
Be-kirood tabe up kivuim Be-kirood has much style 42 92 38 34 109
Bekiro kirudim tabe up al His song have much spirit 79 110 38 34 111
Ubkies es alod kitabe up kirobeta Spear of arena give much laugh 56 4 1 30 34 19
Alimteo ta up kirobeta roim ta imtabe rokibe Spectators is much happy if is holding fighter 112 16 34 15 113 16 114 23
Be ta odkirobe I am hungry 115 116
Be ta im alta es avuta I am with memory of meat 115 2 108 4 88
Kimbe rota imkies vuta im be Moron will throw food at me 6 7 117 118 2
Alimta kita odvuta es vu rokibe Faker was least of all fighter 35 43 119 4 22 23
Ta robeim es otaki roki imod bekivu Is name from lost fight without death 16 120 4 40 8 20 5
Kita bevu alimta kita up odalimki rokim odkibe Was being faker was more dishonor than coward 43 63 35 43 34 45 121
Ota taroes alimta ta alim However now alimta is divine 41 122 35 16 123
Beki road ataimbe He never hero 25 26"""
alphabet = "abcdefghijklmnopqrstuvwxyz-"
cs = "bp bv ck cs cz cg dt ei fv fw gk iy ij jy mn ou sz vw"
master =[]
def repdict(cs):
global alphabet
d={}
l = cs.split(" ")
for i in alphabet:
d[i] = [i]
for i in l:
if not i[0] in d:
d[i[0]] = [i[1]]
else:
d[i[0]].append(i[1])
if not i[1] in d:
d[i[1]] = [i[0]]
else:
d[i[1]].append(i[0])
return d
def compstart(m,sl,csd):
"""message, source list (looks like a dict), couple source dict"""
m.replace(" ","")
lc = []
for i in sl:
lock = False
if(len(i[0])<=len(m)):
for j in range(len(i[0])):
b = False
for k in csd[i[0][j]]:
if k == m[j]:
b = True
if not b:
lock = True
break
if not lock:
lc.append(i[0])
return lc
def wtrans(w):
l = []
for i in full(s,0,1,False):
if i[0] == w:
l.append(i[1])
return l
def trans(m,prefix):
global master
l = compstart(m, full(s,0,1,False), repdict(cs))
for i in l:
if len(i) == len(m):
master.append(prefix+i)
else:
trans(m[len(i):],prefix+i+" ")
def getTrans(m):
global master
master = []
trans(m,"")
return remdupe(master)
def remdupe(l):
return list(dict.fromkeys(l))
def inter(m):
m = m.replace(" ","")
l = []
t = getTrans(m)
t.reverse()
for i in t:
l.append("")
for j in i.split(" "):
if(len(wtrans(j))>1):
s = "["
for k in wtrans(j):
s+=str(k)+" / "
s = s.strip(" / ")
s+="]"
l[-1] += s + " "
else:
l[-1]+=str(wtrans(j)[0])+" "
for i in range(len(t)):
print(t[i]+" -> "+l[i])
def splitup(s):
l=[]
b = True
while(b):
b = s.find(" ")!=-1 or s.find("\n")!=-1
c = min([s.find(" ")%(2**20),s.find("\n")%(2**20)])
l.append(s[0:c])
s = s.replace(s[0:c+1],"")
return l
def sep(l):
n = [[],[],[]]
for i in range(len(l)):
n[i%3].append(l[i])
return n
def wc(a,b):
return len(a.split(" "))==len(b.split(" "))
def words(a):
return a.split(" ")
def cor(l):
d={}
d1={}
for i in range(len(l[1])):
if(wc(l[0][i],l[1][i])):
for j in range(len(words(l[1][i]))):
d[words(l[1][i])[j].lower()]=words(l[0][i])[j].lower()
if(wc(l[2][i],l[1][i])):
for j in range(len(words(l[1][i]))):
d1[words(l[1][i])[j].lower()]=words(l[2][i])[j].lower()
return [d,d1]
def full(s,signs,language,prettyprint):
"""signs: 0 -> spoken language, signs: 1 -> written signs. language: 0 -> english to gorn"""
if(prettyprint):
return pp(sort(pairs(cor(sep(splitup(s)))[signs]),language))
return sort(pairs(cor(sep(splitup(s)))[signs]),language)
def pp(l):
for i in l:
print(i[0],":",i[1])
def pairs(d):
l=[]
for i in d.keys():
l.append([i,d[i]])
return l
def remsolv(l):
l3 = l.copy()
rem_ind = []
rem = [[],[],[]]
for i in range(len(l3[0])):
if(wc(l3[0][i],l3[1][i])):
rem_ind.append(i)
for i in rem_ind:
for j in range(0,3):
rem[j].append(l3[j][i])
for j in range(0,3):
for i in rem[j]:
l3[j].remove(i)
return l3
def sort(l,index):
o=[]
alpha = "zz"
alpha0 = 2**15
rem = [[],[]]
while len(l):
if l[0][index].isdigit():
for i in l:
if int(i[index]) < alpha0:
alpha0 = int(i[index])
rem = i
else:
for i in l:
if i[index]<alpha:
alpha = i[index]
rem = i
l.remove(rem)
if(not index):
o.append(rem)
else:
o.append([rem[1],rem[0]])
alpha = "zz"
alpha0 = 2**15
rem = [[],[]]
return o