March 2014 update

This commit is contained in:
Ingy döt Net 2014-04-02 16:56:35 +00:00
parent 09687c4926
commit a25938f123
1846 changed files with 21876 additions and 5203 deletions

View file

@ -0,0 +1,33 @@
text = <<EOS
#### #
# # #
# # #
#### # # ### # #
# # # # # # # #
# # # # # # #
# # ### ### #
#
#
EOS
def banner3D(text, shift=-1)
txt = text.each_line.map{|line| line.gsub('#','__/').gsub(' ',' ')}
offset = Array.new(txt.size){|i| " " * shift.abs * i}
offset.reverse! if shift < 0
txt.each_with_index{|line,i| puts offset[i] + line}
end
banner3D(text)
puts
# Another solution:
def banner3D(text, shift=-2)
txt = text.each_line.map{|line| line.chomp + ' '}
offset = Array.new(txt.size){|i| " " * shift.abs * i}
offset.reverse! if shift < 0
txt.each_with_index do |line,i|
line2 = line.gsub!(' ',' ').dup
puts offset[i] + line.gsub('#','///').gsub('/ ','/\\')
puts offset[i] + line2.gsub('#','\\\\\\\\\\').gsub('\ ','\/')
end
end
banner3D(text)