• Zikeji@programming.dev
    link
    fedilink
    English
    arrow-up
    17
    ·
    3 days ago

    So if it has to be a number the question is - is the array of options, ['Fish', 'Bird'], 0-indexed or not? I guess 1 is the safest choice but not true to your actual choice.

    • wizardbeard@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      15
      ·
      edit-2
      3 days ago

      Just for you, I’d enter 18,446,744,073,709,551,616

      Explanation

      18,446,744,073,709,551,615 is the max value an unsigned 64-bit long value can store. It’s absurdly unlikely that any data indexing format supports this many indexes. Then I added 1 to it. 🫠

      For when you absolutely, positively, need to make sure you’re out of bounds.

      Negatives aren’t enough, because some programming languages allow you to index from the other end using negatives, so -1 is the final item.

      • porous_grey_matter@lemmy.ml
        link
        fedilink
        English
        arrow-up
        7
        ·
        3 days ago

        It’s Google forms. I’m pretty sure they’ll handle this case.

        Anyway, it’s not that unlikely, for example, python’s ints are arbitrary length (and convert to bigint under the hood when needed) and can just directly be used as hashmap/dictionary keys.

  • sem@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    14
    ·
    3 days ago

    6 and 9 are both fishy digits, one is swimming up, the other down.

    3 is the bird in flight, but sideways. I guess 7 could be a gliding bird, seen in perspective, also sideways.

    • ChaoticNeutralCzech@feddit.org
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      21 hours ago

      2 is a swan
      817 is an open-beaked screaming hatchling
      -2 is a seahorse
      .5 is a sitting bird
      6.6 is an owl
      -5e7 is a nesting chicken
      -5.43 is a peacock
      8008 is a tit

      0 is an egg. Bird, fish, amphibian, reptile, who can tell? Truly a neutral answer - neither positive nor negative.

      To help you visualize:

      Also, number 4 in different scripts looks quite fishy ૪ or quite birdy ۴.

      Edit: Aaaaaa, I fell into the rabbit hole of Unicode digits looking like swans and flamingos ᪇᪄ ᮳ ᱁᱆ ᱒᱙ ꘥ ꣙ ꤃ 𑑘𑑕 𑱗𑱕 𑱕𑱔 𖩢

        • ChaoticNeutralCzech@feddit.org
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          21 hours ago

          What is possible depends on your definition of “number”, for example the Unicode digits mentioned only match \d (digit) in some Regex implementations. And some cultures don’t have digits, for example Roman “Ⅴ” and old Italic “𐌡” (both mean 5 and look like an incoming flying goose) are numerals and never pass as \d. And Egyptian hieroglyphs 𓆏 (frog) or 𓆐 (tadpole but looks more like a parrot to me) can mean 100,000 but I haven’t seen them called numerals or digits. Neither the eel-like 𔗄 Anatolian hieroglyph for 1000.

          I focused on strings that a computer might spit out when asked to print a float but that might include “-Inf” (rooster in grass?), which mathematicians don’t consider a number. However, they consider √7̅ (flying swan) a number, also “φ” (flamingo) aka golden ratio, equal to (√5̅+1)/2, and even complex numbers like -5+7i (flying bird with ornate tail). If you imagine a proper vertical fraction, ¼𝑒 (approx. 0.67957) could be a more detailed, wading flamingo. Coders will know what number -0xD7 (yet another sideways nesting/flying bird) is. And in some electrical engineering software, 1M7 (ostrich showing off its wings) means 1.7 million, 1p7 means 1.7 trillionths and 87j (rotate 90° right to see a chicken pecking at a seed) is the standard way to write “amplitude 87, phase 90°” - “j” is used for √-̅1̅ because “i” means current. However, most software, and likely this form, won’t accept non-Latin numbers, math symbols and engineers’ shortcuts (maybe the e/E for ⏨-exponent).