Skip to content

Instantly share code, notes, and snippets.

@oprypin
Created July 14, 2015 20:26
Show Gist options
  • Save oprypin/2e22bc75ac3b463fa025 to your computer and use it in GitHub Desktop.
Save oprypin/2e22bc75ac3b463fa025 to your computer and use it in GitHub Desktop.
Inception
%if False:
print(5)
print("a")
print("lol")
for i in range(10):
%if True:
print(6)
print(8)
for c in "hello world":
%for c in 'abcdefghijklmnopqrstuvwxyz':
if c == '{{c}}':
%for i in [1, 2]:
print('{{chr(ord(c)+i)}}')
%if True:
print("lol")
def nimception_result():
result = ""
if False:
result += "\nprint(5)"
result += "\nprint(\"a\")"
result += "\nprint(\"lol\")"
result += "\nfor i in range(10):"
if True:
result += "\n print(6)"
result += "\n print(8)"
result += "\n"
result += "\n"
result += "\nfor c in \"hello world\":"
for c in 'abcdefghijklmnopqrstuvwxyz':
result += "\n if c == '"+ str(c) +"':"
for i in [1, 2]:
result += "\n print('"+ str(chr(ord(c)+i)) +"')"
result += "\n"
if True:
result += "\nprint(\"lol\")"
return result[1:]
print("lol")
for i in range(10):
print(6)
print(8)
for c in "hello world":
if c == 'a':
print('b')
print('c')
if c == 'b':
print('c')
print('d')
if c == 'c':
print('d')
print('e')
if c == 'd':
print('e')
print('f')
if c == 'e':
print('f')
print('g')
if c == 'f':
print('g')
print('h')
if c == 'g':
print('h')
print('i')
if c == 'h':
print('i')
print('j')
if c == 'i':
print('j')
print('k')
if c == 'j':
print('k')
print('l')
if c == 'k':
print('l')
print('m')
if c == 'l':
print('m')
print('n')
if c == 'm':
print('n')
print('o')
if c == 'n':
print('o')
print('p')
if c == 'o':
print('p')
print('q')
if c == 'p':
print('q')
print('r')
if c == 'q':
print('r')
print('s')
if c == 'r':
print('s')
print('t')
if c == 's':
print('t')
print('u')
if c == 't':
print('u')
print('v')
if c == 'u':
print('v')
print('w')
if c == 'v':
print('w')
print('x')
if c == 'w':
print('x')
print('y')
if c == 'x':
print('y')
print('z')
if c == 'y':
print('z')
print('{')
if c == 'z':
print('{')
print('|')
print("lol")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment