What started as a attempt to make a quine turned into a chaotic-1 line destruction code.
This increases the system recursion limit to its max and makes a fork bomb
Such code can be copy pasted into a insecured server and destroy it completely.
Check it out and try to make it simpler if it is even possible
I don't get the point
this is the best i could do but it goes across multiple lines
def x():x()
import sys;sys.setrecursionlimit(9**9);x()
its 4 characters shorter including the newline, but obviously it isnt one line so its sort of cheating
EDIT:
never mind! ive manged to make it a whole 3 characters shorter than yours AND its on one line!
import sys;sys.setrecursionlimit(9**9);x=lambda:x();x()
#import sys;s='exec(s)';sys.setrecursionlimit(9**9);exec(s)
Yo, this is like the most useful post I've seen so far, now I can go troll my friends woohoo
The pinnacle of perfection in coding. This one line can be inserted anywhere into a code and completely destroy it. Hmm wonder if I can hack into the repl database and put it into other people's code 🤔🤔🤔
Also I didn't know recursion limit was a thing. How every educational ;)
good to see the community still upvotes actually cool code implementation instead of just games!
What is a recursion limit? I tried running the code without the limit and it stopped after 496. Does the recursion limit increase that number?
@DynamicSquid Basically a limit on how many times a function can call itself. Removing the recursion limit / setting it to a really high number means that the function executes itself over and over until the python interpreter seg-faults
LoL
Haha! @CodeLongAndPros is gonna unlist this post for low effort immediately. Smh...good job! Hope this doesn't get taken down by mods.
@JosephSanthosh I don’t know, I think it’s actually pretty cool. Now breaking a eval builtins={} and segfaulting…
@CodeLongAndPros Wait, theres a event? I never wanted this to be in the event, but thats cool!
@AcceleratedCode Wait what
The 10k Grand Prize event, that one? Wait, do we have to apply or do mods choose it from the share / tell section? I am a little confused
@AcceleratedCode
The 10k grand prize event is the programming language jam. You and a team of people have to create a programming language.
It ended near the end of August and the judges are currently judging the submissions. No more submissions are allowed.
This repl is not a part of the event.
@EpicGamer007 Oh... I thought the judges would review programs and see the best one, thats cool though
Lol, this is cool. Nice!!
@AcceleratedCode Let me take a wild guess where this is crashing at:
Where you execute the s variable, since you are executing a variable that is yet again executing itself..etc..etc
@MocaCDeveloper It would normally crash with recursion limit, but setting it to 9**9 (really high number) would mean there isn't a limit, and then it segmentation fault-crashes, which can't be caught by a except loop, which is why this is so dangerous
@AcceleratedCode 9 to the power of 9 is 387420489, according to google. Massive number, so SIGSEGV
.
Thing is this only works in python