Snipplr
http://snipplr.com/tags/Manhattan
Recent snippets posted on Snipplr.comen-usThu, 24 Apr 2014 02:11:03 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/