Bash - 10 (or 8)
Well there have been a couple of answers that have been disqualified because they rely on the year. When golfing, andone side goal is to see how close we can get to breaking the rules as currently written without breaking the letter of the rules (I include the clarifications by Joe Z in the 66 existing comments on the rules). The question very specifically states that I can not depend on 2014 being the current year
. I instead rely on it being 8:14pm in my timezone.
date +%H%M
It will work just as well inWhen I ran it, it output 2014 exactly, thus it satisfies it No, it has to be 2014 exactly.
comment. (exactlyDue to context people seem to misread it as ... 2014 always
, but that was not what was written, even if that were perhaps what was intended.) a years timeThis lets me beat the current Bash
record, at least until this loophole is closed. Of course in a years time you could also runThis interpretation may seem too cheaty since all the existing popular answers assume that the rules really meant always
. Indeed some of them exploit this and export something that isn't exactly 2014, but instead contains 2014. I am fine with that interpretation too since Bash
can do:
date +%Y --date=last\cat year/*/*
This instead relies onis a mere 8 characters, which will concatenates a bunch of files including /dev/urandom/
, and it not beinggenerally takes my machine under a minute to find 2014 in /dev/urandom. Although my rule twisting golfing code of honour won't let me pick this solution since it violates the letter of Joe Z's clarification, the only objection Joe Z raised to the random approach in the 66 comments was that it was too long. At 8 characters this answer is actually shorter than my rules-lawyer answer.