description.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --- Day 17: Clumsy Crucible ---
  2. The lava starts flowing rapidly once the Lava Production Facility is operational. As you leave, the reindeer offers you a parachute, allowing you to quickly reach Gear Island.
  3. As you descend, your bird's-eye view of Gear Island reveals why you had trouble finding anyone on your way up: half of Gear Island is empty, but the half below you is a giant factory city!
  4. You land near the gradually-filling pool of lava at the base of your new lavafall. Lavaducts will eventually carry the lava throughout the city, but to make use of it immediately, Elves are loading it into large crucibles on wheels.
  5. The crucibles are top-heavy and pushed by hand. Unfortunately, the crucibles become very difficult to steer at high speeds, and so it can be hard to go in a straight line for very long.
  6. To get Desert Island the machine parts it needs as soon as possible, you'll need to find the best way to get the crucible from the lava pool to the machine parts factory. To do this, you need to minimize heat loss while choosing a route that doesn't require the crucible to go in a straight line for too long.
  7. Fortunately, the Elves here have a map (your puzzle input) that uses traffic patterns, ambient temperature, and hundreds of other parameters to calculate exactly how much heat loss can be expected for a crucible entering any particular city block.
  8. For example:
  9. 2413432311323
  10. 3215453535623
  11. 3255245654254
  12. 3446585845452
  13. 4546657867536
  14. 1438598798454
  15. 4457876987766
  16. 3637877979653
  17. 4654967986887
  18. 4564679986453
  19. 1224686865563
  20. 2546548887735
  21. 4322674655533
  22. Each city block is marked by a single digit that represents the amount of heat loss if the crucible enters that block. The starting point, the lava pool, is the top-left city block; the destination, the machine parts factory, is the bottom-right city block. (Because you already start in the top-left block, you don't incur that block's heat loss unless you leave that block and then return to it.)
  23. Because it is difficult to keep the top-heavy crucible going in a straight line for very long, it can move at most three blocks in a single direction before it must turn 90 degrees left or right. The crucible also can't reverse direction; after entering each city block, it may only turn left, continue straight, or turn right.
  24. One way to minimize heat loss is this path:
  25. 2>>34^>>>1323
  26. 32v>>>35v5623
  27. 32552456v>>54
  28. 3446585845v52
  29. 4546657867v>6
  30. 14385987984v4
  31. 44578769877v6
  32. 36378779796v>
  33. 465496798688v
  34. 456467998645v
  35. 12246868655<v
  36. 25465488877v5
  37. 43226746555v>
  38. This path never moves more than three consecutive blocks in the same direction and incurs a heat loss of only 102.
  39. Directing the crucible from the lava pool to the machine parts factory, but not moving more than three consecutive blocks in the same direction, what is the least heat loss it can incur?
  40. Your puzzle answer was 638.
  41. --- Part Two ---
  42. The crucibles of lava simply aren't large enough to provide an adequate supply of lava to the machine parts factory. Instead, the Elves are going to upgrade to ultra crucibles.
  43. Ultra crucibles are even more difficult to steer than normal crucibles. Not only do they have trouble going in a straight line, but they also have trouble turning!
  44. Once an ultra crucible starts moving in a direction, it needs to move a minimum of four blocks in that direction before it can turn (or even before it can stop at the end). However, it will eventually start to get wobbly: an ultra crucible can move a maximum of ten consecutive blocks without turning.
  45. In the above example, an ultra crucible could follow this path to minimize heat loss:
  46. 2>>>>>>>>1323
  47. 32154535v5623
  48. 32552456v4254
  49. 34465858v5452
  50. 45466578v>>>>
  51. 143859879845v
  52. 445787698776v
  53. 363787797965v
  54. 465496798688v
  55. 456467998645v
  56. 122468686556v
  57. 254654888773v
  58. 432267465553v
  59. In the above example, an ultra crucible would incur the minimum possible heat loss of 94.
  60. Here's another example:
  61. 111111111111
  62. 999999999991
  63. 999999999991
  64. 999999999991
  65. 999999999991
  66. Sadly, an ultra crucible would need to take an unfortunate path like this one:
  67. 1>>>>>>>1111
  68. 9999999v9991
  69. 9999999v9991
  70. 9999999v9991
  71. 9999999v>>>>
  72. This route causes the ultra crucible to incur the minimum possible heat loss of 71.
  73. Directing the ultra crucible from the lava pool to the machine parts factory, what is the least heat loss it can incur?
  74. Your puzzle answer was 748.
  75. Both parts of this puzzle are complete! They provide two gold stars: **