More believable for a Linux OS
More believable for a Linux OS
More believable for a Linux OS
You call that russian roulette? This is real russian roulette. Dying is a 1/6 probability.
py
#!/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.")
I love this, except for i
i hate i
.
I always use i because I'm too lazy to type out iterator when I'm making my garbage spaghetti code that will support infrastructure for years
I like it, i for int easy to remember. I also use i, j, k as u it vectors and remember at what depth of a multidimentional array in working at.
You forgot the switch.
That can't remove a directory.
Perfectly safe on Windows, too. The remove() function doesn't work on directories.
And Windows nowadays have like dozen of different security measures that stop you from removing critical system components. It is not like in Windows 95 days, that OS allowed you to remove kernel by just typing a single command.
And much like Windows, everything dangerous is done better elsewhere.
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.
"And you don't seem to understand..."
A shame you seemed an honest man...
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
OSError: File or directory not found "C:WindowsSystem32"
Nope. From the spec:
"Unlike Standard C, all unrecognized escape sequences are left in the string unchanged, i.e., the backslash is left in the result."
This behavior is useful when debugging: if an escape sequence is mistyped, the resulting output is more easily recognized as broken.
Wow, this sentence really threw me for a moment. I had no idea how other programming languages behave.
...which makes sense, because they don't. The compiler just tells you to fuck off and that's the end of that story. I guess, they can't do that in Python...
Thought I'm on lainchan for a minute
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.
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.
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"
Oh hell, you gave me a PTSD flashback!
It's the late 90s. My mother suddenly discovers File Explorer on her refurbished commodity Wintel box and decides that all this messy clutter has to go. Never mind that the drive was 80% empty when delivered and I didn't expect her to come close to filling it before it was replaced. Fortunately I had already backed up everything that looked important or interesting.
One day she calls from the office, "I don't need this 'Windows' any more, do I?"
"What? Wait! Don't do anything!" I walk in and she's got C:/Windows highlighted and the cursor is hovering over "Delete".
"I already have Windows installed on this computer, so I don't need this any more, do I?" Spoken more as a statement than a question. It took several minutes of forced calm explanation to get her to accept that this "Windows" directory WAS the Windows that's installed on the machine. She still wasn't happy that she could see it in File Explorer, though. So untidy!
Let's all love lain.