278
Infallible Code (feddit.uk)
you are viewing a single comment's thread
view the rest of the comments
[-] kolorafa@lemmy.world 11 points 5 days ago

Better/fastest approch would be to check the last bit of the int and return the result. Second use modulo.

This? Dev should burn in hell. Who created this?

[-] cows_are_underrated@feddit.org 12 points 5 days ago

Alternatively you can divide by 2, turn it into an int, mtiply it by 2 and check if both numbers are the same.

[-] TheFogan@programming.dev 5 points 5 days ago* (last edited 5 days ago)

or another stupid, but viable way to do it,

if number = 0:

return true

runloop = true

while runloop:

if number > 0:

number -= 2

else:

number += 2

if number = 1:

return false

runloop = false

if number = 2:

return true

runloop = false

still very shitty amature coding, doesn't depend on modulos, or anything that I can think of that some languages might lack an equivelant of.

[-] chuckleslord@lemmy.world 5 points 5 days ago

Yandere Simulator Dev. Spaghetti code throughout

this post was submitted on 15 Jul 2025
278 points (94.3% liked)

Programmer Humor

25111 readers
891 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS