💾 Archived View for cjc.im › 2017 › 12 › 04 › Advent-of-Code-Days-2-4 › index.gmi captured on 2022-04-29 at 11:18:36. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

Advent of Code Days 2-4

Dec 04, 2017

Not going to post code here as it would be horrible anyway, I am taking the approach of getting it done and not worry about maintainability of code.

Day 2 part one was just number manipulation to create a "checksum" pretty simple, didn't take long. Part 2 introduced a little change that required you to deal with the only 2 numbers that divide into each other. Again, nothing too serious.

Day 3 was a bit of a difficult one, part one took a while as it was dealing with a sprial of numbers on a grid with the aim to find the Manhatten Distance[1] to the centre. Took a while but I got it by calculating the distance rather than mapping the spiral. This backfired as part 2 seems to require the spiral, so I left this for now.

1: https://en.wikipedia.org/wiki/Taxicab_geometry

Day 4 in contrast to 3 was easy, passphrase "validation", part one there can be no duplicated words in a passphrase. Simple. 5 minutes with python. Part two introduced the complexity of no words can be anagrams of others. Another 5 minutes, done.

Probably have a stab at 3 again if I get time.

Back to home page