Back to task

456 symbols bash
Sat Aug 13 04:04:41 2016 hidefromkgb
g()(rev<<<"$1"|fold -w1)
h()(p=${@: -1};k=(`yes _|head -${#p}`);p=(${k[@]});l=(`g $3`);r=(`g $2`)
for x in ${1//,/ };do n=${x#*:};x=m=${x%:*};k[$x]=$[++j]
while((m>=n));do p[$m]=-;l[$[${#3}?m--:y++]]=${r[$[${#3}?y++:m--]]};done
p[$x]=\/;p[$n]=^;((n<x))&&p[$n]=\\
done;sed 's/ //g;s/+_*/\n/g;y/_/ /'<<<:+${k[@]}+${p[@]}+${l[@]}|rev)
read -d $'\4' s i d o<<<`tr -d \ |cut -d: -f2-`
i=`h $i $s`;e=${i##*$'\n'};echo "From${i%$e}$s

=`rev<<<$e`

To`h $o $e $d`"


Leave a comment

Parsed as Markdown

Login to leave a comment