Mercurial > repos > other > adventofcode2023
view day17.txt @ 34:59620bbc4084
Implement day 24 - 2D intersection
Needs an offset because the numbers are big enough to overflow
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 05 Jan 2024 11:42:13 +0000 |
parents | 79dc2ba41df2 |
children |
line wrap: on
line source
--- Day 17: Clumsy Crucible --- A route finding puzzle with the following constraints: * Reduce the sum of values walked (the "cost" of the route) * Do not go in a straight line for more than three blocks * Don't count the starting square (unless you return to it) Start at the top-left and move to the bottom-right Given: 2413432311323 3215453535623 3255245654254 3446585845452 4546657867536 1438598798454 4457876987766 3637877979653 4654967986887 4564679986453 1224686865563 2546548887735 4322674655533 We could go: 2>>34^>>>1323 32v>>>35v5623 32552456v>>54 3446585845v52 4546657867v>6 14385987984v4 44578769877v6 36378779796v> 465496798688v 456467998645v 12246868655<v 25465488877v5 43226746555v> This path never moves more than three consecutive blocks in the same direction and incurs a heat loss of only 102.