18
3
Good Evening Golfers!
Your challenge is to completely unsort a series of numbers.
Input
Exactly 100 integers will be fed to your program. Your program may accept the input either as a file, or via stdin. Each integer will be separated by a newline character.
Those 100 integers will range from the minimal to the maximal values of a signed integer in your chosen language.
There will be no duplicate values. The values may be ordered, unordered or partially ordered - your program should be able to handle each case.
Output
The output must be each of the 100 integers, completely unsorted, each separated by a newline character. The output may be via stdout, or to a file.
Completely Unsorted means that no value is adjacent to any value which it would be adjacent to if the list were completely sorted in an ordered sequence.
Score
1 point per character, and lowest score wins. There is a bonus of -100 for any solution using no built in or library sorting functions. There is a bonus of -20 for any solutions using no built in random number functions.
I have tried to define this question as completely as possible. If you have any questions, please ask. If you have any comments on how I could do better next time, please let me know.
Fore!
There are exactly 100 integers input, and there are no duplicate values (see under "Input") – lochok – 2012-10-24T08:54:55.463
Right you are, didn't spot that. – Strigoides – 2012-10-24T09:01:02.233
2
It's not a duplicate as such, but it's not very different to http://codegolf.stackexchange.com/questions/6487/code-golf-mix-the-nuts-so-that-none-of-the-same-kind-are-touching
– Peter Taylor – 2012-10-24T11:10:20.327So many clever responses! I'll select shortest answer on Oct 31 at 8:10-Zulu – lochok – 2012-10-28T11:55:08.650