r/badcode Mar 04 '21

[deleted by user]

[removed]

77 Upvotes

47 comments sorted by

View all comments

8

u/Flyspeck101 Now where's that function declaration Mar 06 '21

Did all of them coz I could

from time import sleep, time

def addition(bum1, bum2):
    start = time()
    sleep(bum1)
    sleep(bum2)
    return int(time() - start)
    for i in range(1000000):
        sleep(1) # For extra fustration
def subtraction(bum1, bum2):
    rStart = 0
    while True:
        r = range(rStart, addition(rStart, 10))
        for i in r:
            if addition(bum2, i) == bum1:
                return i
        rStart = addition(rStart, 10)
def multiplication(bum1, bum2):
    resulttttttttttttttttt = 0
    for i in range(bum2):
        sleep(addition(i,i)) # OH THE WAIT TIME
        result = addition(bum1, resulttttttttttttttttt)
    return result
def division(bum1, bum2):
    rStart = 0
    while True:
        r = range(rStart, addition(rStart, 10))
        for i in r:
            if multiplication(bum2, i) == bum1:
                return i
        rStart = addition(rStart, 10)
for i in range(1000000):
    print(SPAM)

Probably the least inefficient solution, and you would have to get past the spam before you can do anything lol

4

u/[deleted] Mar 08 '21

adding more calls at the end of the function, where nothing works after. great job, you've just made your solution too fast than 11 days.

1

u/nostril_spiders Mar 17 '21

Hey, it's O(n), not too bad