• 418_im_a_teapot@sh.itjust.works
    link
    fedilink
    arrow-up
    16
    ·
    3 days ago

    We could probably improve on that significantly without losing speed.

    return $x < 8
    

    That should yield one additional correct answer, while also confusing anyone who thinks it just returns false.

    And if we just hard coded and checked the first 20 or so primes before always returning false, we would probably get noticeable improvement (depending on the total range).

    • Blass Rose@pawb.social
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      I’ve seen so many game jam entries where the code is like this. Delicately balanced and using so many assumptions to just get the thing out the door.

      It’s funny when they decide to make a full game out of it and realize that it’s gonna take them 6 months just to undo the tech debt of the original “demo”