Output Sequence by Daniel

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

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

download

return to the top page