-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
added GridGetX and GridGetY #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't quite get the problem, could you explain it in detail?
@ruppysuppy This isn't an issue, It's a math contribution. GridGetX() and GridGetY(). returns x/y coordinates for an element in a two dimensional array. x and y coordinates are sometimes superior in grid calculations. Let's say for instance you had an array of 10 by 10 or 100, elements and you wanted to find the shortest distance between element 3, and element 49. In this case coding out a function to return the distance without finding x and y for both elements I found to be painful. If you first find x and y, where 3 becomes 4,1 and 49 becomes 10,5, you can find distance by first subtracting x from x and y from y this returns 6,4 or -6,-4. Next apply absolute value to assure the results are positive, last choose the maximum value of the set, or 6. I 'm sure there are other applications for desiring x and y from 2 dim arrays. |
Ok, but since I don't have write permissions, so someone else with the permission has to review your code too |
@TangibleDream, there are few things
thank you for the contribution, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't edit DIRECTORY.md, it is automatically generated by GitHub actions
Welcome to JavaScript community
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.