2
The biggest program that reads a single line (terminated by your choice from NULL/CR/LF/CRLF) from stdin, reverses it, then prints it to stdout.
No redundant code [code which could safely be deleted] such as
return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
or redundant data that's used to stop code being redundant:
char* data = <kernel source code>;
if (md5sum(data) != <hash>) {
return 1; //Fail for no good reason because it lets us add 1000000 lines of data
}
Basically, the largest implementation of a string reverse, with no obvious attempt to game the question.
[edit]
I am tempted to say that the code must be finite for unbounded input length, but there have been some clever and interesting O(>1) length solutions. I instead ask that people avoid posting simple brute-force lookup-list solutions as separate answers (comments are fine!).
1Longest code is [tag:code-bowling] rather than [tag:code-trolling] – Gareth – 2014-01-23T15:07:52.067
@Gareth: Cheers, changed – Mark K Cowan – 2014-01-23T15:09:35.527
2Ok, I'm really confused about the goal of this. You tagged this as [tag:popularity-contest], which implies a subjective competition, but you've defined an objective winning criteria. Then you've also tagged it [tag:code-trolling], which implies that you want some sort of useless or misguided answers to a relatively simple and undereducated question, but your challenge is not so simple and deliberately asking for a particular level of complexity. The challenge, as stated, is strictly [tag:code-bowling] only. – Iszi – 2014-01-23T15:10:42.907
1@Iszi: I'm new to this site... – Mark K Cowan – 2014-01-23T15:11:48.787
3Note: least efficient and largest are not necessarily the same. – Howard – 2014-01-23T15:33:17.497
Largest I can think of:
if (!strcmp(input, "aaa")) printf("aaa"); else if (!strcmp(input, "aab")) printf("baa");
, etc. So I guess the correct solution to this challenge is to figure out the longest possible size of an answer on stackexchange and implement as many compares as possible in it that reverse parts of the string. – Art – 2014-01-23T16:04:45.6471I suppose that this challenge should require a finitely long code that can theoretically deal with an infinitely long input. – Dennis Jaheruddin – 2014-01-23T16:40:56.690