Output Sequence by bookga

m = {1 => ""}\x0d
r = 1\x0d
rd = {1 => 0}\x0d
(1..100).each do |c|\x0d
\x0d
  if c % 3 == 0 && c % 5 > 0    \x0d
    rd[r] += 1\x0d
    c.to_s.length.times { m[r] << " "} unless rd[r] == 2\x0d
    r += 1\x0d
  end\x0d
  \x0d
  if c % 5 == 0 && c % 3 > 0\x0d
    c.to_s.length.times { m[r] << " "}  \x0d
    r -= 1\x0d
  end\x0d
  if m[r].nil?\x0d
    m[r] = ""\x0d
    rd[r] = 0\x0d
    (m[r-1].to_s.length - c.to_s.length).times { m[r] << " " }\x0d
  end\x0d
  c.to_s.length.times { m[r-1] << " " } unless r == 1 ||  c % 3 ==  0 ||  rd[r-1] == 2\x0d
  c.to_s.length.times { m[r+1] << " " } unless m[r+1].nil? ||  c % 5 ==  0\x0d
   \x0d
   m[r] << c.to_s\x0d
end\x0d
\x0d
(1..15).each {|i| puts m[i].to_s}\x0d
\x0d
\x0d
\x0d
#this is a test

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

download

return top