I agree. That is 1 million times better. Sometimes I wonder why I don't think of these things. I'll probably fix the code and use something like that... except in Python, obv.
Hey, yeah Ruby is a bit easier for me :) Your code is correct so it's not terrible. As to why you didn't think of it.. maybe it's because you practice less at making code look as pretty as possible?
It is something I practice a lot, maybe because it's in Ruby's culture, or just because I enjoy making code look pretty.
When I look at your two for loops that twice make a range, and have a bunch of magic numbers, all kinds of alarm bells go off. It should be one loop if possible, if there are magic numbers they should be in a constant at the top of the file.
Actually, the way you construct the seedList is interesting. A Haskell programmer might have done the same thing, because keeping indexes is ugly in Haskell, and doing operations on infinite lists (which you emulate by appending a copy) are pretty. Perhaps you are just a functional programmer, using a non-functional language :D
Yeah, I am more of a functional programmer and yeah, I sometimes let some ugliness slip in especially in looping in Python. At least there is none of this crap in production somewhere. :) n00b.
It would look better if it was in Scheme or Clojure, but that stuff's too scary for most readers. At least that's the story I'll maintain here.
I would love to see a Scheme or Clojure version of the code. I posted an attempt at it in Haskell, the only functional programming language I know, but it isn't particularily beautiful.
Thanks a ton for the great explanation, I dropped you a line about some typos and other off-topic stuff.
Of all the bits and pieces I've looked at over the years explaining the circle of fifths this is the one that stands out for me as the easiest to remember. Being able to re-derive from basic principles is so much better than memorization.
I agree. That is 1 million times better. Sometimes I wonder why I don't think of these things. I'll probably fix the code and use something like that... except in Python, obv.
Thank you;