Snipplr
http://snipplr.com/tags/isAdjacent
Recent snippets posted on Snipplr.comen-usThu, 21 Sep 2017 01:38:15 GMT(JavaScript) Check if coordinates are adjacent - hellowouter
http://snipplr.com/view/64354/check-if-coordinates-are-adjacent/
This function returns true if the two sets of coordinates are neighbors and false if they ar not. The function easily determines whether they are neighbors by looking at the distance between the positions along both axes, also callled the Manhattan distance. The sum of the two distances must be exactly 1 if the positions are adjacent.
Note: the coordinates should be integers ]]>Wed, 04 Apr 2012 19:25:53 GMThttp://snipplr.com/view/64354/check-if-coordinates-are-adjacent/