Xylate Posted April 14, 2017 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
Eliot Posted April 14, 2017 Posted April 14, 2017 (edited) Curious why you needed this? Edited April 14, 2017 by Eliot
Saiyan Posted April 14, 2017 Posted April 14, 2017 12 hours ago, Eliot said: Curious why you needed this? maybe das why