Changing coordinates with a condition
I have 500×500 grid and random coordinates on this grid. I’m trying to get new random coordinates but they shouldn’t be too close to the previous ones. I’m come up with this: In an infinite loop I assign a new random value to a variable and if this value satisfies the condition (it’s bigger or smaller on a certain quantity (which may change)) then I’m breaking the loop.
Changing coordinates with a condition
I have 500×500 grid and random coordinates on this grid. I’m trying to get new random coordinates but they shouldn’t be too close to the previous ones. I’m come up with this: In an infinite loop I assign a new random value to a variable and if this value satisfies the condition (it’s bigger or smaller on a certain quantity (which may change)) then I’m breaking the loop.
Chenging coordinates with a condition
I have 500×500 grid and random coordinates on this grid. I’m trying to get new random coordinates but they shouldn’t be too close to the previous ones. I’m come up with this: In an infinite loop I’m assign new random value to a variable and if this value satisfies condition (it’s bigger or smaller on a certan quantity(which may change)) then I’m breaking the loop.