Rusian Roulette Simulation
(Python)
import random as rand
shots = 0
rounds = 0
best = 0
while True:
shots += 1
rounds += 1
x = rand.randint(1, 6)
if x == 1:
if shots > best:
best = shots
print(str(rounds) + ": " + str(best))
print("=============")
shots = 0
Explanation
This Python script aims to simulate rounds of Russian Roulette by generating a random integer between 1 and 6.
Then, the code checks if that number equal to 1. If it is, the code checks if the number of shots is greater than the highest number of shots.
This essentially means that the bullet was shot the highest amount of times during the simulation's lifetime.
It then prints the number of rounds simulated followed by the highest streak; with a divider line to seperate each entry.
If you think the while True loop will cause your computer to explode, you can change it to something like this:
while i < 1000000000:
Credits
One of my friends from real life (who shall not be named (but I will link his GitHub)),
SUPERDERP1