Author Topic: Advent of Code  (Read 110054 times)

Re: Advent of Code
« Reply #775 on: 06 December, 2019, 04:41:41 pm »
Yup -2 and understanding the input data in part 2 finally got me there.

Re: Advent of Code
« Reply #776 on: 07 December, 2019, 10:29:05 am »
Da7 7:

You see the future!


BTW, I'm expecting INPUT and OUTPUT to go the same way that https://adventofcode.com/2017/day/18 did and you'll end up needing two copies of the 'computer' running at the same time swapping inputs/outputs and vice versa.

You see the future (almost)!

Re: Advent of Code
« Reply #777 on: 07 December, 2019, 11:33:30 am »
Indeed, but it was a nice twist on that.

My code to implement it was hideous.

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

Re: Advent of Code
« Reply #778 on: 07 December, 2019, 07:15:24 pm »
Interesting.

(click to show/hide)
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #779 on: 08 December, 2019, 05:49:59 am »
Bum. I am stymied on Day 7 Part 2. All current and historical tests for my computer give the correct results. Day 7 Part1 was correct at the first attempt. Part 2 tests pass. But part2  input doesn't give the correct answer. Pointers to wrinkles I may have missed are most welcome.

(click to show/hide)

Re: Advent of Code
« Reply #780 on: 08 December, 2019, 07:31:23 am »
I get a smaller number.

Do your tests include a full run of all permutations on the last example, or just the permutation shown?
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #781 on: 08 December, 2019, 07:49:15 am »
That is the maximum value I get when I run all 120 permutations of "567892".  Advent of Code says my result is too low.

Re: Advent of Code
« Reply #782 on: 08 December, 2019, 10:14:31 am »
Whizzed through day 8 :-D

Re: Advent of Code
« Reply #783 on: 08 December, 2019, 05:20:23 pm »
If you get a different answer could you please say so BUT NOT WHAT YOUR ANSWER IS.  Thanks

I too get a different (lower) answer. If it's any help here's my input and what I get as an answer (as that isn't giving you the answer to your problem).

Code: [Select]
3,8,1001,8,10,8,105,1,0,0,21,46,55,68,89,110,191,272,353,434,99999,3,9,1002,9,3,9,1001,9,3,9,102,4,9,9,101,4,9,9,1002,9,5,9,4,9,99,3,9,102,3,9,9,4,9,99,3,9,1001,9,5,9,102,4,9,9,4,9,99,3,9,1001,9,5,9,1002,9,2,9,1001,9,5,9,1002,9,3,9,4,9,99,3,9,101,3,9,9,102,3,9,9,101,3,9,9,1002,9,4,9,4,9,99,3,9,1001,9,1,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,3,9,1001,9,2,9,4,9,3,9,1001,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,101,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,1001,9,2,9,4,9,99,3,9,102,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,101,1,9,9,4,9,3,9,101,2,9,9,4,9,3,9,101,2,9,9,4,9,99,3,9,101,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,3,9,101,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,101,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,102,2,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,2,9,9,4,9,99,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,2,9,4,9,3,9,101,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,1001,9,1,9,4,9,99,3,9,1002,9,2,9,4,9,3,9,101,2,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,1,9,9,4,9,3,9,101,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,99

Code: [Select]
$ ./7d.pl | sort -rn -k3 | head
57968 gives 3745599
57698 gives 3742019
75968 gives 3689151
75698 gives 3685571
57986 gives 3671647

And here are the values passed between each amplifier for phase arrangement 57968:-

(click to show/hide)

Again, this is the answer to my input for day 7 not yours!
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #784 on: 08 December, 2019, 05:21:51 pm »
Day 8 nice and quick although there was a ~7 hour gap between part 1 and part 2 as I didn't get time to finish part 2 before I had to go out and was out most of the day.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #785 on: 08 December, 2019, 06:45:04 pm »
Thanks.  I get a different number to you so it seems I have a logic problem in by computer.  I also downloaded a solution in python which gave a different number to my computer.  So a bit of head scratching is the order of the day.

Re: Advent of Code
« Reply #786 on: 09 December, 2019, 08:29:51 am »
Day 9 completed successfully, but my computer is still giving the wrong result for Day7Part2

Re: Advent of Code
« Reply #787 on: 09 December, 2019, 09:05:31 am »
Opposite problem for me, and it wasn't fixed in the 15 minutes I have this morning so I'll have to pick it up later this afternoon when I've done all of my chores.

[EDIT] Spotted it, fixed and day 9 part 2 ran without problems!
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #788 on: 09 December, 2019, 10:19:55 am »
I'm working in VBA so much of today's problem solving time was spent ensuring appropriate variables were LongLong rather than Long. :demon:

Ben T

Re: Advent of Code
« Reply #789 on: 09 December, 2019, 12:43:09 pm »
foxed by day 8 part 2  :-\
(click to show/hide)

Ben T

Re: Advent of Code
« Reply #790 on: 09 December, 2019, 01:02:42 pm »
Bum. I am stymied on Day 7 Part 2. All current and historical tests for my computer give the correct results. Day 7 Part1 was correct at the first attempt. Part 2 tests pass. But part2  input doesn't give the correct answer. Pointers to wrinkles I may have missed are most welcome.

(click to show/hide)

(click to show/hide)

Re: Advent of Code
« Reply #791 on: 09 December, 2019, 01:13:37 pm »
foxed by day 8 part 2  :-\
(click to show/hide)
(click to show/hide)
"Yes please" said Squirrel "biscuits are our favourite things."

Ben T

Re: Advent of Code
« Reply #792 on: 09 December, 2019, 04:37:39 pm »
foxed by day 8 part 2  :-\
(click to show/hide)
(click to show/hide)

(click to show/hide)

Re: Advent of Code
« Reply #793 on: 09 December, 2019, 06:18:26 pm »
Finally got the correct answer for Day 7 part 2.  The logic in the computer was perfectly fine but obviously that was where I was spending my time.  The error was in how I collected the output when the computer was run in loop mode.  A very silly logic error but depressingly elusive.

Re: Advent of Code
« Reply #794 on: 09 December, 2019, 09:44:45 pm »
Day 9: very clever. In "test mode" with input=1 it output 2 opcodes which pointed straight at the places where I had left the original day 5 code for finding the offset.
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #795 on: 10 December, 2019, 08:34:06 am »
I've got into a bad habit of checking the leaderboards of the top 100 to see how tricky the upcoming day is, the times shown there give me an idea how tough it's going to be.

I fear for the days where the top 100 hasn't been solved by the time I get everything else done (school run this morning) before I can look at it, hasn't happened yet.

Not that bad today but part 2 is obviously relatively involved.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #796 on: 10 December, 2019, 09:41:23 am »
That was fun.

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

Ben T

Re: Advent of Code
« Reply #797 on: 10 December, 2019, 10:54:20 am »
Day 9 a bit bloody tenuous to say the least... had to look on the reddit and instantly found a reference to "the 203 error" which was what I had run into, despite passing all the tests. But quite clever how it actually tells you which instruction there is a problem with. I thought by mention of "large numbers" but no indication as to how large, he might make the tests handle >32bit, but <64 bit numbers but deliberately require >64 bit numbers in the final solution, I was braced for that... but seemingly not for slight misinterpretation of how read/write parameters are handled.
Don't think I've got time to do day 10 today, spent long enough not doing actual work as it is :)

Re: Advent of Code
« Reply #798 on: 10 December, 2019, 02:06:19 pm »
BTW, Eric's talk about AoC is well worth a watch: https://www.youtube.com/watch?v=gibVyxpi-qA

Will be late to Day 11 thanks to school running club and then an eye test.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #799 on: 11 December, 2019, 12:28:22 pm »
Day 11. Found a bug in opcode 3 of all places. Left wondering how it ever worked. Done though, will go through and rejig things properly as this Intcode computer is not going anywhere.
"Yes please" said Squirrel "biscuits are our favourite things."