• random9@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    9 months ago

    isn’t randint range inclusive? thus random.randint(0, 6) == 1 has a 1 in 7 chance, not 1 in 6. Most revolvers, assuming this is emulating russian roulette, have 6 cylinders, not 7.

    • nifty@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      9 months ago

      You’re right. I didn’t make this, but maybe the creator was accounting for the round in the chamber? I don’t guns, so no clue.

      • random9@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        9 months ago

        Revolvers don’t have the concept of one-in-the-chamber, only semi-auto pistols do, and you can’t play russian roulette with semi-autos :P (well you could, but 99% of the time, barring unexpected jams, the first person to go would lose)

        Anyway I’m guessing it’s a bug :) - as the saying goes “no code is too short to be bug-free”

        • nifty@lemmy.worldOP
          link
          fedilink
          arrow-up
          2
          ·
          9 months ago

          Good to know! Makes it easier to decide what to get next time I play Russian roulette.