28
8
The Task
Write a program, in the language of your choice, that reads lines of input from standard input until EOF, and then writes them to standard output in ASCIIbetical order, similar to the sort
command-line program. A short, non-underhanded example in Python is:
import sys
for line in sorted(sys.stdin):
print(line.rstrip('\n'))
The underhanded part
Similar to The OS War, your goal is to prove that your favored platform is “better”, by having your program deliberately run much more slowly on a competing platform. For the sake of this contest, a “platform” consists of any combination of:
- Processor
- Architecture (x86, Alpha, ARM, MIPS, PowerPC, etc.)
- Bitness (64-bit vs. 32-bit vs. 16-bit)
- Big- versus little-endian
- Operating System
- Windows vs. Linux vs. Mac OS, etc.
- Different versions of the same operating system
- Language implementation
- Different compiler/interpreter vendors (e.g., MSVC++ vs. GCC)
- Different versions of the same compiler/interpreter
Although you could meet the requirements by writing code like:
#ifndef _WIN32
Sleep(1000);
#endif
Such an answer should not be upvoted. The goal is to be subtle. Ideally, your code should look like it's not platform-dependent at all. If you do have any #ifdef
statements (or conditions based on os.name
or System.Environment.OSVersion
or whatever), they should have a plausible justification (based on a lie, of course).
Include in your answer
- The code
- Your “favorite” and “unfavorite” platforms.
- An input with which to test your program.
- The running time on each platform, for the same input.
- A description of why the program runs so slowly on the unfavorite platform.
2
I'm voting to close this question as off-topic because underhanded challenges are no longer on-topic on this site. http://meta.codegolf.stackexchange.com/a/8326/20469
– cat – 2016-04-18T12:43:20.3574This is harder than I thought. The only answers I can come up with are either very long and a bit obvious, or very short and extremely obvious :-( – r3mainer – 2014-01-30T16:16:34.763