Skip to content

Commit

Permalink
Advent 2023, day 17
Browse files Browse the repository at this point in the history
  • Loading branch information
elpollouk committed Dec 17, 2023
1 parent c065a26 commit 921c4af
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Advent2018/Day22.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public int GetMoveCost((int x, int y, Item item) from, (int x, int y, Item item)

public int GetScore((int x, int y, Item item) from, (int x, int y, Item item) to)
{
return Math.Abs(from.x - to.x) + Math.Abs(from.y - to.y);
var distance = Math.Abs(from.x - to.x) + Math.Abs(from.y - to.y);
return from.item == to.item ? distance : distance + 1;
}
}

Expand Down
Loading

0 comments on commit 921c4af

Please sign in to comment.