import random
import math


def get_distance(odd):
    """Advances a horse during one step of the racing simulation.
    The amount travelled is random, but scaled by the odds of the horse"""

    d = random.randrange(1, 100)
    s = math.ceil(odd)
    if d < 10:
        return 1
    elif d < s + 17:
        return 2
    elif d < s + 37:
        return 3
    elif d < s + 57:
        return 4
    elif d < s + 77:
        return 5
    elif d < s + 92:
        return 6
    else:
        return 7