Bogosort in Scala (noncheating)