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

3

u/nutrecht Lead Software Engineer / EU / 20+ YXP Dec 06 '15 edited Dec 08 '15

Day 6

Took a more Java 8 based approach than some other Java solutions I saw.

1

u/TheHorribleTruth Kind of meh Dec 06 '15

And regex heavy as well. For something simple like parsing words and coordinates? I just like using a simple split for that (and cut in bash)

1

u/nutrecht Lead Software Engineer / EU / 20+ YXP Dec 06 '15

And regex heavy as well. For something simple like parsing words and coordinates?

Regex heavy? It's just a single simple regex. IMHO your version, which even needs a check for the length of the splitted string, needs many more lines of code to do the exact same thing.

1

u/TheHorribleTruth Kind of meh Dec 06 '15

Yeah "heavy" was probably the wrong word. Also now that I'm thinking about it, .split() uses a regex under the hood, too. So basically my comment above really was hypocritical :)

1

u/nutrecht Lead Software Engineer / EU / 20+ YXP Dec 06 '15

Haha. Well. Admitting a mistake is the way to enlightenment. I have to do it almost daily ;)