Do it 27 times and you have a million dollars and the IRS all over your ass.
Comment on quick explanation
Barley_Man@sopuli.xyz 3 weeks agooooooooooooooooooooooooooooooooo
00000000000000000000000000000000
88888888888888888888888888888888
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Etterra@discuss.online 3 weeks ago
cypherpunks@lemmy.ml 3 weeks ago
python -c ‘import sys,itertools as it,time as t;a=“o\n”;[(t.sleep( max(.3,1-(i/50))),sys.stdout.write(a),a:=a.replace(*[“o”,“O”,“8”,“oo”][i%3:i%3+2])) for i in it.count()]’Barley_Man@sopuli.xyz 3 weeks ago
What on earth? Works on my machine
Image
Etterra@discuss.online 3 weeks ago
Does that loop infinitely? Because if it does Reddit needs to know ALL about it.
cypherpunks@lemmy.ml 3 weeks ago
The first version I posted would loop infinitely… if you have infinite RAM, that is 🫠 (the string will reach 1KB after 30 iterations, and 1MB after 60, 2MB after 63, and so on).
Fortunately the rate of memory consumption is not too fast because python string replacement is very slow when the string in the megabytes range, but due to your comment, to avoid eventually crashing someone’s computer if they fail to hit ctrl-c, i’ve now edited it to stop after 60 iterations.
here is the original which will in fact run until it runs out of memory:
python -c ‘import itertools as I,time as t;a=“o”;[(print(a),a:=a.replace(*[“o”,“O”,“8”,“oo”][i%3:i%3+2]),t.sleep(max(.3,1-(i/50))))for i in I.count()]’if you don’t hit ctrl-c before consumes all of your RAM, you will be at the mercy of your operating system’s out-of-memory-killer… if it decides to kill something other than this python process you might have a bad time.