ITT: post some of your shittiest code

ITT: post some of your shittiest code

Other urls found in this thread:

raw.githubusercontent.com/iamevn/fun/master/tree/tree.bit
dangermouse.net/esoteric/bit.html
udemy.com/sara-learns-to-code-making-an-app-from-scratch/
twitter.com/NSFWRedditGif

this is only the first part of it, the rest of it is just more of the same

import datetime
a=datetime.date.today()
b=(str(a))
c=(int(b[5:7]))
d=(int(b[8:10]))
e=datetime.date.today().isoweekday()
f=datetime.datetime.now().time()
g=(str(f))
h=(g[0:2])
i=(g[3:5])
j=(h+i)
k=(int(j))
l=(g[2:5])
m=(g[0:5])
n=(str(" "))
o=(str("AM"))
p=(str("PM"))
def time():
if k

For what purpose

Sup Forums doesn't actually code lmao

To shitpost

1
2
3 4

//get date +24 hours
Sleep(24h);
Echo date(H:m:s);

There was that challenge during Christmas season a few years ago to write a program to draw a tree.

Well here's one of mine raw.githubusercontent.com/iamevn/fun/master/tree/tree.bit

theurl = "ipaddresslocation.org/ip-address-locator.php?lookup={0}".format(ip_address)
f = urllib.request.urlopen(theurl)
website = f.read()
def striphtml(data):
p = re.compile(r'^(.*)(?=IP Country Code:)')
return p.sub('', data)
def striphtml2(data):
p = re.compile(r'(?=IP Latitude:).*')
return p.sub('', data)
def striphtml3(data):
p = re.compile(r'')
return p.sub('', data)
def striphtml4(data):
return re.sub(r"\\nIP ", "\n•", data)
df = striphtml(str(website))
lo = striphtml2(str(df))
lol = striphtml3(str(lo))
result = striphtml4(str(lol))
print(result)
This was from a long time ago and since I've learned the error of my ways.

what language is this

BIT dangermouse.net/esoteric/bit.html

Looking back, I have a line something like this:
return hex_to_binary(plaintext_to_hex(text)));

lel, genius

// PHP & JAVA & Perl & Python & C++...
return ( x >= y );

All of my code is perfect relative to the system it'll be running on, just like I'm perfect relative to all the machines that the universe affords existence.

So there.

Had couple interviews for internship (not even a job).
In one was asked to write something similar to FizzBuzz, was nervous and fucked it up.
mfw the companies do not want me even for free.

>have to make a GUI in a game engine
>instead of creating a Button class I checked if the mouse cursor is within a certain area on the screen

I had this same shit and during the interview I got mad at the disrespecting cunts so I made it print fuck you instead of fizzbuzz, lel I'm a comedic genius

what exactly is wrong with it?

NO

start = int(input("from:"))
end = int(input("to:"))
yes = set(['y'])
no = set(['n'])
print ("Do you want numbers that are not Fizz/Buzz/Fizzbuzz to be printed? [y/n]")

choice = input().lower()
if choice in yes:
print ("")
print ("Doing fizzbuzz from", start, "to ", end)
print ("")
for count in range(start, end+1):
if (count % 5) == 0 and (count % 3) == 0:
print ("Fizzbuzz", count)
elif (count % 3) == 0:
print ("Fizz", count)
elif (count % 5) == 0:
print ("Buzz", count)
else:
print (count)

if choice in no:
print ("")
print ("Doing fizzbuzz from", start, "to ", end)
print ("")
for count in range(start,end+1):
if (count % 5) == 0 and (count % 3) == 0:
print ("Fizzbuzz", count)
elif (count % 3) == 0:
print ("Fizz", count)
elif (count % 5) == 0:
print ("Buzz", count)

>elif not choice: print(count)

...

Classic

loop ;grob
{
PixelSearch,,y2, 520, y1-100, 590, y1, 0xDD4443, 0, fast RGB ;red
if !ErrorLevel
break
PixelSearch,,y2, 520, y1-100, 590, y1, 0x71F3FF, 0, fast RGB ;blue
if !ErrorLevel
break
y1-=100
if (y1 < 0 and detectRetry = 0)
{
y1 := windowheight
detectRetry = 1
sleep 300
}
else if (y1 < 0 and detectRetry = 1)
{
chop := windowheight-50
return
}
}
y2+=100
loop ;fein
{
PixelSearch,,y3, 520, y2-30, 590, y2, 0xDD4443, 0, fast RGB ;red
if !ErrorLevel
break
PixelSearch,,y3, 520, y2-30, 590, y2, 0x71F3FF, 0, fast RGB ;blue
if !ErrorLevel
break
y2-=30
if (y2 < 0)
{
chop := windowheight-50
return
}
}
y3+=30
loop ;sehr fein
{
PixelSearch,,y4, 520, y3-5, 590, y3, 0xDD4443, 0, fast RGB ;red
if !ErrorLevel
break
PixelSearch,,y4, 520, y3-5, 590, y3, 0x71F3FF, 0, fast RGB ;blue
if !ErrorLevel
break
y3-=5
if (y3 < 0)
{
chop := windowheight-50
return
}
}
if y4 < 45
chop = 0
else
chop := windowheight-y4-17
return

Story:
Pixelsearch would give the coordinates of the first pixel found with the specified hex color.
Problem is, that it searches from left to right and from top to bottom.
I had to search from bottom to top though to find the bottom result.
Since there was no working alternative, I tried just searching line by line from bottom to top but it was extremely slow. So I did it like this which still works almost instantly and does search from bottom to top.

udemy.com/sara-learns-to-code-making-an-app-from-scratch/

Has no one showed them a for / while loop?
Hell, the for loop wouldn;t necessarily even need a body.

I think mostly guys buy this course.

go do it if you're so smart?
that's an interview question btw
most people get it wrong

I know I will torrent the shit out of it the moment it comes out

I would post some code from the Tinder app if I could.
>turn off high accuracy GPS mode
>app spams you with requests to turn it back on
>it will even bring the app from background back into focus to request turning it back on
>turn off wifi for a moment
>app spams you with requests to turn on wifi network detection while wifi is disabled
I even emailed them about it saying that high accuracy isn't even required because the app doesn't need your pinpoint location, it's not like a mapping app, within a kilometer makes no fucking difference, and that spamming requests is bad design and they just emailed back saying that high accuracy mode was required.

I don't doubt that it is required because they get paid by Google/Facebook to enforce it.

>go do it
int somefunction (int base, int mult) {
int result = 0;
while (mult > 0) {
result += base;
--mult;
}
return result;
}

nope, try again.

Just put it on pornhub

Your gif moves too fast and I'm not opening it in something else.

I also saw you post in the DPT a few weeks ago.

>not speed reading

for x in range(1, 101):
if x == 1:
print("1")
elif x == 2:
print("2")
elif x == 3:
print("Fizz")
elif x == 4:
print("4")
elif x == 5:
print("Buzz")
elif x == 6:
print("Fizz")
elif x == 7:
print("7")
elif x == 8:
print("8")
elif x == 9:
print("Fizz")
elif x == 10:
print("Buzz")
elif x == 11:
print("11")
elif x == 12:
print("Fizz")
elif x == 13:
print("13")
elif x == 14:
print("14")
elif x == 15:
print("FizzBuzz")
elif x == 16:
print("16")
elif x == 17:
print("17")
elif x == 18:
print("Fizz")
elif x == 19:
print("19")
elif x == 20:
print("Buzz")
elif x == 21:
print("Fizz")
elif x == 22:
print("22")
elif x == 23:
print("23")
elif x == 24:
print("Fizz")
elif x == 25:
print("Buzz")
elif x == 26:
print("26")
elif x == 27:
print("Fizz")
elif x == 28:
print("28")
elif x == 29:
print("29")
elif x == 30:
print("FizzBuzz")
elif x == 31:
print("31")
elif x == 32:
print("32")
elif x == 33:
print("Fizz")
elif x == 34:
print("34")
elif x == 35:
print("Buzz")
elif x == 36:
print("Fizz")
elif x == 37:
print("37")
elif x == 38:
print("38")
...

My realtime visual memory buffer is poor. I can only speed read if my eyes are moving and the background is textured.

When first learning programming (in C), I wanted to check user inputs. I did it like this.

if(input[0] == 'S' && input[1] == 't' && input[2] == 'r' && input[3] == 'i' && input[4] == 'n' && input[5] == 'g' && input[6] == '1') {}
else if(input[0] == 'S' && input[1] == 't' && input[2] == 'r' && input[3] == 'i' && input[4] == 'n' && input[5] == 'g' && input[6] == '2') {}
else if(input[0] == 'S' && input[1] == 't' && input[2] == 'r' && input[3] == 'i' && input[4] == 'n' && input[5] == 'g' && input[6] == '3') {}


Some of the strings I compared this way were pretty damn long.

Should use a switch case.