Author Topic: Advent of Code  (Read 115190 times)

Davef

Re: Advent of Code
« Reply #1050 on: 19 December, 2020, 06:52:11 pm »
I did day18 part 1 with no library calls and minimal c with recursion

(click to show/hide)

Part 2 I went a bit wild and used a c++ string class. Feeling a bit dirty.

(click to show/hide)

Re: Advent of Code
« Reply #1051 on: 19 December, 2020, 08:11:32 pm »
Day 19:
(click to show/hide)

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #1052 on: 19 December, 2020, 10:56:58 pm »
I have to confess, 19p2 has me beat.

Re: Advent of Code
« Reply #1053 on: 19 December, 2020, 11:19:20 pm »
I have to confess, 19p2 has me beat.
(click to show/hide)

Re: Advent of Code
« Reply #1054 on: 19 December, 2020, 11:19:42 pm »
(click to show/hide)
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #1055 on: 19 December, 2020, 11:31:57 pm »
(click to show/hide)
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #1056 on: 20 December, 2020, 12:05:02 am »
I'm struggling on day 19. After some effort I got an algorithm to run that produces 2^21 rules, each of 24 characters in length. The length isn't set in the algorithm, the 24 is what comes out of the data.

None of those match the messages.

I've run through the first option for each rule set and it seems to work out to the first rule that my algorithm produces.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1057 on: 20 December, 2020, 12:36:55 am »
I'm struggling on day 19. After some effort I got an algorithm to run that produces 2^21 rules, each of 24 characters in length. The length isn't set in the algorithm, the 24 is what comes out of the data.

None of those match the messages.

I've run through the first option for each rule set and it seems to work out to the first rule that my algorithm produces.
I've just realised my counting of the matches with the messages was wrong. I've done the first part.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #1058 on: 20 December, 2020, 09:58:05 am »
I've reached the point where the time to solve the puzzles is longer than the available time I have each day. I'm going to carry on, but no longer attempt to keep up. Falling of the back of the peloton as it were :D

Re: Advent of Code
« Reply #1059 on: 20 December, 2020, 12:07:10 pm »
Day 20 part 1:
(click to show/hide)

Re: Advent of Code
« Reply #1060 on: 20 December, 2020, 01:18:39 pm »
Day 20 part 1:
(click to show/hide)

(click to show/hide)

Re: Advent of Code
« Reply #1061 on: 20 December, 2020, 04:05:54 pm »
2020 day 20. That was fun. I was in and out doing various bits so my time was rather fragmented.

Probably took me 90 minutes or so whilst actually sat at a computer, but that was spread out over ~8h or so, and some of those other 6.5h not at a computer were spent thinking about various bits so it would have taken me more than 90 minutes if I sat down to do it in one go (or maybe I would have gained some time not being so distracted or having to mentally get back into it, anyway, who knows).

Spotted the trick for part 1 and did that quite quickly, obviously part 2 renders that trick not so useful, but it does help with how you need to go about the major chunk of part 2.

Annoying as I had an off by one error in part 2 that meant I got the correct answer for the example but not for my input (always fun when that happens). Also annoying that I had to go out this afternoon for a long walk and only fixed it when back (within 2 minutes!), so it could have been finished 3h earlier.

Interesting problem. Was good to break it down into little chunks and solve each of those (with some testing!) and see it all assemble together to give the answer.

[EDIT] I don't look at the leaderboards until I've got both stars so I never really know whether it's a hard problem or whether I'm just missing something obvious. It's my best placing on part 2 so far this year (3141) which taking into account the large amount of time away from the computer, is good going.
"Yes please" said Squirrel "biscuits are our favourite things."

Ben T

Re: Advent of Code
« Reply #1062 on: 20 December, 2020, 04:10:18 pm »
Found day 19 part 2 quite hard but have done it now.

(click to show/hide)

Re: Advent of Code
« Reply #1063 on: 20 December, 2020, 06:30:23 pm »
Day 20 parts 1 and 2:
https://docs.google.com/spreadsheets/d/1pMovEAF1L-UlmCy6rSLCFxMGXzA6VrhzESYRUmPPTQY/edit?usp=sharing

(click to show/hide)

Re: Advent of Code
« Reply #1064 on: 20 December, 2020, 08:35:05 pm »
(click to show/hide)

(click to show/hide)
"Yes please" said Squirrel "biscuits are our favourite things."

Davef

Re: Advent of Code
« Reply #1065 on: 20 December, 2020, 10:45:12 pm »
I thought the second part of today’s was a bit of a slog. Certainly no solution I could see in a few lines of code though I could see what I had to do -  plenty of opportunity for errors.

Davef

Re: Advent of Code
« Reply #1066 on: 21 December, 2020, 09:49:30 am »
Day 21 part 2 seemed rather trivial. Perhaps I had over-solved part 1.

Re: Advent of Code
« Reply #1067 on: 21 December, 2020, 10:05:36 am »
(click to show/hide)

Davef

Advent of Code
« Reply #1068 on: 21 December, 2020, 10:15:05 am »
(click to show/hide)
(click to show/hide)

Re: Advent of Code
« Reply #1069 on: 21 December, 2020, 12:45:19 pm »
Day 21 part 2 seemed rather trivial. Perhaps I had over-solved part 1.

I can't see how part 1 can be solved without going most of the way to solving part 2.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1070 on: 21 December, 2020, 02:42:38 pm »
Day 21:
https://docs.google.com/spreadsheets/d/1jEu0iCON4JgT1V5ee8U4zAsdBD3f9Ly33wvktBDqNfQ/edit?usp=sharing

(click to show/hide)

Re: Advent of Code
« Reply #1071 on: 21 December, 2020, 07:49:41 pm »
"Yes please" said Squirrel "biscuits are our favourite things."


Davef

Advent of Code
« Reply #1073 on: 22 December, 2020, 02:24:32 pm »
Day 20 alternative input: https://gist.github.com/alexgreenbank/3a5dcb1a2854321558509247b1ed78e4
Lost on me as my solution didn’t actually rotate or stitch together the data but just kept the original data along with a list of transformations. With hindsight this was a mistake because although efficient once working it was hellish to debug. It also means I can could not visualise your data without writing some more code.

Davef

Re: Advent of Code
« Reply #1074 on: 22 December, 2020, 02:25:57 pm »
Day 22 done. Back to fine tuning my day 17 part 2 multidimensional life.