Created
July 22, 2017 02:28
-
-
Save katsuyan/306d5eb4af59137a0ba25b98776272d7 to your computer and use it in GitHub Desktop.
数学パズルonClojure-Q9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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