r/shittyprogramming • u/miggyb • Dec 09 '14
r/shittyprogramming • u/Kattzalos • Jul 11 '16
What's this Pokemongo everyone is on about? I've never heard of this database before
is it web scale?
r/shittyprogramming • u/Monkey_Adventures • Aug 16 '20
What's the point of breakpoints when I can do this?
r/shittyprogramming • u/roemerb • May 23 '16
[low effort] This makes me very sad
r/shittyprogramming • u/MinecraftBoxGuy • Oct 21 '18
They both have point in their names.
r/shittyprogramming • u/dxequalssigmaxsquare • Jan 31 '17
<wrong_sub>this</wrong_sup> Meanwhile in a multinational company...
r/shittyprogramming • u/quadrillio • Jul 18 '20
super approved Raytracer written in bbc basic
r/shittyprogramming • u/r_dc • Nov 28 '18
Thanks for the tip, shitty Korean mobile game!
r/shittyprogramming • u/[deleted] • May 16 '22
Babe wake up, new encryption scheme just dropped
r/shittyprogramming • u/ean_dream • Mar 14 '17
If C++ is so much safer than C, then why I have I been dealing with so much stds after I started working with C++!?
r/shittyprogramming • u/frublox • May 20 '19
super approved Getting started with Python: "Hello World"
p = list(map(lambda _: ord(_) - 0x21, "!!&!!dzăC|"))
i = "DÒVV×0Ë×YVR "
while p[2] < len(p):
if (p[p[2]] & 0xC0) >> 6 == 0:
p[p[p[2]] & 0x07] = (p[p[2]] & 0x38) >> 3
elif (p[p[2]] & 0xC0) >> 6 == 1:
if (p[p[2]] & 0x38) >> 3 == 0:
p[0] = ((((ord(i[0]) - 0x20) & 128) >> 7) | ((ord(i[0]) - 0x20) << 1)) & 0xFF
i = i[1:]
p[p[p[2]] & 0x07] = p[(p[p[2]] & 0x38) >> 3]
if p[p[2]] & 0x07 == 1:
print(chr(p[1]), end="")
elif (p[p[2]] & 0xC0) >> 6 == 2:
p[p[p[2]] & 0x07] = (p[p[2]] & 0x38) >> 3 + p[p[p[2]] & 0x07]
else:
p[p[p[2]] & 0x07] = p[(p[p[2]] & 0x38) >> 3] + p[p[p[2]] & 0x07]
p[2] += 1
p[4] = 1 if p[3] == 0 else 0I know some of the non-Pythoners out there will be a bit confused. Let's walk through it line-by-line, together.
p = list(map(lambda _: ord(_) - 0x21, "!!&!!dzăC|"))Set up some memory to be used by a virtual CPU.
i = "DÒVV×0Ë×YVR "The desired text to display. For security, I've encrypted it with a military-grade encryption scheme.
⠀A blank line to give your eyes a little breather.
while p[2] < len(p):Make sure we're not reading too far outside of memory (the other bounds check will come in v2.0).
if (p[p[2]] & 0xC0) >> 6 == 0:Decode the current instruction, and check if its opcode is 0. The >> 6 makes the code run 6 times faster (we must be careful to not go too fast, so I use smaller amount sometimes).
p[p[p[2]] & 0x07] = (p[p[2]] & 0x38) >> 3Handle opcode 0: store an immediate value at a memory address.
elif (p[p[2]] & 0xC0) >> 6 == 1:Check for opcode 1.
if (p[p[2]] & 0x38) >> 3 == 0:The addresses 0 and 1 are mapped to input and output, respectively. Here we check if the first operand will read from address 0, i.e. the input.
p[0] = ((((ord(i[0]) - 0x20) & 128) >> 7) | ((ord(i[0]) - 0x20) << 1)) & 0xFFRead a byte of the input and store it at address 0 (decrypting it first, of course).
i = i[1:]Lop off the read byte. It is of no use to anyone now.
p[p[p[2]] & 0x07] = p[(p[p[2]] & 0x38) >> 3]Pretty self-explanatory.
if p[p[2]] & 0x07 == 1:Check if something was written to the output address.
print(chr(p[1]), end="")I forgot what this does, to be honest.
elif (p[p[2]] & 0xC0) >> 6 == 2:Time to move to opcode 2.
p[p[p[2]] & 0x07] = (p[p[2]] & 0x38) >> 3 + p[p[p[2]] & 0x07]Addition: a useful function of any CPU.
else:Due to budget constraints, there are only 4 opcodes for our CPU.
p[p[p[2]] & 0x07] = p[(p[p[2]] & 0x38) >> 3] + p[p[p[2]] & 0x07]More addition.
p[2] += 1Move on to the next instruction.
p[4] = 1 if p[3] == 0 else 0Personally, I find flags disgusting. I am no match against project management's requirements, however.
And that's it! I hope this inspires you to get out there and start coding in the language of the future, Java.
r/shittyprogramming • u/octotesticles • Jul 22 '15
Not *exactly* programming, but I had to use excel today and needed to display zeros as blanks. Googling turned up Microsoft's solution: color them white.
r/shittyprogramming • u/UnderPressureVS • Jun 28 '21
Just got this question on a Java practice test, and I'm so fucking confused
r/shittyprogramming • u/vicinorum • Sep 22 '16
super approved PSA: Avoid the company 'localhost', their service sucks!
They only show my website at my house! So much for the World Wide Web.
r/shittyprogramming • u/MaxCHEATER64 • Oct 25 '15
super approved I'm having a syntax error in my Perl script. Can someone debug it for me? This is it: ((((((((((()(((()))))))))()()())()))))(()))()())(()()())))))()))(()())())))())()()()())((()))()((())()()())())())))()()()))())()((())()())()))()()()()))()()())))())()()))(()())())))()((()()()())(()))(()((()())())()
r/shittyprogramming • u/Lopsidation • Jan 21 '15