1
0

Day 3-6 2019

This commit is contained in:
2020-12-31 00:01:58 +01:00
parent 4fef41464e
commit ae327a4928
14 changed files with 1472 additions and 15 deletions
@@ -0,0 +1,13 @@
package be.vandewalleh.aoc.geometry;
public record Point2D(int x, int y) {
public static Point2D origin = new Point2D(0, 0);
public int manhattanDistance() {
return Math.abs(x) + Math.abs(y);
}
public Point2D translate(Point2D other) {
return new Point2D(this.x + other.x, this.y + other.y);
}
}