Xylate Posted April 14, 2017 Share Posted April 14, 2017 Checking if a position is diagonal from you current position boolean isDiagonal(Position position) { return Math.abs(position.getY() - position.getX()) == Math.abs(myPosition().getY() - myPosition().getX()); } Checking if two supplied positions are diagonal from each other boolean isDiagonal(Position one, Position two) { return Math.abs(one.getY() - one.getX()) == Math.abs(two.getY() - two.getX()); } This will return true if the positions are diagonal from each other(ignoring the plane) 4 Quote Link to comment Share on other sites More sharing options...
Eliot Posted April 14, 2017 Share Posted April 14, 2017 (edited) Curious why you needed this? Edited April 14, 2017 by Eliot Quote Link to comment Share on other sites More sharing options...
Chris Posted April 14, 2017 Share Posted April 14, 2017 danku arigato Quote Link to comment Share on other sites More sharing options...
Saiyan Posted April 14, 2017 Share Posted April 14, 2017 12 hours ago, Eliot said: Curious why you needed this? maybe das why Quote Link to comment Share on other sites More sharing options...