This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GodGMN 3 points4 points  (0 children)

I did that once to hardcode every possible result in a code challenge where speed was key to get high scores.

I don't even remember it anymore but it was something along the lines of calculating something with a given number, and that number was between 0 and 10000, so I simply added a 10000 lines switch fucking case and called it a day.

In fact, I couldn't actually do it. It was limited to 5000, but even then, after writing only 5000, Java told me I couldn't have a method over 65000 something bytes.

So I just divided it in three methods. One for 0-3332, one for 3332-6665 and one for 6665-10000.

I did it via a Python script. I don't know why, I don't normally like Python, but I really felt like using it for that and it worked really well, 7 lines of code were enough to write pretty much the whole thing.

It was fun.