Sorting algorithms/Sleep sort: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: Added a Perl 6 entry)
Line 394: Line 394:
9
9
</pre>
</pre>

=={{header|Objeck}}==
<lang objeck>
use System.Concurrency;
use Collection;

bundle Default {
class Item from Thread {
@value : Int;
New(value : Int) {
Parent();
@value := value;
}

method : public : Run(param : System.Base) ~ Nil {
Sleep(1000 * @value);
@value->PrintLine();
}
}

class SleepSort {
function : Main(args : String[]) ~ Nil {
items := Vector->New();
each(i : args) {
items->AddBack(Item->New(args[i]->ToInt()));
};
each(i : items) {
items->Get(i)->As(Item)->Execute(Nil);
};
}
}
}
</lang>


=={{header|Objective-C}}==
=={{header|Objective-C}}==