• @[email protected]
    link
    fedilink
    912 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?

    • da_cow (she/her)
      link
      fedilink
      1012 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.

    • @[email protected]
      link
      fedilink
      English
      5
      edit-2
      12 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.