Author Topic: Advent of Code  (Read 115184 times)

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #875 on: 05 December, 2020, 09:16:21 pm »
Day 5 relatively trivial.

(click to show/hide)

EDIT: or more efficiently with direct conversion...

(click to show/hide)

Re: Advent of Code
« Reply #876 on: 05 December, 2020, 10:49:03 pm »

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
Re: Advent of Code
« Reply #877 on: 05 December, 2020, 11:01:24 pm »
Day 5 probably the easiest spreadsheet yet:
https://docs.google.com/spreadsheets/d/1urBVcFFAz4HzJshKldFKtgobE_Zi8DGGNgY4Na5ATHw/edit?usp=sharing

Loving the spreadsheet solutions :thumbsup: You are Dido Harding AICMFP  :D

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #878 on: 05 December, 2020, 11:08:48 pm »
Day 5 probably the easiest spreadsheet yet:
https://docs.google.com/spreadsheets/d/1urBVcFFAz4HzJshKldFKtgobE_Zi8DGGNgY4Na5ATHw/edit?usp=sharing

So - your data set is different than mine - bigger even. Does that mean each participant gets their own data?

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
Re: Advent of Code
« Reply #879 on: 05 December, 2020, 11:16:47 pm »
Day 5 probably the easiest spreadsheet yet:
https://docs.google.com/spreadsheets/d/1urBVcFFAz4HzJshKldFKtgobE_Zi8DGGNgY4Na5ATHw/edit?usp=sharing

So - your data set is different than mine - bigger even. Does that mean each participant gets their own data?

Yes

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #880 on: 06 December, 2020, 12:20:02 am »
That is very cool.

The creators obviously put a lot of work into that.

Re: Advent of Code
« Reply #881 on: 06 December, 2020, 09:43:32 am »
Day 6 was nowhere near as difficult as I expected.

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

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #882 on: 06 December, 2020, 09:44:38 am »
Day 6 complete.

I have to say Python has an incredibly rich set of functionality. Almost every operation I need to do has a pre-defined method.

(click to show/hide)

Re: Advent of Code
« Reply #883 on: 06 December, 2020, 10:22:47 am »
Day 6: Still spreadsheeting
https://docs.google.com/spreadsheets/d/1VXcXG-N5KLMXUIs0Tdb7ObusNgZVVFaLnjdTCfD4AsA/edit?usp=sharing

I cocked up this time because this is the first dataset that's longer than 1000 lines (Google Sheets default size) and I handed bothered filling down my formulae.

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
Re: Advent of Code
« Reply #884 on: 06 December, 2020, 12:24:06 pm »

Re: Advent of Code
« Reply #885 on: 07 December, 2020, 01:16:23 pm »
Day 7:

Spent much longer wrestling with the shitty lookup functions (VLOOKUP and MATCH) then I did with making recursion work.

https://docs.google.com/spreadsheets/d/11cUvSGYl9NT2-3prdotWaXyiD_-DfIFLJmeRujuxXwQ/edit?usp=sharing

Re: Advent of Code
« Reply #886 on: 07 December, 2020, 02:14:26 pm »
Luckily part 2 didn't ask about the shiny purple bag:

BAG: shiny purple = 365714937810

Still waiting for a humdinger.
"Yes please" said Squirrel "biscuits are our favourite things."

Davef

Re: Advent of Code
« Reply #887 on: 07 December, 2020, 02:30:45 pm »
Just done days 2 through 7. Not very exciting so far.

Re: Advent of Code
« Reply #888 on: 07 December, 2020, 07:29:53 pm »
Just done 2016 day 11. Had a mental block on it at the time, not sure why, it was fairly straightforward when I actually started coding it, with some interesting puzzles over optimisation.
Quote from: tiermat
that's not science, it's semantics.

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #889 on: 07 December, 2020, 09:14:56 pm »
Well, as a relative novice, today had me scratching my head a little.

Getting head around recursion is tricky. I also had a function return statement that prevented the function processing anything other than the first "subbag" - which took nearly an hour to find.

Even just working out how to parse the input takes some time if you've never done it before.

Still - got there in the end.

(click to show/hide)

Davef

Re: Advent of Code
« Reply #890 on: 08 December, 2020, 09:42:23 am »
A little more interesting today. I can see there could be some fun ahead.

Re: Advent of Code
« Reply #891 on: 08 December, 2020, 09:45:47 am »
Indeed, the beginnings of the VM.

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

Davef

Re: Advent of Code
« Reply #892 on: 08 December, 2020, 09:50:19 am »
I was thinking Gödel’s incompleteness theorem and the Turing halting problem. It might inspire you to go back to your bookshelf.

Ben T

Re: Advent of Code
« Reply #893 on: 08 December, 2020, 10:01:58 am »
I bloody hate these ones where you have to try and reverse engineer the machine code to find out what it's doing. For day 8 it was quite easy to test whether it's an infinite loop or not, as the program is effectively immutable. It's the ones where it jumps by the amount of a variable that are annoying.

Re: Advent of Code
« Reply #894 on: 08 December, 2020, 10:09:25 am »
I kind of like this ones.

I end up rewriting it in something like perl and then replacing the instructions/jumps/branches with higher level constructs (while loops, for loops, etc) and then working out what the code is doing (such as painfully slowly implementing Eulers totient or phi function or similar).
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #895 on: 08 December, 2020, 10:17:31 am »
I was thinking Gödel’s incompleteness theorem and the Turing halting problem. It might inspire you to go back to your bookshelf.

And my degree(s). I did a fair bit on both of those in each of them.

Looking forward to some other problems like:-
* a big nasty number theory problem (like the Chinese Remainder Theorem inspired one [2017 day 13], or the famous Space Cards [2019 day 22]).
* an A* or SAT style solver
* ...probably in a maze of some sort
* Writing something to interactively play a game (like Breakout [2019 day 13])
* A 3D (or even 4D) problem
"Yes please" said Squirrel "biscuits are our favourite things."

Ben T

Re: Advent of Code
« Reply #896 on: 08 December, 2020, 11:07:48 am »
I kind of like this ones.

I end up rewriting it in something like perl and then replacing the instructions/jumps/branches with higher level constructs (while loops, for loops, etc) and then working out what the code is doing (such as painfully slowly implementing Eulers totient or phi function or similar).
I'll usually just leave it grinding away in C++ on my old ubuntu laptop unless it's literally going to take years.  :)

Re: Advent of Code
« Reply #897 on: 08 December, 2020, 11:52:56 am »
Day 8 done:
https://docs.google.com/spreadsheets/d/1QLnJ--jc1d18qHiwcO1QXnqyaoG078-09HlYiXvoA_0/edit#gid=1072555748

I started doing part 2 by inspection, but that seemed against the spirit of it. So executed it 500 times in one spreadsheet instead. Fan is still spinning.

tonycollinet

  • No Longer a western province of Númenor
Re: Advent of Code
« Reply #898 on: 08 December, 2020, 07:51:37 pm »
Day 8 done.

Quite liked this one - though tied myself up with failing to modify global variables in a function. Eventually found the "global" statement.

(click to show/hide)


Re: Advent of Code
« Reply #899 on: 09 December, 2020, 07:59:08 am »
Day 9 underwhelming.

Lucky as I've got a busy day.
"Yes please" said Squirrel "biscuits are our favourite things."