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:
- 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
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.