bubble sort by emoken

1d
s/^.$/ &/
H
$!d
g
s/\n/ /g
s/.*/compare =  0   swap =  0   data:&#/
:
s/: ../&%/
:4
h
s/.*\(.\)\(.\)% \(.\)\(.\).*/\1\3\n\2\4/
:2
s/  /=/gm
s/ ./</gm
s/. />/gm
y/0123456789/ 012345678/
/[ 0-9]/b2
s/[=\n]*//
/^</{g
s/%\( ..\)/\1%/
b3}
g
s/\( ..\)%\( ..\)/\2\1%/
s/p /p+/
:3
s/e /e+/
:5
s/\(+= *\) \(9\+ \)/\10\2/
h
y/0123456789/1234567890/
x
G
s/\(.*\)+\(=[ 0-9]*\)[0-8]9*\(.*\)\n.*+=[ 0-9]*\([1-9]0*\).*/\1 \2\4\3/
/+/b5
h
s/[%#]//gp
g
/%#/!b4
s/\( ..\)%#/#\1/
/: ..#/Q
b

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

download

return to the top page