Author Topic: Advent of Code  (Read 113055 times)

Re: Advent of Code
« Reply #1175 on: 19 December, 2023, 03:20:53 pm »
I spend all day writing code and solving problems.

As much as I try to do AoC I just can't get the energy up to do it in the evenings after work.
Somewhat of a professional tea drinker.


Re: Advent of Code
« Reply #1176 on: 19 December, 2023, 03:34:00 pm »
I do it in the morning before work usually. My daughter leaves for school around 7.15 and so I've got ~2 hours before I start work. Usually I'd either go for a swim/bike/run in this time, or just start work early and then have a longer lunch or knock off early, but in December it's generally AoC time.

For the trickier days doing AoC may bleed over into lunchtime or the evening, but I find that subconscious thought (while I'm doing my day job) helps get me to the solution without taking too much time sat actively staring at it. Reading elsewhere (the AoC subreddit mostly) it seems I'm lucky that I'm able to put an AoC problem down once I need to focus on something else (e.g. what I get paid for) and it doesn't bother me to do so.

The weekends (or holidays) I just have to find the time whenever outside family life.

Going back and redoing all of the previous years in Go is becoming a bit of a slog, especially now that I've picked off most of the easy ones from each year, but the plan is to tackle 1-3 days at a time in the new year and I'll get through them all in a few months. Already having a solution (albeit in C/perl/?) helps. Also going back and looking at my old code is a useful exercise to see how long it takes me to understand it and whether there are any useful comments/etc.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #1177 on: 20 December, 2023, 03:31:56 pm »
Spoiler day 20

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

Re: Advent of Code
« Reply #1178 on: 21 December, 2023, 11:11:57 am »
Spoiler Day 21 part 2

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

Re: Advent of Code
« Reply #1179 on: 21 December, 2023, 10:15:20 pm »
2023 Day 21 Part 2 mild spoiler from the AoC Creator

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

vorsprung

  • Opposites Attract
    • Audaxing
Re: Advent of Code
« Reply #1180 on: 22 December, 2023, 11:51:59 am »
a mixture of shell, C and predominantly perl. Now most of my professional coding is in Go

Same here

vorsprung

  • Opposites Attract
    • Audaxing
Re: Advent of Code
« Reply #1181 on: 22 December, 2023, 11:55:57 am »
Wot Greenbank sed.

For me, over the years I've used AoC to improve my skills in Java, Elm, JavaScript and C++ as well as general data structures and algorithm competence. I also use it with students (from first year undergraduates to PhDs) to help them develop their algorithmic thinking, reasoning and communication. I didn't do a Comp Sci or Maths degree so AoC has been useful learning tool for me (and mostly fun).

I don't have any students.  At the moment I am only mentoring one person, maybe I should teach them how to program properly.  Hmmm

jwo

Re: Advent of Code
« Reply #1182 on: 23 December, 2023, 11:32:20 pm »
Day 23

A little easier than the last few days, but struggled to get computing Part 2 to anything faster than around 10 seconds.

(click to show/hide)

Re: Advent of Code
« Reply #1183 on: 27 December, 2023, 02:09:51 pm »
Got there in the end as I was busy/pissed most of 24th/25th/26th.

Have to redo/optimise days 22, 23, 24, 25. Plus revisit a few days (12, 14, 16, 17, 20) that are taking a bit more than they should but it can go on the backlog for now until my brain is ready for them.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: Advent of Code
« Reply #1184 on: 01 January, 2024, 08:19:44 pm »
Had a bit of a break, so only on day 19.

Bah. And Grr.

Spent ages working out what would happen if the ranges on different paths overlapped, and what if a path had a disjoint range, then a bit of time coding up the range flattening... Only to find that it had been crafted so that no ranges overlapped and the simple sum of combinations for each route gave the answer.

My final code cut simply down to
(click to show/hide)
Quote from: tiermat
that's not science, it's semantics.

Re: Advent of Code
« Reply #1185 on: 01 January, 2024, 08:55:41 pm »
a mixture of shell, C and predominantly perl. Now most of my professional coding is in Go

Same here

I'd done* many of the previous years in Perl. A lot of the problems seemed to be geared towards languages like Perl and Python. One year I tried to solve them in regular expressions, which worked for the first several days at least.

I've learnt a huge amount by solving them in C# LINQ this year. I'll be giving a talk on LINQ Best Practice in a couple of weeks to the internal C# group, 100+ developers. It's become apparent that 90% of them are "doing it wrong", and most of the other 10% are simply following received wisdom (including me up to now). There's a paucity of good guidance or documentation on what is one of the sharpest tools in the C# box. In fact it's a lot like Perl in that it's easy to write something that works, but you need a deeper understanding to write something that Works Well and is clear/maintainable.


* not finished though
Quote from: tiermat
that's not science, it's semantics.