cm0002@lemmy.world to Programmer Humor@programming.dev · 4 days agoInfallible Codefeddit.ukimagemessage-square27linkfedilinkarrow-up1185
arrow-up1185imageInfallible Codefeddit.ukcm0002@lemmy.world to Programmer Humor@programming.dev · 4 days agomessage-square27linkfedilink
minus-squarekolorafa@lemmy.worldlinkfedilinkarrow-up6·4 days agoBetter/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?
minus-squareTheFogan@programming.devlinkfedilinkEnglisharrow-up3·edit-24 days agoor 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.
minus-squarechuckleslord@lemmy.worldlinkfedilinkarrow-up3·4 days agoYandere Simulator Dev. Spaghetti code throughout
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?
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.
Yandere Simulator Dev. Spaghetti code throughout