Search code examples
pythonrandom-walk

In python random walker ,how can I set a random starting point instead of setting origin?


I'm trying to implement a random walker in python.But I want to set a random starting point instead of initialize the first position.how can i set a random starting point?


Solution

  • I don't know how you structured the code but generally it does this:

    import random
    x = random.randint(Min_x,Max_x)
    y = random.randint(Min_y,Max_y)
    
    [your loop code...]