Created
May 1, 2013 22:12
-
-
Save dragonfax/5498799 to your computer and use it in GitHub Desktop.
quick ruby one liner to rotate banner'ed text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some version of banner will rotate the text for you. The version provided by osx doesn't. So I whipped this up. I've made no attempt to simplify, optimize, or make it pretty. Its one-time use. | |
But you should really be using figlets. | |
[31] pry(main)> rotated = []; y = 0; `banner -w 30 W T F`.split("\n").each { |line| x = 0; line.each_char { |char| rotated[x] ||= []; rotated[x][y] = char; x += 1 }; y += 1}; puts rotated.reverse.map { |line| line.map!{ |char| char || ' '}; line.join('') }.join("\n") | |
#### ### ########## ########## | |
## # ## ## # ## ## | |
## ## ## # ## # | |
## # # ## # ## # | |
## # ## ## | |
### # ## ## | |
## # ## ## | |
## # ## ## # | |
## # # ## ####### | |
## # # ## ## ## | |
### ## # ## ## # | |
## ### ## ## | |
## #### ## ## | |
## #### ## ## | |
### ### ## ## | |
## ### ## ## | |
## ## ## ## | |
## # ## ## | |
# # ## ## | |
# # ## ## | |
# #### #### | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment