• unalivejoy@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    You call that russian roulette? This is real russian roulette. Dying is a 1/6 probability.

    #!/usr/bin/env python3
    import random
    
    barrel = [0, 0, 0, 0, 0, 1]
    random.shuffle(barrel)
    
    print("Russian Roulette")
    for i in barrel:
      input("Press enter to shoot")
      if i == 1:
        print("You are dead.")
        exit()
      else:
        print("Phew. You survived.")
    
  • philomory@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Wow, a Lain meme was not something I was expecting.

    I should watch that show again sometime, I still have the DVDs somewhere I think.

  • GluWu@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Fuck off, I know what I’m doing.

    Omg someone please help how did I get this far they’re going to realize I’m stupid when they fire me everything will collapse because it’s all in a single excel file I need to figure out how to live in a tent in the woods and hunt and forage

  • mox@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Perfectly safe on Windows, too. The remove() function doesn’t work on directories.

        • egonallanon@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          Yeah I’m a big fan of it. People complain about the verbosity of it but I like that for readability and autocomplete makes that a non issue I find. Plus if you really want to save on typing when using it as a terminal tool you can just make aliases for all your common commands.

  • random9@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 year 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.