Improve finding by allowing minimal distance & randomization

This commit is contained in:
CocoTheOwner committed 2021-10-01 12:20:00 +02:00
1 parent 13532a1f0a
commit 636fddd642
5 files changed
+39 -28

No files matched your search

@@ -80,7 +80,7 @@ public class Position2 {
}
public double distance(Position2 center) {
return Math.pow(center.getX() - x, 2) + Math.pow(center.getZ() - z, 2);
return Math.sqrt(Math.pow(center.getX() - x, 2) + Math.pow(center.getZ() - z, 2));
}
public Position2 add(int x, int z) {