Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Advent of Code 2021

 
Bartender
Posts: 579
14
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey All,

Are you ready?  
Is there a leader board setup for coderanch?


Join the coderanch leader board with this code: 554112-45da45c1
 
Saloon Keeper
Posts: 13505
305
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm assuming that all those who were in Tim's leaderboard last year will automatically participate in it this year, just as it has been in past years.

I'm sure that while I will make an attempt at most puzzles, I won't be getting up early to do them this year. The last few years that took quite a toll of me, and I noticed that more importantly than solving the puzzles early, it's important to stick with it and finish as much as possible.
 
Marshal
Posts: 5225
323
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
Oh yes, I'm ready. Very eager to get started, and then crash and burn at around day 10 which is the usual course of events.

Everybody is welcome to use my leaderboard, there's a mix of CodeRanch, friends, and past colleagues in there but the more the merrier.

60807-1a2fc49d
 
Tim Cooke
Marshal
Posts: 5225
323
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
In past years Sree P has been the girl to beat. Good luck!
 
Marshal
Posts: 8209
585
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
The very first year I participated in AoC were best for me (finished at half way through Day 23), then I gradually got worse and worse. But I enjoyed it equally well all the time.

I'm in.

Maybe just during the last few days, under assumption that I won't crash on day 7, I'll have to drop off because will travel - well, let's not start with excuses already.
 
Bartender
Posts: 370
44
Firefox Browser MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm looking forward to it, though I don't expect to get far
 
Tim Cooke
Marshal
Posts: 5225
323
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
It's the annual Advent of Excuses for Liutauras. Looking forward to some creativity this year.
 
Tim Cooke
Marshal
Posts: 5225
323
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

Stephan van Hulst wrote:more importantly than solving the puzzles early, it's important to stick with it and finish as much as possible.


Absolutely right. Solving puzzles quickly might keep you near the top of the leaderboard for the first half of December but in the long run quantity will earn you the glory.
 
Sheriff
Posts: 16767
281
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
I just completed Day 01. Used Kotlin. My solution works but could probably be more idiomatic.
 
Junilu Lacar
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:It's the annual Advent of Excuses for Liutauras. Looking forward to some creativity this year.


 
Tim Cooke
Marshal
Posts: 5225
323
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 spent some time last night trying to get my TypeScript environment ready for today, but it got to midnight and I bailed and went back to Java.

My AoC solutions can only be described as functional.
 
Junilu Lacar
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should we start a thread for each day, to discuss/share our solutions?
 
Liutauras Vilda
Marshal
Posts: 8209
585
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

Tim Cooke AoC 2021 wrote:I spent some time last night trying to get my TypeScript environment ready... and went back to Java


Tim Cooke AoC 2020 wrote:my team is doing a lot of TypeScript so might give that a go... I had thought about using TypeScript but changed my mind because I've never used Java before



I knew I heard it somewhere before. It's fine, it happens at least once twice, Tim.

 
Liutauras Vilda
Marshal
Posts: 8209
585
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
I'm using Java this year. For the same reason as Tim, never used it before (well, just on some singular days).
Until now, mostly used Racket (Lisp/Scheme family language), and one year did Scala.
 
Junilu Lacar
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:I spent some time last night trying to get my TypeScript environment ready for today, but it got to midnight and I bailed and went back to Java.

My AoC solutions can only be described as functional.



I used a template on GitHub to kickstart my AoC in Kotlin project: https://github.com/kotlin-hands-on/advent-of-code-kotlin-template

Would be nice if there was a similar one for TS as well.
 
Tim Cooke
Marshal
Posts: 5225
323
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 discovered aoc-cli for AoC interaction via the command line. I've yet to play with it but being able to script the input file retrieval and solution submission sounds like fun.
 
Tim Cooke
Marshal
Posts: 5225
323
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

Liurauras wrote:I knew I heard it before somewhere.


Oh boy you really got me there. How does the saying go? "If at first you don't succeed, try, try, again", and it does say "try" twice so I'm living up to the proverb.
 
Junilu Lacar
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just refactored my solution from Brute Force to more idiomatic Kotlin (I think) and the latter is so pretty, I want to share it. First, are we cool with sharing solutions and second, if it's cool to share, should I wait until tomorrow to do that?
 
Liutauras Vilda
Marshal
Posts: 8209
585
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
I think we used to share whenever we felt we want to.

I think all of us are wise here, and know why we are doing AoC (because it's fun).

If I wouldn't have solved it, I wouldn't look at your solution. Maybe just would make sense if that would be shared though github means or similar ,so it is not visible right away (until you click a link)?
 
Tim Cooke
Marshal
Posts: 5225
323
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
Perhaps keep this thread a spoiler free zone and post solutions and discussions around solutions in AoC 2021 - Day 01 Solutions, which clearly says "solutions" so if you enter you can't complain that you saw solutions.
 
Junilu Lacar
Sheriff
Posts: 16767
281
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

Liutauras Vilda wrote:If I wouldn't have solved it, I wouldn't look at your solution. Maybe just would make sense if that would be shared though github means or similar ,so it is not visible right away (until you click a link)?


I've added a link in the Day 01 solutions thread to tempt you.

If you're not solving in Kotlin then it wouldn't matter if you saw it anyway. I can't think of any way to do the same thing in Java.
 
Tim Cooke
Marshal
Posts: 5225
323
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
Here's the current leaderboard with CodeRanch folks in it, among others.

Which I think reduces to this with just CodeRanch folks

Perhaps it might be an idea for one of the other CodeRanch mods with an empty leaderboard to donate theirs as the official CodeRanch leaderboard? Mine's getting a bit out of hand.
 
Liutauras Vilda
Marshal
Posts: 8209
585
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
Jesse Duncan should be above me, yet another coderanch folk.
 
Liutauras Vilda
Marshal
Posts: 8209
585
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
Typical example of password leak. Seems we doubled or tripled in a year or two.
 
Tim Cooke
Marshal
Posts: 5225
323
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 know, like I said it's getting out of hand. I'm not sure who some of the folks are on there anymore, possibly CodeRanch members of past years, possibly past colleagues, who knows.
 
Al Hobbs
Bartender
Posts: 579
14
IntelliJ IDE Spring Fedora
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:I spent some time last night trying to get my TypeScript environment ready for today



I'm also doing it in TypeScript. You can use mine to help setup yours. My github is aquino-a.


I have an empty leader board that can be used for code ranch.  The code is: 554112-45da45c1
 
Stephan van Hulst
Saloon Keeper
Posts: 13505
305
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Day 3 was definitely a spike in difficulty. It wasn't difficult per se, but definitely more difficult than the past two days.

I also took my time to write an object oriented approach to help me deal with the second part.
 
Liutauras Vilda
Marshal
Posts: 8209
585
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
Al Hobbs, I think you can change the ordering of the leaderboard to be by [Stars].

That way I should bump Tim down the list given today's puzzle  
 
Tim Cooke
Marshal
Posts: 5225
323
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
Did somebody say "sore loser"?  
 
Stephan van Hulst
Saloon Keeper
Posts: 13505
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Junilu Lacar
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Day 3 was definitely a spike in difficulty. It wasn't difficult per se, but definitely more difficult than the past two days.


Yeah, looks like the warm-up period is over. I'm having fun rediscovering Kotlin with these puzzles though.
 
Liutauras Vilda
Marshal
Posts: 8209
585
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 this year JetBrains is one of top supporters of AoC. And of course they encouraging to solve problems in Kotlin and even win prizes.
https://blog.jetbrains.com/kotlin/2021/11/advent-of-code-2021-in-kotlin/

Junilu and Mike both solve in Kotlin..

It is nice to see how Advent of Code actually grows. Just checked the stats from back in 2017. The first problem was solved by 50K users, while now in 2021, almost 150K - tripled.

It's really so fun. I think Tim brought this here to coderanch. Actually going to find that thread, because I don't remember exactly how all this started.
 
Tim Cooke
Marshal
Posts: 5225
323
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

Liutauras Vilda wrote:It's really so fun. I think Tim brought this here to coderanch. Actually going to find that thread, because I don't remember exactly how all this started.


Looks like that was back in 2017 and even got a mention in the December 2017 Journal. It's a lot of fun and I really enjoy the solution sharing and surrounding conversations that we have here on the Ranch. It's interesting to see how other people approach problems sometimes differently to me.
 
Liutauras Vilda
Marshal
Posts: 8209
585
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
Ok, I'm not a fan of the puzzles of this kind (like day 5), but I'm very glad I'm able to crack them on, if trying hard enough.

Initially I over complicated it, and went slightly off the track, worked on sample input, but failed on real, in about 5 minutes understood what the problem is. Then had an approach re-thinking session after another cup of coffee. Figured out the way simpler and more straight forward way. As a result part 1 got solved.

Then I knew upfront what the second part going to be (they stated indirectly in the instructions), and I knew which part of code won't work for me, hence will need to modify. And that bugged me, those bi-directional point generations for all scenarios. That's the method which looks a bit ugly on my end and needs refactoring.
 
Tim Cooke
Marshal
Posts: 5225
323
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
Today (Day 6) was the first of the kind where part 2 is logically equivalent to part 1 but has the potential to consume too much system resources to be practical. I like these types of puzzle, they're fun.
 
Stephan van Hulst
Saloon Keeper
Posts: 13505
305
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aye, I like the optimization puzzles as well.

I haven't solved part 2 yet, but I do already have a strategy. I'm going to shower first though.
 
Tim Cooke
Marshal
Posts: 5225
323
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

Stephan van Hulst wrote:I'm going to shower first though.


The shower is a good thinking place. Software problems are solved with brains not computers.
 
Stephan van Hulst
Saloon Keeper
Posts: 13505
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My strategy worked, and I would have figured out that it worked a LOT sooner had I used long instead of int in the first version of my code.
 
Liutauras Vilda
Marshal
Posts: 8209
585
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
I've solved part 1 very quickly, before parental duties. Will take a stab at part2 later in an evening. Will spare some time thinking first, so in an evening hopefully will be just expressing that in code.

After looking at specified output of the sample input for part2, I didn't even dare to run on actual one with my code from part1.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It is nice to see how Advent of Code actually grows. Just checked the stats from back in 2017. The first problem was solved by 50K users, while now in 2021, almost 150K - tripled.



Wow! I have no hope on making it to the global board this year  
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic