-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Roulette.py
36 lines (30 loc) · 1.24 KB
/
Roulette.py
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
import os
import random
import sys
import time
win_probability = 1.0 # Initial win probability
file_path = os.path.realpath(__file__)
print("DISCLAIMER: This game has a unique feature where it will delete itself from your system if you lose. This means that the Python file you're running will be permanently removed from its directory, which is irreversible. This feature is intended for entertainment purposes and is used to add suspense. By choosing to play, you acknowledge and accept these terms. Do you agree to this? (y/n)")
agree = input()
if agree.lower() != "y":
print("You chose not to play. Exiting game.")
sys.exit()
first_play = True
while True:
if first_play:
play = input("Do you want to play? (y/n): ")
first_play = False
else:
play = input("Would you like to risk it again? (y/n): ")
if play.lower() != "y":
print("Exiting game.")
break
print(f"Your current winning probability is {win_probability*100}%")
if random.random() < win_probability:
print("You won!")
win_probability *= 0.95 # Decrease the win probability by 5%
else:
print("You lost! The game will now delete itself.")
time.sleep(5)
os.remove(file_path)
sys.exit()