Sounds like the very definition of a bogo-sort: http://www.jargon.net/jargonfile/b/bogo-sort.html
Not a member of The Register? Create a new account here.
Remember me on this computer? Post anonymously?