Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
数学パズルonClojure-Q9
(ns puzzule.q9)
(defn path-recur [b g]
(cond (or (= b g) (= (- b g) 10)) 0
(or (= b 0) (= g 0)) 1
:else (+ (path-recur (- b 1) g)
(path-recur b (- g 1)))))
(defn path [b g]
(path-recur (- b 1) g))
(path 20 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment