Daniel X Moore wrote: > Wow, this is some great discussion! Both piano and guitar chords are > fine, some of the benefits on these broader quizzes are seeing > alternative solutions and understanding the problem from different > angles. Likewise the discussions about the differences between > classical and jazz are also welcome. After all, the most important > part of any programming project is understanding the domain. > > This writeup is going to be a fun one. Keep the solutions and the > discussion coming! Thanks for the confirmation. I agree, can't wait until the writeup is posted. On reviewing David Springer's solution, I found that our solutions are quite similar (actually, mine's pretty much the same except shorter and with more regex - after completion, it'll probably be a lot closer). Would both of our solution merit entries on the Ruby Quiz website? Also, could someone with some time give a brief run-through of what happens when Evan Hanson's code is run? I don't think I understand it. What I think happens: Make a new Chord object Chord#initialize: Set @name to the note and @numval to to the notes position in Map.sharps Parse note skipping the first character and sharp/flat it if it's b or # (I'd use a different method though, becouse susb or something would be picked up) Flat things by subtracting one from @numval (I think it should have an error check, @numval=11 if (@numval-=1)<0 to make it easier to port to other languages) and changing the value of @name (easier done in my opinion by using Map.flats[@numval]) Sharp things by adding one from @numval (I think it should have an error check, @numval=0 if (@numval+=1)==12 to make it easier to port to other languages) and changing the value of @name (easier done in my opinion by using Map.sharps[@numval]) Chord#to_s: Returns @name But that would only return the input in a fancy way! I don't see how it returns chords. David Springer wrote: > I'm not sure about the etiquette of attaching a non-compressed file. Personally, I prefer the attachment of non-compressed files to the attachment of compressed files or inline code, because it keeps the thread short, makes the code easier to read (all-the-way-left-justified and full width), and the code is easier to download (for me, it takes just 10 keystrokes, no need to search for where it begins/ends and click+drag). That's just me, though, and Hal Fulton doesn't agree: > Frankly, I'd rather see inline code rather than an attachment. Especially if attaching doesn't save any space. Thanks in advance, Ben. -- Posted via http://www.ruby-forum.com/.