all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,19 @@
function : Swap(p : Int[]) ~ Nil {
t := p[0];
p[0] := p[1];
p[1] := t;
}
function : Sort(a : Int[]) ~ Nil {
do {
sorted := true;
size -= 1;
for (i:=0; i<a->Size(); i+=1;) {
if (a[i+1] < a[i]) {
swap(a+i);
sorted := 0;
};
};
}
while (sorted = false);
}