• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Advent of Code 2020

 
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh boy Liutauras, you've lit a fire of excitement under me!. I LOVE THIS TIME OF YEAR!!!

https://twitter.com/ericwastl/status/1316925529812049920?s=20

Eric Wastl wrote:Need a vacation from 2020? Why not go on an adventure and learn programming at the same time?

#AdventOfCode 2020 starts December 1st!!


Eric Wastl is the creator or Advent of Code.
 
Sheriff
Posts: 16103
268
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On a related note, Global Day of CodeRetreat is this weekend, Nov 6 & 7. I don't think there are any in-person ones scheduled this year given the global pandemic but I know there are few virtual ones you can sign up to attend. My current company, which has sponsored the local event now for many years running, decided they weren't going to do it this year. A little bit disappointing but understandable. I'm still going to try to do GDCR though and plan on joining one that's hosted from Manila (13 hrs ahead of my time zone).
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They look fun, although I have never done one.

Liutauras was in the middle of one when we met for lunch last year. Kinda crashed your party there, sorry.
 
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:...you've lit a fire of excitement under me!. I LOVE THIS TIME OF YEAR!!!


Oh great! Thank you for his profile, just followed.

Sounds like we are going to have fun again. Hopefully Stephan, Piet and Junilu could join too, and potentially others, who haven't tried it yet.

25 days to go...
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I sure hope so.

What language are you going for this time? Last year I used python but this year my team is doing a lot of TypeScript so might give that a go. I've never used it before so could be fun, or a disaster.
 
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I might polish my Haskell or take the opportunity to learn Rust, but when it comes down to it I'll probably stick with Java. If so, I will use the remainder of November to finish my AoC Toolset, which will allow me to quickly set up a skeletal solution every day including program input scraped from the Advent of Code website. If I'm feeling extra competitive, I might also go through some puzzles of the previous years to warm up and to standardize utilities I've used in the past years. I recall having had to write stuff like circular buffers multiple years.
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:TypeScript


That's a good one too, I might consider this.
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my MSc I'm going to have Haskell in Programming Paradigms module, in fact, this module is happening now in this semester, we just haven't reached it (Haskell) yet. Just skimmed over some of its documentation just now, and that worries me given that AoC isn't always a walk in a park, and the Haskell itself is probably even more challenging without any extra puzzles burden.

I can't believe I've started Advent of Excuses 2020 (phrase author - Tim Cooke) already...

I miss Racket actually, along with its recursion and functional constructs. But I'm going to research a bit more Haskell until then, that would be a good intro or continuation for me.


So far I've touched in my AoC career some Java, Racket, Kotlin and Scala (in the correct order).
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Haskell is a lot of fun to write, but horrible to read after a few months of not looking at your code...
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the server seemed to have a hard time with the load this morning and they took it down for a few minutes, but it was up shortly afterward and I could start the first puzzle and enter the solutions.

It appears Sree is on top of things again.
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I joined the party around an hour late this morning (the puzzles are released at 5am here) so missed the server outage excitement but read about it on Eric's twitter.

In a last minute switch I've decided to tackle them in Java this year. I had thought about using TypeScript but changed my mind because I've never used Java before and it's by far my strongest language.

Standard fare so far, day 1 pretty straight forward. Around day 10 is where the wheels usually come off my wagon so early days yet.
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No surprise Sree is leading. She usually does.
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems they are still down currently:

.----------------------.
| We'll be right back! |
'----------------------'
 
Saloon Keeper
Posts: 4350
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Big trouble here with part B. For some reason my NetBeans refused to accept 'Collectors....'. He offered to either define a field 'Collectors' or write a class Collectors. Maddening... Only when I manually typed: import static Collectors.toSet did the code run.
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Piet, I usually get an import to collectors by typing something like toList() and then using the lightbulb. Of course that won't help if NetBeans is acting up.
 
Piet Souris
Saloon Keeper
Posts: 4350
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that is the normal behaviour.

I have version 11.0 and it is a bit buggy. It happens regularly that, like this morning, I create a new project, and when you run it you get the error: can't find main or similar. Or that you run the new project and it runs a previous project. Closing the project ans reloading often helps.
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Piet, I'm wondering why did you need Collectors.toSet() there (in particular refering to a set) ?

For instance N = [1010, 234, 8678, 1010, ...] - so it would deduplicate 1010?
 
Piet Souris
Saloon Keeper
Posts: 4350
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tested for duplicates, and especially for 1010. So, Collectors.toSet() could be used safely.
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also used a set (except I didn't use collectors) because I made the assumption that the answer to the puzzle wouldn't use duplicates. If it had, my solution wouldn't have worked.
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That’s why I asked about Set, because input could have been [500, 500, 1020, ...] for three numbers setup, and maybe it was to somebody.
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most exercises I managed to solve with Racket (Scheme / Lisp) back in AoD 2017 (finished after earning 1 start from 23rd day), in fact, today's puzzle I did solve with Racket too, however, I'm switching to Java then too, as most of you, that way I won't feel disconnected, also my some previous years Java solutions were somewhat very novice comparing to yours who solved with Java, so I might could improve and learn something.
 
Greenhorn
Posts: 6
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all! Happy Advent of Code!

TIL that Python strings have a count method
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sree, happy Advent! I set my alarm clock but I couldn't beat you. :P
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sree!

It seems we have little to no chances to beat you on time, but we might have on count of stars. I recommend you not to get stuck
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I might need to pool my stars with one of you to stand a chance of beating Sree.

Sree, lovely to see you back with us again.
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Day 3, so far so good.
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup, with Java been quick, but I reworking with Racket now (today's exercise). I might switch back yet again to Racket, because it feels so much fun with it - since 2017 I forgot how to use it.
 
Piet Souris
Saloon Keeper
Posts: 4350
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was expecting for B: for what angle do we have minimal trees?

Where I live, a new puzzle is exposed at 6 AM. When I looked at 6.05 AM, there was already one with a gold star...
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Today's exercise was talking about slopes, what I've got with racket, it seems as a sloppy mess, that's because what it is, exactly what required.

Couldn't resist from not sharing it.


Hopefully things will improve with days  
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Piet Souris wrote:Where I live, a new puzzle is exposed at 6 AM.


Yup, here is 5am, but I look them around 8.30am, and then basically have 30 mins till work to crack on it. I think from day 7 30 mins won't be enough anymore, unless you are Sree of course.
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the earliest I've consistently gotten out of bed in the morning all year!
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done. Absolutely hated puzzle.
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got up at 5:45 for the first 3 days, but yesterday my girlfriend and I celebrated our 5 year anniversary with two bottles of wine, so I haven't started today's puzzle yet. :P
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations Stephan and Stephan++  
 
Stephan van Hulst
Saloon Keeper
Posts: 12809
278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
 
Liutauras Vilda
Sheriff
Posts: 7950
549
Mac OS X VI Editor BSD Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:...celebrated our 5 year anniversary with two bottles of wine, so I haven't started today's puzzle yet. :P


  congratulations!


It appears there are guys from my company who also participate in AoC, just joined their leaderboard as well - and I with kick opened the doors by bumping all of them down by one place
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have managed to crash the CME Group leaderboard, where Sree and I used to work, and I'm currently 22nd of 107. Not doing as well as you Liutauras. Even on my current team leaderboard with 12 people I'm 2nd, and the first place guy has a 3 year old toddler who likes to wake up at 5am so instant advantage there.
 
Piet Souris
Saloon Keeper
Posts: 4350
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrats, Stephan! Enjoy, 'cause before you know you'll be facing your 40th anniversary like some of us do...

Is it me, or is that assignment pretty laborious?

And looking at the scoreboard, my only ambition left is to be in that scoreboard in the first place.
 
Tim Cooke
Sheriff
Posts: 4968
318
IntelliJ IDE Python Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For anyone interested in playing with us, we're using my private leaderboard. The access code is: 60807-1a2fc49d

When you have joined drop in here and say hi so we know who's who. It's just for fun remember, not really a competition.
 
Bartender
Posts: 331
42
Firefox Browser MySQL Database Java Ubuntu
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm giving it a crack for the first time. I'm using Ruby, learning on the fly. I'm still a really green programmer, I'll see how far I get
 
Tell me how it all turns out. Here is a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic