15
2
The goal of this challenge is to write a program where the length of the following three are exactly the same:
- the length of the source code
- the length of the output it prints to the standard output
- the length of the compiler warnings it generates with the (unmodded) compiler of your choice
The winner is the shortest code to fulfill all three criteria, and has to be at least 1 character long.
To spice things up, if the output has less than three different characters, it gets a 5 point penalty added to the length for each one (so +10 if only a single type, +5 for two).
(Newlines count either as 1 or 2 characters, your choice, but it has to be consistent through all three criteria. Leading and trailing white-spaces are ignored in all lines in all three criteria)
In case of equal score, the one printing the most interesting result (instead of garbage) is the winner.
1What is a "type of character"? – Peter Taylor – 2012-05-17T18:36:17.557
Is compiling with
-Wall
allowed? Or is that considered "modding" the compiler? – Joey Adams – 2012-05-17T18:37:44.7175Also, what if the compiler produces non-warning output (e.g. "Compiling Main") ? Also, what if the name of the source file appears in warning messages (e.g. "foo.c:1:1: ...") ? – Joey Adams – 2012-05-17T18:40:02.623
@Peter Taylor: edited, I don't know if it's clearer now. I wanted to express that
aaaaaaa
is one,ababbbba
is made of two different characters. – vsz – 2012-05-17T18:59:39.130@Joey Adams: Good question, I should have thought about that. Is it too late to impose a mandatory filename? – vsz – 2012-05-17T19:00:45.463
3My weapon of choice is VBA, which doesn't really have a compiler and does not output a binary file to run (as is the case for some other languages, I believe). Are there considerations for this, or am I just disqualified by default? – Gaffi – 2012-05-17T19:17:42.480
2I wonder if a triple-quine is possible in some language? – Ry- – 2012-05-18T00:00:49.257
2For interpreted languages, we get an output even on occurance of an error, in such a case, are those errors accepted or are only warnings accepted? – l0n3sh4rk – 2012-05-18T10:51:59.723
1@Joey Adams: by unmodded I meant that modifying your compiler to print the warning you wanted would be obviously cheating. Sorry, I read too much IOCCC and am never paranoid enough about the rules and the possible circumvention of them. :) – vsz – 2012-05-22T06:19:49.713
=p
in ed unfortunately requires a newline. – jimmy23013 – 2017-03-29T01:24:08.650If there isn't the special note about newlines and whitespaces, someone may try
=p
in ed on Cygwin or MinGW. – jimmy23013 – 2017-03-29T02:06:55.157