Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
# ++ ++ # || _/||\_ || || _/||\_ || # || _/::||::\_ || || _/::||::\_ || # || _/::::||::::\_ || || _/::::||::::\_ || # ||_/::::::||::::::\_|| ||_/::::::||::::::\_|| # ||:::::::/||\:::::::|| ||:::::::/||\:::::::|| # ||::::::/.||.\::::::|| ||::::::/.||.\::::::|| # ||:::::/..||..\:::::|| ||:::::/..||..\:::::|| # ||::::/...||...\::::|| ||::::/...||...\::::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||==================|| ||==================|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||:::|....||....|:::|| ||:::|....||....|:::|| # ||==================|| ||==================|| # + + # | _/|\_ | | _/|\_ | # | _/::|::\_ | | _/::|::\_ | # |_/::::|::::\_| |_/::::|::::\_| # |:::::/|\:::::| |:::::/|\:::::| # |::::/.|.\::::| |::::/.|.\::::| # |:::/..|..\:::| |:::/..|..\:::| # |::|...|...|::| |::|...|...|::| # |::|...|...|::| |::|...|...|::| # |::|...|...|::| |::|...|...|::| # |=============| |=============| # |::|...|...|::| |::|...|...|::| # |::|...|...|::| |::|...|...|::| # |::|...|...|::| |::|...|...|::| # |=============| |=============| SIZE = 20 def column return "|" * (SIZE / 2) end def center_top spaces = (" " * (SIZE / 2)) + (" " * (SIZE * 2)) return spaces + ("+" * (SIZE / 2)) + spaces end def body return (":" * (SIZE - 1)) + "|" + ("." * SIZE) end def seperator return ("=" * (SIZE * 2)) + ("=" * (SIZE / 2)) + ("=" * (SIZE * 2)) end def draw_top puts center_top end def draw_roof SIZE.times do |i| # 6, 4, 2, 0 # 0, 2, 4, 6 n = i + 1 str = " " * ((SIZE - n) * 2) str += "_/" str += ":" * (i * 2) puts column + str + column + (str.reverse.sub(/\//,'\\')) + column end end def draw_steeple SIZE.times do |i| n = i + 1 str = ":" * (SIZE * 2 - n) str += "/" str += "." * i puts column + str + column + (str.reverse.sub(/\//,'\\')) + column end end def draw_window SIZE.times { puts column + body + column + body.reverse + column } end def draw_floor puts column + seperator + column end draw_top draw_roof draw_steeple draw_window draw_floor draw_window draw_floor
From the Design Piracy series on my blog: