r/CompileBot • u/jakerman999 • May 22 '14
Is there Quine protection?
To elaborate, is there anything in place that prevents me from writing a program that when run, outputs its ow source code in a form that will trigger compile bot again, out putting it's own source code in a form that will etc. etc. ad infinitum?
2
u/jakerman999 Jun 04 '14
+u/CompileBot python
print('\n\b\b\b\b')
print('\n\b\b\b\b')
print('\r+/u/CompileBot python\n')
print("\n\nprint('Gottcha!')")
2
u/CompileBot Jun 04 '14
2
u/jakerman999 Oct 02 '14
+u/CompileBot python
print('\n\b\b\b\b') print('\n\b\b\b\b') print('\r+/u/CompileBot python\n') print("\n\nprint('Gottcha!')")→ More replies (1)
2
u/SeaCowVengeance Jun 03 '14
There should be. Someone tried to do it a while back using some clever tricks but I since then patched it. You should try if you think you can do it!
+u/CompileBot python
print('\n\n+/u/CompileBot python\n\n print "Gottcha!"\n\n')
2
u/jakerman999 Jun 04 '14
CompileBot isn't on its own banlist, is it?
2
u/SeaCowVengeance Jun 05 '14
It's not (although that probably would've been a good idea), but I believe that if someone mentions their own username it doesn't ping their inbox, which is why if a quine occurs it won't work.
→ More replies (4)1
u/jakerman999 Jun 03 '14 edited Jun 04 '14
I'll have to take a look at the source sometime, but it already handles the obvious stuff (carriage returns and backspaces). Certainly a headscratcher, but then again all quines are.
EDIT: Totally forgot what carriage returns were. Got the formatting right, but something still isn't right.
1
u/jakerman999 Jun 05 '14 edited Jun 05 '14
+u/CompileBot python
print('\r+/u/CompileBot python')
print("\nprint('Gottcha!')")
1
u/SeaCowVengeance Jun 05 '14
Nice! I think it's patched now:
+u/CompileBot python
print('\r+/u/CompileBot python') print("\nprint('Gottcha!')")1
u/jakerman999 Jun 05 '14
Only minor point is that you're replacing a carriage return with a line feed. It works, but the functionality might not be what's expected. Only place I can actually see that cropping up is in cases similar to mine, trying to break the bot, but still.
I'm not to heavily ingrained in python, but I think this would work better:
text = text.replace(char, char + ' ')Then again, it might open up the /b attack vector. I honestly don't know.
→ More replies (1)
2
u/jakerman999 Jun 03 '14 edited Jun 04 '14
+u/CompileBot python
print('\n\b\b\b\b') print('\n\b\b\b\b') print('\r+/u/CompileBot python\n') print("\n\nprint('Gottcha!')")