Last active
August 29, 2015 14:16
-
-
Save freundTech/4d0e56fc679e9bb8fc26 to your computer and use it in GitHub Desktop.
Arrayify JS
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
import sys | |
d = { | |
'a': "([]+![])[![]+!![]]", | |
'b': "(typeof(![]))[![]+![]]", | |
'c': "([]+typeof([]))[!![]+!![]+!![]+!![]]", | |
'd': "([]+[][[]])[!![]+!![]]", | |
'e': "([]+!![])[!![]+!![]+!![]]", | |
'f': "([]+![])[![]+![]]", | |
'g': "([]+typeof([]+[[]]))[!![]+!![]+!![]+!![]+!![]]", | |
'h': "\"h\"", | |
'i': "([]+[][[]])[!![]+!![]+!![]+!![]+!![]]", | |
'j': "([]+typeof([]))[!![]+!![]]", | |
'k': "\"k\"", | |
'l': "([]+![])[!![]+!![]]", | |
'm': "([]+typeof(![]+![]))[!![]+!![]]", | |
'n': "([]+[][[]])[![]+!![]]", | |
'o': "([]+typeof([]))[![]+![]]", | |
'p': "\"p\"", | |
'q': "\"q\"", | |
'r': "([]+!![])[![]+!![]]", | |
's': "([]+![])[!![]+!![]+!![]]", | |
't': "([]+!![])[![]+![]]", | |
'u': "([]+[][[]])[![]+![]]", | |
'v': "\"v\"", | |
'w': "\"w\"", | |
'x': "\"x\"", | |
'y': "\"y\"", #Could be gotten from typeof symbol, but it can only be generated by Symbol() | |
'z': "\"z\"" | |
} | |
args = sys.argv[1:] | |
input_ = " ".join(args).lower() | |
output = [] | |
for c in input_: | |
if c in d: | |
output += [d[c]] | |
else: | |
output += ["\""+c+"\""] | |
outputstr = "+".join(output) | |
print(outputstr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment