bubble sort by Mithran

<>;map{printf'compare =%3d   swap =%3d   data:'.'%3d'x@_.$/,++$#,$-+=$_[$==--$_]<$_[--$_]&&(@_[$_,$=]=@_[$=,$_],1),@_}2..--$.for@_=<>

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

download

return to the top page