Output Sequence by This is fun but is there an easy way to check/update?

tr = ''\x0d
br = ''\x0d
cr = nil\x0d
1.step(100,1) do |c| \x0d
  mf = c % 5 == 0\x0d
  mt = c % 3 == 0\x0d
  f = c > 9 ? "  " : " "\x0d
  d = mt && ((c - 1) % 5 == 0 || (c - 2) % 5 == 0)\x0d
  if d \x0d
    puts tr\x0d
    tr = br + c.to_s\x0d
    br = " " * tr.length\x0d
    next\x0d
  else \x0d
    cr = mf ? tr : (mt ? br : cr)\x0d
  end\x0d
  cr == br ? br << c.to_s && tr << f : tr << c.to_s && br << f  \x0d
end\x0d
puts tr + "\n" + br

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

download

return to the top page