Home Forums Chat Forum Advent of Code

Viewing 40 posts - 41 through 80 (of 218 total)
  • Advent of Code
  • ebygomm
    Free Member

    I was able to brute force a solution this morning before I stumbled on a cleverer way

    llama
    Full Member

    this is much more interesting than the meeting I am in

    got to day 3 part 2

    llama
    Full Member

    d3p2 took some typing

    jimmy
    Full Member

    @jimmy – post code if you are stuck, probably something very simple.

    Thanks. The fact it works for D1P2 suggests there’s some data nuance I’ve missed. But I’m onto D2P2 now. Just doing it because I miss scripting now absent from the day job.

    haloric
    Free Member

    Oh dear – I posted the wrong AoC STW code a few minutes ago – apologies if you joined and then get booted from our work leaderboard.

    I have created a STW leaderboard, where we can all revel in our lack of effort.

    Its the end of no-effort November, into born-to-be-mild December.

    The correct code is, scouts honour checked it a few times now, 502307-275d7a99

    Thanks
    Ant

    StuF
    Full Member

    I’m sure there’s a thread about work ethic and not being distracted by quizzes. I could waste a lot of time with these

    Aidy
    Free Member

    Thanks. The fact it works for D1P2 suggests there’s some data nuance I’ve missed.

    Probably miscounting at the start/end, and works for p2 because comparing n-1/n+1 happens to give you the right answer despite that.

    Superficial
    Free Member

    Out of interest, how long are these taking people?

    I can code stuff semi-competently in Matlab but as stated I’m trying it in R. I can think up a possible solution within seconds, but getting it into a script takes time, and there’s always some error / troubleshooting to be done (converting numbers to strings is a PITA, and I don’t quite ‘get’ data structures and indexing in R very fluidly). As a result, I reckon each day’s challenge probably takes at least an hour.

    Aidy
    Free Member

    Out of interest, how long are these taking people?

    I think they’ve all been under 10 minutes so far. Before I’ve gotten to the bottom of the first cup of coffee, anyway.

    The leaderboard times are pretty impressive – 1:32 for the fastest to get to both stars today.

    https://adventofcode.com/2021/leaderboard/day/7

    ebygomm
    Free Member

    It varies for me depending on the nature of the problem. Saturday probably took me an hour for both parts, Sunday only 10 minutes. I’d nearly always be able to do them more quickly in python, but the challenge I’ve set myself is to do them in FME.

    Also, if you’ve done previous contests, you get to know the style of problems they set so that makes things easier.

    Nine times out of ten, if you can brute force a solution for part 1, you’ll find part 2 needs a rewrite so you know to start looking for patterns or alternative ways of getting the answer. Today’s was unusual in that you could complete part 2 even with a naive solution for part 1

    Superficial
    Free Member

    Hmm, that’s not making me feel better 😀 Are you guys professionals?

    tomparkin
    Full Member

    I can code stuff semi-competently in Matlab but as stated I’m trying it in R. I can think up a possible solution within seconds, but getting it into a script takes time, and there’s always some error / troubleshooting to be done (converting numbers to strings is a PITA, and I don’t quite ‘get’ data structures and indexing in R very fluidly). As a result, I reckon each day’s challenge probably takes at least an hour.

    The trouble you have there IMO is that you’re not “doing advent of code”, you’re doing advent of code as a part of the process of learning R.

    If you had the language details at your fingertips you’d be able to concentrate on the problems and solutions rather than looking up language details.

    Aidy
    Free Member

    Are you guys professionals?

    Yes.

    But yeah, you’re learning a new language – trying at all is winning.

    ebygomm
    Free Member

    Are you guys professionals?

    I’m not a programmer/developer but I’m solving them with FME which is pretty much my day job. Although the data wrangling I do day to day is quite far removed from Advent of Code type puzzles.

    Superficial
    Free Member

    Yeah you’re right. I just did both parts of day 7 in my favoured Matlab code and got it done in about 15 mins. Not lightning quick but waaay quicker.

    R is kind of similar to Matlab* but sufficiently enough that I have to look up nearly everything!

    * Python is also similar

    Superficial
    Free Member

    Just doing the Lanternfish exponential growth one and it’s broken my computer! I guess my code was pretty inefficient. 80 iterations ran quickly, and I thought that my code allowed me to simply swap number_iterations=80 for 256 and press run. But instead, I’ve run out of RAM 😀

    Aidy
    Free Member

    But instead, I’ve run out of RAM

    640K is all you really need.

    ebygomm
    Free Member

    I had to do a complete rewrite for part 2 of lanternfish too 🙂

    llama
    Full Member

    For me so far d4 took the longest, d5-7 not very long, I had to redo the fish one too

    They are all in a similar style but how people get sub 2 mins I have no idea

    Aidy
    Free Member

    They are all in a similar style but how people get sub 2 mins I have no idea

    A lot of it is just having done enough of them, and built up enough of a toolkit to refer to.

    I’ve been doing them pretty leisurely in the morning whilst I’m still waking up, and flipping languages for fun, but if I was taking it seriously, I’d probably be looking at 3-4 minutes for most of them so far.

    Superficial
    Free Member

    640K is all you really need.

    Can’t work out if that’s just a computer joke, or whether it’s a serious attack on my code optimisation 😀

    Superficial
    Free Member

    Oooooohh. Yeah. 😀

    (I just worked out how to do the Laternfish one in less than a second of computing time and definitely less than 8Gb RAM)

    ebygomm
    Free Member

    I made the mistake of trying to read today’s puzzle before coffee, took me 5 minutes to work out what they were asking for nevermind solving it!

    jimmy
    Full Member

    Stalled on D3 last night. I have a theory but it’s testing my PS knowledge. As usual, I’m sure there are inbuilt clever ways to do it but I’m too old skool clunky.

    Aidy
    Free Member

    Today’s took quite a bit of effort. Hared off down the wrong path trying to be too clever to start with.

    ebygomm
    Free Member

    My solution today feels clunky but not sure I can make it any more elegant in FME

    bassmandan
    Full Member

    I think I’ve given up at day 4 having spent the best part of an hour today writing the world biggest nested for loop to get halfway to the answer and then being stumped on where to go next. Maybe next year I’ll have more python skills.

    ebygomm
    Free Member

    You don’t need to complete a day to go on to the next so you can always dip in and out.

    llama
    Full Member

    Yes didn’t get today’s figured out before I had to start doing paid work, it’s tricky

    stevehine
    Full Member

    I too niaively thought I’d just up the iterations for the lanternfish 😁

    ebygomm
    Free Member

    Loved today’s puzzle, right up my street.

    llama
    Full Member

    yes it was a good one

    I’ll go back to yesterday’s later, I think I need to read it again because I’m not seeing it

    llama
    Full Member

    Got yesterday’s. The way I read it made me think that some clever trick was necessary. In the end I did a big search.

    stevehine
    Full Member

    I enjoyed todays; took me back to my youth creating programs to draw graphics in 8-bit micros 😀

    jimmy
    Full Member

    Just finished Day3Pt1. I had the logic early on, just getting the code to work for me took way too long.

    This is fun / addictve but I don’t really have the time!

    bikesandboots
    Full Member

    CBA this year. I’ve started it the past couple of years, but after about 2 weeks in it tends to require about an hour every day, and the mental energy, neither of which I have.

    euain
    Full Member

    It is a fun wee puzzle after breakfast – thanks for posting OP. I’m lazy so cheating and just doing it in Java.

    I thought today’s was quite a bit easier than yesterdays – once I realised my answers were bigger than 2^32 and my scores going negative. Doh..

    Aidy
    Free Member

    Nice quick one today

    ebygomm
    Free Member

    I’ve got all the stars for days 1 through 10 in FME which is an improvement on last year. I had to resort to a pythoncaller within FME for part 2 of one of the puzzles by this stage last year.

    Pleasantly surprised that my part 1 solution today led nicely into part 2

    llama
    Full Member

    Took longer than d9, but I switched to a style/lang I am less familiar with (excuses, excuses). Got a tidy solution though. I suspected what part 2 would be, so getting the point was easier than figuring the convoluted score!

    Doing this kind of thing in what I imagine FME to be sounds horrible

Viewing 40 posts - 41 through 80 (of 218 total)

You must be logged in to reply to this topic.