Sorting algorithms/Bubble sort: Difference between revisions

Content added Content deleted
Line 5,081: Line 5,081:
templates bubblesort
templates bubblesort
templates bubble
templates bubble
@: 1
@: 1;
1..$it-1 -> #
1..$it-1 -> #
$@ !
$@ !
<?($@bubblesort($it+1) <..~$@bubblesort($it)>)>
<?($@bubblesort($it+1) <..~$@bubblesort($it)>)>
@: $it
@: $it;
def temp: $@bubblesort($@)
def temp: $@bubblesort($@);
@bubblesort($@): $@bubblesort($@+1)
@bubblesort($@): $@bubblesort($@+1);
@bubblesort($@+1): $temp
@bubblesort($@+1): $temp;
end bubble
end bubble


@: $it
@: $it;
$it::length -> #
$it::length -> #
$@ !
$@ !
Line 5,100: Line 5,100:


[4,5,3,8,1,2,6,7,9,8,5] -> bubblesort -> !OUT::write
[4,5,3,8,1,2,6,7,9,8,5] -> bubblesort -> !OUT::write

</lang>
</lang>