def fitness_fn(turns, energy, isDead):
    """Fitness function that scores based on turns and energy.

    Provides a score to a creature, with 3 times the amount of turns
    plus the energy, with a bonus for surviving.

    Args:
        turns: number of turns a creature survived.
        energy: amount of energy left after simulation.
        isDead: boolean of death state.
    Returns:
        int: score based on function calculation
    """
    if (isDead):
        return (3*turns) + energy
    else:
        return (3*turns) + energy + 120