Author Topic: Advent of Code  (Read 112494 times)

red marley

Re: Advent of Code
« Reply #175 on: 22 November, 2016, 02:52:49 pm »
Advent of Code 2016 is imminent!  :thumbsup:

Looks like jo's private leaderboard from last year carries over to 2016 too.

In case it is not obvious to anyone new to the Advent of Code, the 'private leaderboard' allows you to view the number of completed challenge questions from YACF people who register. To join the board, simply enter the code 48462-ea506236 under 'leaderboard -> join private leaderboard'.

To enter the challenge at all you will need to log in to the site with one of the following credentials: twitter, Google, GitHub or Reddit. This is necessary as they are used to generate a (possibly) unique set of question variations and validation of your answers. No spamming is involved (as far as I am aware).

I'd really recommend the challenge to anyone with even a passing interest in coding. So far the challenges have been very well designed providing a manageable and satisfying learning curve over the 25 days. Whether you are a beginner wanting to develop skills in a new language (I'm going to attempt some in Elm and possibly Racket this year) or are an expert programmer with a familiar language, there is something on offer.

Oaky

  • ACME Fire Safety Officer
  • Audax Club Mid-Essex
    • MEMWNS Map
Re: Advent of Code
« Reply #176 on: 25 November, 2016, 11:57:08 am »
from the Advent of Code author on Twitter:-

https://twitter.com/ericwastl/status/801715851510616064

 ;D
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 #177 on: 01 December, 2016, 11:56:51 am »
I need to apologise as I have inadvertently given out the code for the YACF private leaderboard to colleagues at work (I thought I had generated a new code from a different account, but had passed the wrong one to colleagues). The upshot is that there may be a few others joining the YACF leaderboard this month. If that is a problem for anyone, now would be the time to start a new YACF one.

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #178 on: 01 December, 2016, 12:47:04 pm »
I haven't done it yet but this is the approach I will take..

(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 #179 on: 01 December, 2016, 01:03:54 pm »
And then there is part 2
(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

Re: Advent of Code
« Reply #180 on: 01 December, 2016, 03:18:20 pm »
Both parts of day 1
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

red marley

Re: Advent of Code
« Reply #181 on: 01 December, 2016, 05:55:03 pm »
Day 1: I did pretty much the same as David Martin. Quite similar to one of the problems last year.

Diver300 - Initially I though your quick solution to part b was rather elegant but...

(click to show/hide)

Re: Advent of Code
« Reply #182 on: 01 December, 2016, 08:48:22 pm »
Day 1: I did pretty much the same as David Martin. Quite similar to one of the problems last year.

Diver300 - Initially I though your quick solution to part b was rather elegant but...

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

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #183 on: 01 December, 2016, 08:51:54 pm »
Day 1: I did pretty much the same as David Martin. Quite similar to one of the problems last year.

Diver300 - Initially I though your quick solution to part b was rather elegant but...

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

Re: Advent of Code
« Reply #184 on: 01 December, 2016, 09:08:36 pm »
Well, that was a bit disappointing.  I'd recommended this to mrs_e on the basis it started off really gently in last year's problems and only gradually picked up in intensity.  This was straight in with an equivalent of day 3 (2015) but with an extra level of complexity due to rotations.

red marley

Re: Advent of Code
« Reply #185 on: 02 December, 2016, 07:45:57 am »
I think Day 2 is easier so mrs_e may have more joy today.

Day 2, my solution

(click to show/hide)

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #186 on: 02 December, 2016, 08:39:42 am »
Interesting. I took a slightly different approach, modelling the keypad more explicitly.
(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

Re: Advent of Code
« Reply #187 on: 02 December, 2016, 08:56:50 am »
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Re: Advent of Code
« Reply #188 on: 02 December, 2016, 10:57:12 am »
I think Day 2 is easier so mrs_e may have more joy today.

S'alright, she got there in the end with day 1 last night.  And while still in bed this morning she reported the same thing you have just said after reading day 2.  ;D

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #189 on: 02 December, 2016, 11:16:20 am »
Gone back to day1 in R to force myself to think differently.
(click to show/hide)
"By creating we think. By living we learn" - Patrick Geddes

Re: Advent of Code
« Reply #190 on: 03 December, 2016, 07:35:46 am »
Day 3 seemed simpler to me than either of the previous days.
(click to show/hide)
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #191 on: 03 December, 2016, 10:35:19 am »
Agreed. Still trying to do Day 1 part 2 in R. It's very good for row level manipulations but doing all against all is taxing me a bit. I might try embedding an SQL query in the R code (because one can).
"By creating we think. By living we learn" - Patrick Geddes

red marley

Re: Advent of Code
« Reply #192 on: 03 December, 2016, 03:52:27 pm »
Day 3

Because I like drawing pictures, I thought I'd create some festive visualisations of my Day 3 answers. Here's part (a) with each green triangle being a 'real' triangle with edge lengths as provided and impossible ones shown as three pronged branches with the given lengths.



And here is part b with the vertically derived triangles added in red.


David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #193 on: 04 December, 2016, 08:55:47 am »
A bit lengthier to solve today but not hard - bit of regex processing and understanding ascii. Had to look up how to do nested sorts in python as I'd not done that before, otherwise pretty straightforward.
"By creating we think. By living we learn" - Patrick Geddes

Re: Advent of Code
« Reply #194 on: 04 December, 2016, 09:58:17 am »
I used Javascript again today but kept falling over my own programming inability, but got there in the end.



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 #195 on: 04 December, 2016, 12:09:31 pm »
Late starter  ::-)

Day 1 done, a bit harder than expected.



AoC_day_01 by The Pingus, on Flickr


Re: Advent of Code
« Reply #196 on: 04 December, 2016, 03:48:07 pm »
A bit lengthier to solve today but not hard - bit of regex processing and understanding ascii. Had to look up how to do nested sorts in python as I'd not done that before, otherwise pretty straightforward.

It was good to practice sort functions, but the best I could come up with for the checksum was

(click to show/hide)

I'm sure there must be a way to create the hash anonymously on the fly, but it's eluding me.
Quote from: tiermat
that's not science, it's semantics.

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #197 on: 04 December, 2016, 04:32:48 pm »
A bit lengthier to solve today but not hard - bit of regex processing and understanding ascii. Had to look up how to do nested sorts in python as I'd not done that before, otherwise pretty straightforward.

It was good to practice sort functions, but the best I could come up with for the checksum was

(click to show/hide)

I'm sure there must be a way to create the hash anonymously on the fly, but it's eluding me.
"By creating we think. By living we learn" - Patrick Geddes

Re: Advent of Code
« Reply #198 on: 04 December, 2016, 05:05:52 pm »
I see where you're going with that, but the wriggly problem is to keep track of the counts for each letter.

Looking forward to tomorrow's offering.
Quote from: tiermat
that's not science, it's semantics.

David Martin

  • Thats Dr Oi You thankyouverymuch
Re: Advent of Code
« Reply #199 on: 04 December, 2016, 05:27:03 pm »
I see where you're going with that, but the wriggly problem is to keep track of the counts for each letter.

Looking forward to tomorrow's offering.

It does that implicitly doesn't it? you are sorting on the letters and it is inefficient in that it runs the regex for every comparison. You don't need to keep track of the counts for each letter if they are readily recalculable.
"By creating we think. By living we learn" - Patrick Geddes