23
4
Challenge: Implement ROT-47 in code that works as both itself and as the ROT-47 version of itself.
Scoring:
Your score is calculated as a percentage of used, ROT-47 eligible bytes in total of both versions of the program divided by total bytes (all characters) of both versions.
A used, ROT-47 eligible byte is any character that would be converted by the ROT-47 cipher that is not part of a comment or ignored by the compiler/interpreter. For example, any character in a brainfuck program that is not +-<>[],.
is not considered a used byte, and any character in a C program including and after //
or inside /* */
is not considered a used byte. All special symbols in APL are not considered used, as are all characters in a Whitespace program (sorry).
Ties will be broken by the program with the most upvotes. If there is still a tie, then the shortest program wins.
Example scoring:
C: 62/64 = 96.875%
Notice there is a space in this program. Obviously also, this program is not a valid entry because it doesn't even compile, but I wanted to show how scoring works.
main(){printf("Hello World!");}
4And what language does
>2:?WXLAC:?E7WQw6==@ (@C=5PQXjN
compile in? – None – 2014-03-03T20:51:23.727@hosch250 lol, that was just a dumb example – durron597 – 2014-03-03T20:52:35.123
1By "ROT-47 eligible" do you mean "in the ASCII range 33 to 126"? I.e. if my C program has spaces or newlines or tabs, do those count as ROT-47 eligible or not? What about the fact that some spaces are essential in order for a program to function in many languages - do those not count as used because they are not R47-eligible, even though the program would break without them? – Jonathan Van Matre – 2014-03-03T21:06:04.550
@JonathanVanMatre The spaces or newlines or tabs don't count because I feel the scoring would be too complicated otherwise; and I don't want Whitespace to be able to score 100%, because that would defeat the purpose. – durron597 – 2014-03-03T21:53:19.217
The score seems to be Turing-undecidable in the general case when using an interpreter, and dependent on undocumented properties of compilers when using a compiler. – Peter Taylor – 2014-03-03T22:40:29.007
2
To everyone who is objecting to my crazy scoring rules, please comment/answer here: http://meta.codegolf.stackexchange.com/questions/1167/change-scoring-type-after-the-fact
– durron597 – 2014-03-04T00:40:03.360