umm....no? (seriously, i'm trying to figure out why you think this would work, am i missing something?)
My version is based on the logic in his first post. “If both coordinates move by over 300 units, generate new coordinates, but if only the X or the Y moves by over 300, that is fine.”
For his revision I only didn’t notice that he had switched from > to <, which achieves the correct results.
Comments would go a long way here. Don’t be afraid; they don’t bite. I really couldn’t look too terribly closely because there is not a single comment anywhere, although the code I “corrected” was small enough that I could have paid more attention there.
I still don’t really understand the goal behind the code, and again I would insist on using vectors. Makes everything simple.
L. Spiro