Pascal's triangle/Puzzle: Difference between revisions
Content added Content deleted
(revised Clojure version) |
(minor correction to Clojure version) |
||
Line 240: | Line 240: | ||
If you want to solve the whole pyramid, just add a call ''(show-pyramid x z)'' to the previous ''let'' form: |
If you want to solve the whole pyramid, just add a call ''(show-pyramid x z)'' to the previous ''let'' form: |
||
<lang lisp> |
<lang lisp> |
||
(defn dot [v1 v2] (reduce + (* v1 v2))) |
(defn dot [v1 v2] (reduce + (map * v1 v2))) |
||
(defn show-pyramid [x z] |
(defn show-pyramid [x z] |