bubble sort by %20

$q
1d
:0
N
$!b0
y/\n/ /
s/^/compare = 0   swap = 0   data: /
s/\<.\>/0&/g
:
s/\>/-/2
s/ /<9876543210>/12
/\<\(\(.*\)\(.\)\w*\)<.*\3.*\(.\).*>\(\2\4\w*\)\>/{s//\5!\1/
s/\>/-/4}
s/<.*>/!/
:1
s/-/<123456789-01>/
s/\(.\)<.*\1\(-*.\).*>/\2/
t1
H
:2
/\> \</b
s/\(.*\)!/\1#/
y/!/ /
t2
g
s/0\B\|[!#]/ /g
D

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page