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,13 @@
fcn combSort(list){
len,gap,swaps:=list.len(),len,True;
while(gap>1 or swaps){
gap,swaps=(1).max(gap.toFloat()/1.2473), False;
foreach i in (len - gap){
if(list[i]>list[i + gap]){
list.swap(i,i + gap);
swaps=True;
}
}
}
list
}

View file

@ -0,0 +1,2 @@
combSort(List(28, 44, 46, 24, 19, 2, 17, 11, 25, 4)).println();
combSort("This is a test".toData()).text.println();