fork download
  1. while gets; $_.chop! # Simulate -nl flags
  2.  
  3. y,x=x,$_.scan(/..?/)
  4. (puts [x.zip(y).map{|c|(("%2s"*2%c).bytes.reduce(:+)/4.0).round.chr*2}*""]*2
  5. y,x=x,[])if$.%2<1||$<.eof?
  6.  
  7. end
Success #stdin #stdout 0.02s 9776KB
stdin
%%%%%%%%%%%%%
% Hello,    %
%    world! %
%%%%%%%%%%%%%
stdout
$$>>II99######
$$>>II99######
$$##88KKGG####
$$##88KKGG####