adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
2021-02-14T16:17:57.021800Z

Part 2 is always a challenge, but once done, very satisfying. For me 10, 13, 19 were significant challenges so far.

2021-02-14T16:22:23.024300Z

@AC interesting - I am currently working on day 20 part 2. I would think that once the corners are figured out shouldn’t it be linear? Just grab any corner as the top row/col [0 0], then use whichever transform will match an already indexed tile etc…I’m sure there is more 🙂 Ooops sorry, I just realize you were talking about 23

Phil Shapiro 2021-02-14T16:44:03.028Z

I solved day 20 part 2 that way, by picking a corner and placing tiles. It ended up being a fair amount of code. Afterwards I thought that it might’ve been better to place any tile and match tiles to open edges. Once you know which side a tile goes on, you can use a matrix transform to move its pixels into place. Assuming you represent a tile as set of pixels.

2021-02-14T16:48:40.031Z

Indeed, that’s my strategy as well - probably will try parallelizing on all four corners. The transforms are straightforward with rotation matrices which also take care of flipping. But of course as you say there are all kinds of nifty details…early on, one for me was to re-center/re-scale the tile’s coordinates around the origin in order to do rotations smoothly, then restore to ‘printable’ coords - fun stuff.