public class Rute { // Felter for posisjon private int rad; private int kolonne; public Rute(int rad, int kolonne) { this.rad = rad; this.kolonne = kolonne; } // Metode som returnerer avstand til en annen rute public int avstandTil(Rute annenRute) { return Math.abs(rad - annenRute.rad) + Math.abs(kolonne - annenRute.kolonne); } public int hentRad() { return rad; } public int hentKolonne() { return kolonne; } }