Encoder decoder by flagitious

if gets=="encode\n"
gets p
gsub(/.(.)/m){putc$&;$1}
puts$_.reverse
else
gets p
($_.size/2).times{|i|
  putc $_[i]
  putc $_[~i]
}
putc'.'
end

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

download

return top