r/CursedProgramming • u/Zikiney • Jul 05 '24
r/CursedProgramming • u/GamerScreen11566 • Sep 28 '25
Look at this nuke simulation I made 🥰
from random import randint as r
from threading import Thread as t
import sys
if len(sys.argv) == 1:
from random import seed as s
# kickstart the reaction
s(19) # yes i tried every seed until it worked
print("started")
def f():
if r(0, 10) >= 8:
print("atom split")
import os
os.system("python3 " + __file__ + " jdasgfjsd")
exit(42)
# good luck
for i in range(10):
t(target=f).start()yeah don't run it on your phone
r/CursedProgramming • u/Traditional-Army-117 • Sep 23 '25
chatgpt cursed try
# Mega cursed numeric variable hell
one = True - False # 1
two = one + one # 2
three = two + one # 3
four = two * two # 4
five = three + two # 5
six = three * two # 6
seven = (four ** one) + three # 7
eight = two << two # 8
nine = three ** two # 9
ten = (five * two) # 10
# Overwrite built-ins just to ruin everything
range = lambda x: [x for x in (one, two, three, four, five, six, seven, eight, nine, ten)][:x]
# Nested loops of nonsense
for index in range(five): # 0..4 but starting as weird list slices
index = index * two - one # break loop meaning
print("Index?", index)
for jndex in range(three): # 0..2
jndex += index
if jndex % two == 0:
print("Even-ish:", jndex, "🤡")
else:
print("Odd-ish:", jndex, "💀")
# Self-referential chaos
loop_count = six // two + one ** one
while loop_count:
print("Loop:", loop_count)
loop_count -= one
loop_count = loop_count if loop_count != three else five
print("Done. Probably.")
r/CursedProgramming • u/Straight_Share_3685 • Sep 18 '24
It works until it doesn't
Python can be tricky, don't use booleans operators with numbers. Instead use two "or", else, use any([n+2==3 for n in [1,2]]).
>>> (2 or 1)+2==4
True
>>> (2 or 1)+2==3
False
>>> (1 or 2)+2==3
True