Created
March 24, 2021 15:42
-
-
Save Lala5th/dd32d92e41f110b6340762ee521f9149 to your computer and use it in GitHub Desktop.
Noita glyph updated crib drag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
glyphs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrtsuvwxyz0123456789!?\"#%^'()☼+,-./:;<=> " #@[\\]^_`" | |
modulo = len(glyphs) | |
glyph_LUT = { glyphs[i] : chr(i) for i in range(modulo)} | |
c0 = "Rb%P^-k=8]Jfb^@.q(/n\"=-Q!prH_q53 HSa:.5fOLPJ3P-O3Qh?%8#K[cAQI\\5:>%94g+jX$j3g$SIKphV_oq/0L?>,AY<-`KP" | |
c1 = "pb%P^-k=8]Jfb^@.q(/n\"=-Q!=+>Tq53 9:V4.5fOLPJ3P-O3QL:[m`Ko<h`!>i7c&A9`qdN1D-15d-)NcYB^r/*i^\"+ahEL*Kd^)B2" | |
c2 = "Db%P^-k=8]Jfb^@.q(/n\"=-Q!elT)Pbp6`YHQn#0X3OHp&-`=Q`_&Q?-0*M8:m*\\q]BVf5/$bmJE>6 +IhY47YaI72hJ%#:n(%VMm9`]0LVS4_9+:MU\\FB" | |
c3 = "lb%QkVeN@!J\\:PRp@8W]O,5,QVB9D/XW4)(^-r)L=\\UrJp%Kg#pmOnB9^2*Q^`Tq+b^-O1Tf:7@?`7C@R&!9(EOK:ladp1'M_.U_\\0" | |
c4 = "_b%QkV\"\\=HnO\kcg\\\"a'O.Mj[Ip-\\-q6CRHG\"[P?l\"pk!Xc+5(HaMkWG\\J-#6Y\"&Z)f!ZX_d9o'43`\"bi>g0,>aE4-6_2N`[Iqr6nDO1$&1%Do_!`e/K$ZX?.`Z2Lne! N4gi9C(8" | |
c5 = "Bb%QkV7j+-<:3PcYE\\B<j*1@+23K3qJ$^)NQ@SlZ$KO1co5@L0>E:<IdYBS*ef(&NK2GOK/-A>C^E E%FWE-H9)5+`%oJd+g+P#c]H6.CR]G+\"bQSU1iDkjV8>Vf" | |
c6 = ";b%QkV\"\\=H\"W)/[2d#D%OmLF!2<l$B\\_Zp1VokPVW3^`.OSfk%+OMZdeo9FMiOdRBMn:oY$X6\\2kK\\[c_JQAHaom'#:^?n:YeH$7:-cJFh+Ga\\9&pbdm[n3" | |
c7 = "mb%QkV\"\\=H\"W)/[2d#D%O\\5p!hW0rCY3!b2;G1jqG.n 9aKb`Fq78RY>gk:dVYXRgi.5(@:_%E3KbOUBb7i?VFmc+_o&65Sej5%1cE=5\\.rL>$4JC!?VN4H>" | |
c8 = "Ab%QkV\"\\=H\"W)/[2d#D%OA5[L2<l[B\\_o;,V%QPVWT^he*Y6ZPcU'B@>?3:(BN'>gWBkV)&\\%79MJp9,6l4S^5H)I*Li(Afi&?5h%H]SJb`j]9_J8I" | |
c = [c0, c1, c2, c3, c4, c5, c6, c7, c8] | |
for i in range(len(c)): | |
new = "" | |
for j in range(len(c[i])): | |
new += chr(ord(c[i][j]) - 32) | |
c[i] = new | |
def add(a,b): | |
ret = "" | |
for i in range(min(len(a),len(b))): | |
ret += chr((ord(a[i]) + ord(b[i])) % modulo) | |
return ret | |
def sub(a,b): | |
ret = "" | |
for i in range(min(len(a),len(b))): | |
ret += chr((ord(a[i]) - ord(b[i])) % modulo) | |
return ret | |
def crib_drag(a,substr): | |
for i in range(len(a) - len(substr)): | |
yield add(a[i:],substr) | |
def print_glyph(gs,*args,**kwargs): | |
for a in gs: | |
print(glyphs[ord(a)],end="") | |
print("",*args,**kwargs) | |
s = [] | |
for ca in c: | |
ss = [] | |
for cb in c: | |
ss.append(sub(ca,cb)) | |
s.append(ss) | |
def print_drag(inp): | |
substr = "" | |
for ch in inp: | |
substr += glyph_LUT[ch] | |
gens = [] | |
for sa in s: | |
gen = [] | |
for sb in sa: | |
gen.append(crib_drag(sb,substr)) | |
gens.append(gen) | |
while True: | |
for gen in gens: | |
for g in gen: | |
print_glyph(next(g),end = " | ") | |
print("") | |
print("----------------------------------------") | |
input() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment