rfpotrero / The-Gem-in-the-Tower

0 stars 1 forks source link

Create chance_of_encounter function #18

Closed rfpotrero closed 2 years ago

rfpotrero commented 2 years ago
def chance_of_encounter(odds_chance):
    """
    This will calculate the chance of encounter while
    the player search_floor or rest
    Credits to Daniel Poston for the main code
    https://www.datacamp.com/tutorial/statistics-python-tutorial-probability-1
    """
    event_outcome = random.randint(0,10)
    probability = event_outcome * 10
    if probability  >= odds_chance:
        return True