This weekend I decided to try my hand at some Scala and Clojure. I\'m proficient with object oriented programming, and so Scala was easy to pick up as a language, but wante
Here is another (functional) Clojure solution:
(defn avarage [coll] (/ (reduce + coll) (count coll))) (defn ma [period coll] (map avarage (partition period 1 coll)))
The zeros at the beginning of the sequence must still be added if that is a requirement.