Author Topic: Advent of Code  (Read 115188 times)

red marley

Re: Advent of Code
« Reply #350 on: 22 December, 2016, 08:05:02 am »
Day 22 (grid computing)

Nice meaty challenge today. First part straightforward but I have to go to work now before getting a solution for second part. Will think about it on way in.

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #351 on: 22 December, 2016, 09:01:14 am »
Likewise. Part 1 was straightforward, almost a one-liner in python.
(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #352 on: 22 December, 2016, 01:09:41 pm »
Part 2: Not much coding needed here - easy to do by inspection and simple arithmetic.
(click to show/hide)

"By creating we think. By living we learn" - Patrick Geddes

Oaky

  • ACME Fire Safety Officer
  • Audax Club Mid-Essex
    • MEMWNS Map
Re: Advent of Code
« Reply #353 on: 22 December, 2016, 04:30:13 pm »
(click to show/hide)
You are in a maze of twisty flat droves, all alike.

85.4 miles from Marsh Gibbon

Audax Club Mid-Essex Fire Safety Officer
http://acme.bike

red marley

Re: Advent of Code
« Reply #354 on: 22 December, 2016, 04:39:29 pm »
^--- Probably a bit of an unhidden spoiler there David.


(click to show/hide)

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #355 on: 22 December, 2016, 09:27:11 pm »
I am attempting to fill in the blanks from last years. The lack of a daily deadline doesn't seem to help.

I do think that many of them are harder than this year. The one I am currently toying with is the elves delivering presents. It is obviously some heinous factorial problem, but instead of a straight sum of factors, it is a sum of the product of every permutation.
Wondering about some sort of branch and bound strategy, and being able to set a suitable bound on the number of primes to consider.

"By creating we think. By living we learn" - Patrick Geddes

red marley

Re: Advent of Code
« Reply #356 on: 22 December, 2016, 10:26:36 pm »
I do think that many of them are harder than this year.

We've still got three days to go yet.  :demon:

But I agree with you. The average completion time of the top 100 finishers last year was 26 min 50s; this year so far it has been 23 min 25s. One difference (which I like) is that the hardest questions this year (Day 11 lifts; Day 19 elf present stealing; Day 22 grid computing) have all had a trick/heuristic that makes the problem considerably easier to solve.

If you want a gentle clue for the present permutation problem from last year:
(click to show/hide)

red marley

Re: Advent of Code
« Reply #357 on: 23 December, 2016, 06:42:15 am »
Day 23  (more assembunny)

(click to show/hide)

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #358 on: 23 December, 2016, 08:59:40 am »
(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

red marley

Re: Advent of Code
« Reply #359 on: 23 December, 2016, 02:56:14 pm »
(click to show/hide)

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #360 on: 23 December, 2016, 04:58:40 pm »
Did you put that into the program to generalise from any set of instructions? I had thought about trying that but didn't have time. The challenge means different things to different folks.
"By creating we think. By living we learn" - Patrick Geddes

Ben T

Re: Advent of Code
« Reply #361 on: 23 December, 2016, 06:07:59 pm »
I haven't found a programmatic solution to day 22 or day 23 that will work with anybody's input.

Day 22 is a perfect example of something a human is good at solving based on what they see visually but a computer isn't.
(click to show/hide)

 Day 23,
(click to show/hide)

red marley

Re: Advent of Code
« Reply #362 on: 23 December, 2016, 06:33:58 pm »
I haven't found a programmatic solution to day 22 or day 23 that will work with anybody's input.

Day 22 is a perfect example of something a human is good at solving based on what they see visually but a computer isn't.
(click to show/hide)

(click to show/hide)

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #363 on: 23 December, 2016, 10:27:44 pm »
I haven't found a programmatic solution to day 22 or day 23 that will work with anybody's input.

Day 22 is a perfect example of something a human is good at solving based on what they see visually but a computer isn't.
(click to show/hide)

(click to show/hide)


(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

Oaky

  • ACME Fire Safety Officer
  • Audax Club Mid-Essex
    • MEMWNS Map
Re: Advent of Code
« Reply #364 on: 23 December, 2016, 10:35:18 pm »
(click to show/hide)
You are in a maze of twisty flat droves, all alike.

85.4 miles from Marsh Gibbon

Audax Club Mid-Essex Fire Safety Officer
http://acme.bike

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #365 on: 24 December, 2016, 09:23:23 am »
Day 24: A bigger challenge

(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

Oaky

  • ACME Fire Safety Officer
  • Audax Club Mid-Essex
    • MEMWNS Map
Re: Advent of Code
« Reply #366 on: 24 December, 2016, 10:08:33 am »
(click to show/hide)
You are in a maze of twisty flat droves, all alike.

85.4 miles from Marsh Gibbon

Audax Club Mid-Essex Fire Safety Officer
http://acme.bike

red marley

Re: Advent of Code
« Reply #367 on: 24 December, 2016, 01:02:10 pm »
Oh dear - some stupid mistakes cost me plenty of time which meant with other Christmas stuff going on, I had to leave it a while before resuming.

(click to show/hide)

Ben T

Re: Advent of Code
« Reply #368 on: 24 December, 2016, 02:26:10 pm »
I haven't found a programmatic solution to day 22 or day 23 that will work with anybody's input.

Day 22 is a perfect example of something a human is good at solving based on what they see visually but a computer isn't.
(click to show/hide)

(click to show/hide)

(click to show/hide)

Ben T

Re: Advent of Code
« Reply #369 on: 24 December, 2016, 02:38:27 pm »
(That woe is day 24 not day 23... ) but:
(click to show/hide)

red marley

Re: Advent of Code
« Reply #370 on: 24 December, 2016, 02:38:53 pm »
^--- (Ben's Day 22) Sure, but with a grid of only c. 30x30 or so cells, shouldn't it soon exhaust that bottom right corner and find a better route past the wall?

(click to show/hide)

Ben T

Re: Advent of Code
« Reply #371 on: 24 December, 2016, 02:42:27 pm »
^--- (Ben's Day 22) Sure, but with a grid of only c. 30x30 or so cells, shouldn't it soon exhaust that bottom right corner and find a better route past the wall?

(click to show/hide)
maybe, yeah - I'll revisit and try and find out why it doesn't. I think the reason may be that the hash is 'too unique', i.e. it cares (too much) about the position of actual data rather than just the position of the space.

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #372 on: 24 December, 2016, 03:35:02 pm »
Hmm.. Just got back to this and I think my code is really inefficient compared to the times reported. Still running DFS (maybe BFS would be better?)
"By creating we think. By living we learn" - Patrick Geddes

Ben T

Re: Advent of Code
« Reply #373 on: 24 December, 2016, 04:10:05 pm »
Hmm.. Just got back to this and I think my code is really inefficient compared to the times reported. Still running DFS (maybe BFS would be better?)
(click to show/hide)

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #374 on: 24 December, 2016, 04:19:29 pm »
(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes