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.")
And maybe the fact that you have to continue until the gun actually fires :|
That can’t remove a directory.
Perfectly safe on Windows, too. The remove() function doesn’t work on directories.
I’m curious. Does anyone like PowerShell, and the syntax you end up with?
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.
I work pretty frequently with PS and have no issues with syntax. It’s easy to read and you always have autocomplete so there is just 1 extra click to get from -r to -Recurse. Same command could be also written as this due to alias feature.
rm 'C:' -r -fo
It’s just not the best practice since in PowerShell it is recommended to not use aliases for readability reasons. Also less chance to mess things up due to how verbose all commands and their parameters are.
Powershell isn’t perfect, but I like it a lot more than anything that takes sh
as a major influence or thing to maintain backwards compatibility with. I don’t think the Unix philosophy of having lots of small tools that do one thing and do it well that you compose together has ever been achieved as I think being consistent with other tools you use at the same time should be part of doing your thing well, and things like sed, grep and perl all having different regular expression syntax demonstrate inconsistency and are easy to find. I also like that powershell is so verbose as it makes it much easier to read someone else’s script without knowing much powershell, and doesn’t end up getting in the way of actually writing powershell as the autocomplete is really good. I like having a type system and structured data, too.
Some of these things are brought to a unixier shell with nushell, but I’m not convinced it’ll take off. Even if people use it, it’ll be a long while before you Google a problem and the solution also includes a nushell snippet, whereas for any Windows problem, you’ll typically get a GUI solution and a powershell solution, and only a maniac would give a CMD solution.
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.
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