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

1

u/TheHorribleTruth Kind of meh Dec 02 '15

Nice :)

Solved the first one using a text editor – software engineering at its finest :D

1

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

:) I used Excel and VBA for the first one.

Java (of course) for today's challenge.

1

u/TheHorribleTruth Kind of meh Dec 02 '15

Ahh, VBA – just as nasty :D

It's actually what I really like about these kind of puzzles/challanges, and why I like them as a tool for intermediate programmers: one can solve them any way – and in multiple ways.
Started with a text editor? Go solve it again in VBA. Then python. Then pure C. Get bored? Try it in brainfuck.

I've did/used to do ACM challenges on spoj, a site with now thousands of such problems. I really think it's a great way to dive into a problem set, a language or as I said above: learn to tackle the same thing in different languages.

2

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

Ahh, VBA – just as nasty :D

Well, we use a lot of VBA in our Export-tools. Yet, it was early in the morning, I wasn't fully awake (only on the first cup of coffee) and had Excel already open (still messing around with the darned signal list), so Alt-F11 and off I went ;)

Turned out not to be the best idea to write some VBA after months of Java & C#... Every second line ended with a semicolon and the VBA Editor complaining (I really loathe that damn window that pops up immediately upon every error), I constantly wrote for(int i=... and, of course, ended the function with return... and found out that if (...) { .... } is also not appreciated in VBA ;)

1

u/Philboyd_Studge Dec 02 '15

Did you put the entire test string into one cell?

1

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

Yes I did. Excel 2013 can easily handle that.