dimanche 26 avril 2020

How do you slightly randomise already set values in variables? (Difficult to explain)

What I'm trying to do here, is randomise 2 values slightly, by 1-2 or 2-4, something like that. so for example

list = [ -12, 6 ]
for x, y in list:
    MouseMov(x.randchange(1-3), y.randchange(1-3))
    print(x, y)
    # And then the values would be like x = -13,y =  5
    # Or then the next time they could be x = -12, y= 7
    # You get the point, each time it loops, the values change slightly. How do I do this?

How do we make it so each time it loops, the values randomly are changed by 1-3 or whatever range we choose? Hope my question was understandable.




Aucun commentaire:

Enregistrer un commentaire