fork(1) download
  1. r=?D
  2. z=(3..2*x=2**gets.to_i.times{r.gsub!(/\w/){$&<?H?'-H|+D|D+|H-':'+D|-H|H-|D+'}}).map{' '*2*x}
  3. y=d=0
  4. r.bytes{|c|c>99?(z[y-=s=-~d/2%2][x-=1-d/2]='/\\'[d%2]
  5. x+=d/2
  6. y+=1-s):d=3&d-c}
  7. puts z.map &:rstrip
Success #stdin #stdout 0.01s 7416KB
stdin
3
stdout
        \
      /\/
     /   /\
     \/\ \ \
   /\  / / /
  / /  \/  \/\
  \ \/\  /\   \
 \/   / / / /\/
   /\/ /  \ \
   \   \/\ \/
    \/\   \
      / /\/
      \ \
       \/