r/javahelp • Out of Coffee error - System halted • Dec 02 '15

[META] Daily coding challenges for the Advent

For those who haven't yet seen it on other subreddits or on Facebook:

Advent of Code

Has daily coding challenges during the Advent season up to the 25th of December.

Each daily challenge is split in two parts of which the second one is only unlocked after successful completion of the first part.

The challenges are relatively small and fun to make.

Have fun coding!


EDIT

In order to prevent spoilers (that would reduce the fun for the others), please do not post code directly here in the thread, post the code on pastebin, gist, github, bitbucket, or the code hoster of your choice and link here only.


Edit 2: Post stickied for the duration of the Advent of Code to make it easier to find.

22 Upvotes

137 comments sorted by

View all comments

2

u/Philboyd_Studge Dec 20 '15

Day 20 was really easy. I would have been on the leader-board but I forgot I still have like three unfinished challenges.

2

u/TheHorribleTruth Kind of meh Dec 20 '15

I'm behind 3.5 days as well…

I got fucked with Day 20. I used an arithmetic based approach for task 1 instead of simulating it. Well.. and then task 2 came around :/
Here's the ugly mix: Day 20

2

u/Philboyd_Studge Dec 21 '15

I've never seen the underscore in literal numbers, is that really a thing? (like 1_000_000)

2

u/TheHorribleTruth Kind of meh Dec 21 '15

It was introduced in Java 7 (as one of the few things). To be honest, I've never used it before - but it came in somewhat handy for this task :)

1

u/desrtfx Out of Coffee error - System halted Dec 21 '15

Didn't realize that this existed in Java. I'm used to separating numbers by underscores from my PLC systems. Comes extremely handy when bit-encoding with binary masks (which I had to do a lot lately).