'Reinvent the “import random” feature
I am making a Rock Paper Scissors game but I can’t use the import random and I do not know how reinvent it, I have a idea how and that is using percentages like there is a 33% chance to throw rock and 33% for every other throw but I cannot use the import random feature! Any help???
Solution 1:[1]
You can read the time when the program/function starts to run, divide it by 3 and check the remainder:
import time
x = int(time.time())
a = x % 3
a has 1/3 probability to be either 0, 1 or 2.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | TDG |
