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

 
Marshal
Posts: 5222
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
Hey Sree, great to see you! The CodeRanch leaderboard is all that matters, you know that.

We've moved it this year because mine was getting out of hand with so please join us in Al Hobbs's leaderboard

Join code: 554112-45da45c1
 
Saloon Keeper
Posts: 13504
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sree! Good to have you with us again!
 
Stephan van Hulst
Saloon Keeper
Posts: 13504
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oooh, Tim is hot on my heels.
 
Stephan van Hulst
Saloon Keeper
Posts: 13504
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It also appears as if the sleigh keys have gone down the Mariana trench.
 
Ranch Hand
Posts: 87
Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wow, I'm just learning about this.  I guess I'm pretty late, but want to read up and join in next year!

David
 
Stephan van Hulst
Saloon Keeper
Posts: 13504
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're not nearly too late for this year. Work on the puzzles that have already been released to catch up, and you can still easily score a nice ranking if you keep up with the puzzles that are yet to come.

I went back through the last few years, and on average day 16 is my breaking point. I've never even started a puzzle after day 20.
 
David Sachdev
Ranch Hand
Posts: 87
Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You're not nearly too late for this year. Work on the puzzles that have already been released to catch up, and you can still easily score a nice ranking if you keep up with the puzzles that are yet to come.

I went back through the last few years, and on average day 16 is my breaking point. I've never even started a puzzle after day 20.



Thanks for the insight - I've been checking out the website!

Thanks
David
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Haha oh of course The CodeRanch is #1. I'm doing Java and python again this year and trying to catch up from last year. Last year's challenges are really... challenging!
 
Tim Cooke
Marshal
Posts: 5222
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 would be my pleasure Sree for you to join our leaderboard and knock Stephan off the top spot
 
Stephan van Hulst
Saloon Keeper
Posts: 13504
305
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*mumble mumble*

You were well on your way of doing that yourself Tim.
 
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
Nice day 9.

Part 1. Done in the first half of the day.

Part 2. Just sat down to it, and it took a bit of time to understand what they are asking for in the first place. Got it eventually. Wrote my solution, it works on test input, however, the answer is incorrect on the actual one.

Off for investigation. But at the moment is a bit weird.
 
Stephan van Hulst
Saloon Keeper
Posts: 13504
305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Day 13 pretty straightforward.

I'm a little bit disappointed that we haven't had any recurring problems yet, like in past years. You know, the kind of problems where you have to reuse and improve on a solution you wrote for an earlier day. Do you guys figure one will still pop up?
 
Tim Cooke
Marshal
Posts: 5222
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
Maybe. We're only half way through.
 
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 a bit behind. Haven't attempted yesterday's (day12) yet.

Yesterday had Santa party for the little one + a lot shopping + etc. And school holidays started 1 week earlier this year, so I won't have a cone of silence (Get Smart - I loved those series so much, they were fun) anymore.

Tim, is that's the creativity you were requesting this year?

I'll try to catch-up. Would be nice actually before next AoC comes to solve all the backlog from previous years. But that might be too optimistic.
 
Tim Cooke
Marshal
Posts: 5222
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 14) was the most challenging yet. First off I hit memory space issues, followed by completion time issues. Fun though.
 
Stephan van Hulst
Saloon Keeper
Posts: 13504
305
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I had the exact same issues.

My naive solution was enough for part 1, but I couldn't work on part 2 until later this evening. I profiled my solution and made some optimizations, but it wasn't enough.

I figured out a completely new approach that should work, but I'm too tired right now to implement it. You win this round Tim, but I'm coming for you.
 
Tim Cooke
Marshal
Posts: 5222
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
Slowly plugging away here although very far behind the bleeding edge. I'm currently attempting day 18.

I've gotten more stars this year than any year previous so I'm taking that as a victory no matter how it pans out in the end.
 
Bartender
Posts: 4752
184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am reviewing some of my AdventOfCode solutions, to see whether there are some improvements possible.

For exercise 13 I used an enum (bit like using a canon to shoot a mosquito), but I had this:

But I didn't like the @Override, so yesterday I came up with this:

But looking at the two, I find the first one a bit more readable. Anyone with some useful suggestions?
 
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
One thing got to my attention immediately seeing: DownUp, LeftRight - it looks confusing to me without being much in the context.

Wouldn't communicate whatever that is better: Horizontally, Vertically?
 
Piet Souris
Bartender
Posts: 4752
184
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find Horizontal/Vertical (indeed what I had first) more confusing. DownUp means folding the bottompart up to the top, and RightLeft means folding the right side to the left.
 
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

Piet Souris wrote:DownUp means folding the bottompart up to the top, and RightLeft means folding the right side to the left.


Ah, ok, in this context probably yes. I assumed that is something to do about movement.
 
Piet Souris
Bartender
Posts: 4752
184
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way: I first made a 2D array to get the code, but I changed that to a BufferedImage (TYPE_BYTE_BINARY) , wrote the points to it and saved it as a PNG. Fun!
Be aware that you need quite some enlargement to see the result.
 
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