Skip to content

Instantly share code, notes, and snippets.

@michaelfeathers
Created February 3, 2015 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelfeathers/271173b28e26f7834673 to your computer and use it in GitHub Desktop.
Save michaelfeathers/271173b28e26f7834673 to your computer and use it in GitHub Desktop.
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