Created
February 3, 2015 12:37
-
-
Save michaelfeathers/271173b28e26f7834673 to your computer and use it in GitHub Desktop.
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
STRING_COUNT = 6 | |
def tab_column string, fret | |
["---" ] * (string - 1) + | |
[fret.ljust(3,'-')] + | |
["---" ] * (STRING_COUNT - string) | |
end | |
puts ARGF.each_line | |
.map(&:split) | |
.map {|string,fret| tab_column(string.to_i, fret) } | |
.transpose | |
.map(&:join) | |
.join($/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment