September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,7 @@
fcn pancakeSort(a){
foreach i in ([a.len()-1..1,-1]){
j := a.index((0).max(a[0,i+1])); // min for decending sort
if(i != j){ a.swap(0,j); a.swap(0,i); }
}
a
}

View file

@ -0,0 +1 @@
j := (i+1).reduce('wrap(x,y){ if(a[x]>a[y]) x else y });

View file

@ -0,0 +1 @@
pancakeSort(List(7,6,9,2,4,8,1,3,5)).println();