Is there a way to set up an if statement like this where 1 if statement covers multiple integers?
variable = random.randrange(1,10)
if variable is between 1 - 3
then do this
if variable is between 4-5
then do this
if variable is between 6-9
then do this
or maybe something like this
a = 1,2,3,4,5,6,7,8,9,10
variable = random.randrange(1,10)
if variable == a:
then do this
What about choosing a random number for each player, then the player with the largest value gets to attack first.
Or, if this isn’t turn based, then set a threshold, and if the random number is over the threshold, then the player can attack.
The threshold could also be a random number. For example:
The question at the bottom is easy to implement, basically exactly as you’ve written it: