Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Genius sorting algorithm: Sleep sort

Name: Anonymous 2011-01-20 12:22

Man, am I a genius. Check out this sorting algorithm I just invented.


#!/bin/bash
function f() {
    sleep "$1"
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait


example usage:
./sleepsort.bash 5 3 6 3 6 3 1 4 7

Name: Anonymous 2011-06-24 10:00

THIS IS A MESSAGE FROM THE SUSSIX DEV TEAM (ME)

We're a bit offended that they left out our implementation from the Wikipedia article, obviously any piece of SUSSIX software is perfect per definition and should therefore be included, it would make the article a piece of post-modern art.

THIS HAS BEEN A MESSAGE FROM THE SUSSIX DEV TEAM (ME)

Newer Posts