Ruby Golf - music

Ruby

Public Domain

Download (right click, save as, rename as appropriate)

Embed

Tags:

golf music
1
2
3
a,s=(eval "[]"+"<<gets.split(//)"*12).reverse.transpose,""
(a.size/4).times{|i|s<<((a[4*i].index("o")+4)%7+65)<<(a[4*i].member?("|")?"/"+(2**(2+a[4*i+1].find_all{|o|o=="\\"}.size)).to_s: "")+" "}
puts s