Signed-off-by: Immanuel Alvaro Bhirawa <u7280427@anu.edu.au>
This commit is contained in:
Immanuel Alvaro Bhirawa 2023-05-06 20:01:25 +10:00
parent ad3a9c4a00
commit 6e6bf69bdf

View File

@ -594,7 +594,7 @@ public class State {
recurssionLink(allCoords, current, longest, now); recurssionLink(allCoords, current, longest, now);
// if the score is bigger, update the Set // if the score is bigger, update the Set
if(scoreForLink(current, islands) > scoreForLink(longest,islands)) { if(helperScoreForLink(current, islands) > helperScoreForLink(longest,islands)) {
longest.clear(); longest.clear();
longest.addAll(current); longest.addAll(current);
} }
@ -615,7 +615,7 @@ public class State {
} }
} }
public static int scoreForLink(Set<Coord> longestLink, Island[] islands) { public static int helperScoreForLink(Set<Coord> longestLink, Island[] islands) {
int numOfIslands = 0; int numOfIslands = 0;
outerLoop: outerLoop: