🎄⌨️ Advent of Code 2018

Tech-note 65794d

Day 10 problem: “The Stars Align”

This was a fun problem (that coincidentally presented no speed-optimization challenges).

You’d think there wouldn’t be a simple way to detect the moment at which the moving stars depict a readable message. But from the example you can see that the points all start far apart, converge towards each other, and then grow further apart again. So the moment at which the points are the least spread out is when they spell out the message.

Since DrRacket can render graphics directly in the REPL, it’s always fun when you run the code and get a picture of the result:

> (time (day10-part1))
cpu time: 1242 real time: 1254 gc time: 96
pixelated output

Final solutions: day10.rkt