Skip to content

Instantly share code, notes, and snippets.

@divs1210 divs1210/pascal.clj
Last active Dec 17, 2018

What would you like to do?
(ns pascal)
(defn step [row]
(let [parents (partition 2 1 row)
new-row-middle (map (fn [[x y]]
(+ x y))
(concat [1] new-row-middle [1])))
(defonce pascals-triangle
(iterate step [1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.