September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -1,25 +1,25 @@
import extensions.
import system'routines.
import extensions;
import system'routines;
extension $op
extension op
{
bogoSorter
[
var list := self.
bogoSorter()
{
var list := self;
until (list isAscendant)
[
list := list randomize(list length).
].
until (list.isAscendant())
{
list := list.randomize(list.Length)
};
^ list
]
}
}
program =
[
var list := (3, 4, 1, 8, 7, -2, 0).
public program()
{
var list := new int[]{3, 4, 1, 8, 7, -2, 0};
console printLine("before:", list).
console printLine("after :", list bogoSorter).
].
console.printLine("before:", list.asEnumerable());
console.printLine("after :", list.bogoSorter().asEnumerable())
}