Author Topic: Advent of Code  (Read 112651 times)

Re: Advent of Code
« Reply #1125 on: 08 December, 2021, 01:10:56 pm »
Day 6
(click to show/hide)

(click to show/hide)
(click to show/hide)

My day job tends to call on that kind of optimization, so i had a similar predisposition :)

In contrast, my solution for today's feels quite clunky. Though coding before coffee might be an issue.
Day 8
Even though today's was a bit clunky, the only solution that I saw didn't involve going round anything more than a handful of times.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
Re: Advent of Code
« Reply #1126 on: 08 December, 2021, 03:49:47 pm »
Day 6
(click to show/hide)

(click to show/hide)
(click to show/hide)

My day job tends to call on that kind of optimization, so i had a similar predisposition :)

In contrast, my solution for today's feels quite clunky. Though coding before coffee might be an issue.

(click to show/hide)
  :P

Re: Advent of Code
« Reply #1127 on: 12 December, 2021, 09:31:45 am »
Day 12
Part 1
(click to show/hide)
Part 2
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1128 on: 12 December, 2021, 10:38:36 pm »
Day 12 I got the first bit done ok, then had stuff to do.

Part two broke my previous (learning a new library) approach. Starting again with something simpler got me there.

Deliberate loops in a routing algorithm as part of the spec was quite upsetting though.

Re: Advent of Code
« Reply #1129 on: 14 December, 2021, 08:17:53 am »
Day 14
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1130 on: 14 December, 2021, 11:55:20 am »
Day 14
(click to show/hide)

I took a couple of dead ends before getting it working in reasonable time today, but I still got my best part two position so far without any alarm clock shenanigans.

(click to show/hide)

Re: Advent of Code
« Reply #1131 on: 15 December, 2021, 07:03:30 am »
Day 15
My code works for the demo, parts 1 and 2, and for my puzzle input part 1, and it appears to work for my puzzle input in part 2, but it gives the wrong answer. I am a bit stuck now.

Edit. Found the problem.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1132 on: 15 December, 2021, 01:41:08 pm »
(click to show/hide)

Re: Advent of Code
« Reply #1133 on: 25 December, 2021, 08:13:36 pm »
Day 23 was solved with (effectively) pencil and paper.

I did use a computer to spot my stupid adding up mistake.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Morat

  • I tried to HTFU but something went ping :(
Re: Advent of Code
« Reply #1134 on: 22 November, 2022, 10:15:15 am »
gentle nudge?
Everyone's favourite windbreak

Re: Advent of Code
« Reply #1135 on: 30 November, 2022, 11:38:34 pm »
The countdown has started.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1136 on: 01 December, 2022, 08:00:47 am »
I've been doing advent of code in VBA for the past few years, but I've now upgraded to twinbasic.  Over the years I've developed a library to help eliminate a lot of the VBA boilerplate code needed to solve AoC problems.  So this morning I was delighted (and astonished) when my library worked well in solving the day 1 problem.
(click to show/hide)






Clever enough to know I'm not clever enough.

Re: Advent of Code
« Reply #1137 on: 03 December, 2022, 07:50:06 pm »
I had to look up TwinBasic, and found:

Quote
twinBASIC is an exciting new project that aims to provide a full replacement IDE and compiler for VB6

For the love of $Deity WHY??
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #1138 on: 10 December, 2022, 06:20:48 pm »
Well day 9 pt 2 got me. The test data got the right answer, and printing out the visited points exactly matched the example, but the final answer was wrong. Only comparing the intermediates showed that I'd misunderstood the rules.

Bah! This is not the first one this year where the tests have passed for the wrong implementation.
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #1139 on: 10 December, 2022, 08:56:30 pm »
Well day 9 pt 2 got me. The test data got the right answer, and printing out the visited points exactly matched the example, but the final answer was wrong. Only comparing the intermediates showed that I'd misunderstood the rules.

Bah! This is not the first one this year where the tests have passed for the wrong implementation.
I had the same.

I got program to draw out the path of the last knot in the rope, and realised that my first attempt had gaps in the path.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1140 on: 10 December, 2022, 11:01:02 pm »
One of the joys of advent of code is teaching folks about how assumptions are made.  The problems need very careful reading to ensure you have eliminated stuff that has been included unnecessarily and stuff which is implicit - usually hidden in plain view in the details of the examples.  God knows how people who don't have English as a first language cope, or maybe its easier as things are read properly rather than quickly scanned for 'salient' points.
Clever enough to know I'm not clever enough.

Re: Advent of Code
« Reply #1141 on: 11 December, 2022, 08:26:12 am »
Day 11 needed a trick so that the solution didn't become unmanageable for a normal computer.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1142 on: 15 December, 2022, 09:08:21 am »
For Day 15, the scale is too large for a brute-force solution.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1143 on: 18 December, 2022, 08:51:45 pm »
Day 16, part 2.
The code that got the right answer for me needed to try 8,142,958,394 possibilities and took something like an hour to run.
The same code run on the example only needed 37,623 possibilities and runs almost instantly.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1144 on: 23 December, 2022, 12:12:45 pm »
Day 22: Monkey Map Part 2
The statistics show that quite a low proportion of the solutions of the first part got converted into solutions of the second part.

The YACF private leaderboard has 5 solutions to the first part and only 3 to the second part. There are only 4 first part only solutions for the whole of the private leaderboard, and two of those are for Day 22.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1145 on: 01 December, 2023, 08:35:50 am »
Advent of code 2023 has started.

Day 1
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #1146 on: 01 December, 2023, 06:52:07 pm »
Advent of code 2023 has started.

Day 1
(click to show/hide)

That’s plain greedy  ;)

Re: Advent of Code
« Reply #1147 on: 02 December, 2023, 10:58:48 am »
That was a bit sneaky for a day 1. Depending on your approach it would have been quite easy to pass a test on the sample but get the wrong answer on the puzzle.

I see quite a few people in the private leaderboard haven't bothered completing part 2 yet.
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #1148 on: 02 December, 2023, 12:53:53 pm »
That was a bit sneaky for a day 1. Depending on your approach it would have been quite easy to pass a test on the sample but get the wrong answer on the puzzle.
Only for part 2, but yes, the sample was no help at all for the difference between part 2 and part 1

I see quite a few people in the private leaderboard haven't bothered completing part 2 yet.
Part 2 needs to detect several characters to get a match, while part one only needs to detect a single character.

I was pleasantly surprised when my additions for part 2 worked first time (after the errors that wouldn't compile had been sorted)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

jwo

Re: Advent of Code
« Reply #1149 on: 02 December, 2023, 07:10:32 pm »
Only for part 2, but yes, the sample was no help at all for the difference between part 2 and part 1

Except that some of the words in the sample did give a clue about the main gotcha with part 2, even if it didn't actually have an effect when processing the sample.