Solution to 8 implemented in python using zero self-reference, where you can replace f with code for any arbitrary function on string x (escaping characters as necessary):
f=”x+‘\\n’+x” def ff(x): return eval(f) (lambda s : print(ff(‘f=’+chr(34)+f+chr(34)+chr(10)+‘def ff(x):’+chr(10)+chr(9)+‘return eval(f)‘+chr(10)+s+‘(’+chr(34)+s+chr(34)+‘)’)))(“(lambda s : print(ff(‘f=’+chr(34)+f+chr(34)+chr(10)+‘def ff(x):’+chr(10)+chr(9)+‘return eval(f)‘+chr(10)+s+‘(’+chr(34)+s+chr(34)+‘)’)))”)
Solution to 8 implemented in python using zero self-reference, where you can replace f with code for any arbitrary function on string x (escaping characters as necessary):
f=”x+‘\\n’+x”
def ff(x):
return eval(f)
(lambda s : print(ff(‘f=’+chr(34)+f+chr(34)+chr(10)+‘def ff(x):’+chr(10)+chr(9)+‘return eval(f)‘+chr(10)+s+‘(’+chr(34)+s+chr(34)+‘)’)))(“(lambda s : print(ff(‘f=’+chr(34)+f+chr(34)+chr(10)+‘def ff(x):’+chr(10)+chr(9)+‘return eval(f)‘+chr(10)+s+‘(’+chr(34)+s+chr(34)+‘)’)))”)
edit: fixed spoiler tags